Example usage for android.view LayoutInflater inflate

List of usage examples for android.view LayoutInflater inflate

Introduction

In this page you can find the example usage for android.view LayoutInflater inflate.

Prototype

public View inflate(XmlPullParser parser, @Nullable ViewGroup root, boolean attachToRoot) 

Source Link

Document

Inflate a new view hierarchy from the specified XML node.

Usage

From source file:mobisocial.bento.anyshare.ui.FeedItemListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View root = inflater.inflate(R.layout.fragment_feeditemlist, container, false);

    // ListView//from  ww  w . j  av a 2 s.c  om
    mListView = (ListView) root.findViewById(android.R.id.list);
    mListView.setFastScrollEnabled(true);

    registerForContextMenu(mListView);
    return root;
}

From source file:com.mercandalli.android.apps.files.admin.RequestFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_request, container, false);

    Animation animOpen = AnimationUtils.loadAnimation(getContext(), R.anim.circle_button_bottom_open);
    rootView.findViewById(R.id.circle).startAnimation(animOpen);

    rootView.findViewById(R.id.circle).setOnClickListener(new OnClickListener() {
        @Override//from w ww . j  a  v  a2s  . c  o m
        public void onClick(View v) {
            new DialogRequest(getActivity(), new IPostExecuteListener() {
                @Override
                public void onPostExecute(JSONObject json, String body) {
                    if (json != null) {
                        ((EditText) rootView.findViewById(R.id.console))
                                .setText(((EditText) rootView.findViewById(R.id.console)).getText().toString()
                                        + "JSON : " + json + "\n\n");
                    } else {
                        ((EditText) rootView.findViewById(R.id.console))
                                .setText(((EditText) rootView.findViewById(R.id.console)).getText().toString()
                                        + "BODY : " + body + "\n\n");
                    }
                }
            });
        }
    });

    return rootView;
}

From source file:com.skubit.bitid.fragments.SignInResponseFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_signin_response, container, false);
    TextView messageView = (TextView) view.findViewById(R.id.message);

    final String message = getArguments().getString("message");
    final int resultCode = getArguments().getInt("resultCode");
    if (resultCode == ResultCode.OK) {
        messageView.setText("Login successful");
    } else {//from  w  ww . j  av  a 2 s  . c  om
        messageView.setText(getMessageValue(message));
    }

    Button done = (Button) view.findViewById(R.id.doneBtn);
    done.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mAuthCallbacks != null) {
                mAuthCallbacks.sendResultsBackToCaller(resultCode, message);
            }
        }
    });

    return view;
}

From source file:com.savvywits.wethepeople.RESTResultFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.results_list, container, false);
    mReplist.clear();//from  w ww  . j  av  a  2s. c o m
    setListAdapter(mAdapter);
    return view;
}

From source file:net.redwarp.android.app.githubcount.ProjectDetailFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.activity_main, container, false);

    mTitleLabel = (TextView) view.findViewById(R.id.title);
    mListView = (ExpandableListView) view.findViewById(R.id.listView);

    return view;/*w  w w .  j  av  a  2  s .  com*/
}

From source file:com.vrem.wifianalyzer.vendor.VendorAdapter.java

@NonNull
@Override/*from   w w  w .j  av a 2 s .c o  m*/
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
    View view = convertView;
    if (view == null) {
        LayoutInflater layoutInflater = MainContext.INSTANCE.getMainActivity().getLayoutInflater();
        view = layoutInflater.inflate(R.layout.vendor_details, parent, false);
    }
    String name = getItem(position);
    ((TextView) view.findViewById(R.id.vendor_name)).setText(name);

    StringBuilder stringBuilder = new StringBuilder();
    IterableUtils.forEach(vendors.get(name), new MacsClosure(stringBuilder));
    ((TextView) view.findViewById(R.id.vendor_macs)).setText(stringBuilder.toString());
    return view;
}

From source file:com.example.fabian.matchit.FragmentTabsProduct.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View v = inflater.inflate(R.layout.fragment_tabbar, container, false);

    return v;//  ww  w . j  av  a  2 s . c o  m
}

From source file:com.memetro.android.alerts.HashtagFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View inflated = inflater.inflate(R.layout.fragment_thermometer, container, false);

    alertListView = (PullToRefreshListView) inflated.findViewById(R.id.alertListView);

    alertListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
        @Override//ww w .j av a  2s  .com
        public void onRefresh(PullToRefreshBase<ListView> refreshView) {
            getTweets();
        }
    });

    getTweets();
    setList();

    return inflated;
}

From source file:at.bitfire.davdroid.ui.setup.QueryServerDialogFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    return inflater.inflate(R.layout.setup_query_server, container, false);
}

From source file:com.ritul.truckshare.Fragments.UpdateProfile.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.profile_tabs_fragment, container, false);
    setHasOptionsMenu(true);/*from   w  w w  .j  ava  2  s.  c om*/
    return view;
}