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:net.oremland.rss.reader.fragments.BaseListFragment.java

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

From source file:androidGLUESigner.ui.Fragments.SignedDocListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    this.settingsHelper = new SettingsHelper(getActivity());
    this.view = inflater.inflate(R.layout.fragment_sdoclist, container, false);
    final ListView listview = (ListView) view.findViewById(R.id.sdocListView);
    list = settingsHelper.getSignedDocList();
    adapter = new SdocListAdapter(getActivity(), android.R.layout.simple_list_item_1, list);
    listview.setAdapter(adapter);//from   ww  w.j ava2 s  .  com
    listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            SignedDocActivity activity = (SignedDocActivity) getActivity();
            activity.launchReader(list.get(position));

        }
    });
    listview.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, final View view, int position, long id) {
            final String item = (String) parent.getItemAtPosition(position);
            showDeleteButton(item, list);

            return true;
        }
    });
    this.deleteButton = (ImageButton) view.findViewById(R.id.sigListDeleteButton);
    return view;
}

From source file:com.example.run_tracker.ProfileFragment.java

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

    View rootView = inflater.inflate(R.layout.profilefragment, container, false);

    mSubmit = (Button) rootView.findViewById(R.id.submit);
    mUsername = (EditText) rootView.findViewById(R.id.username);
    mPassword1 = (EditText) rootView.findViewById(R.id.newpassword1);
    mPassword2 = (EditText) rootView.findViewById(R.id.newpassword2);
    mName = (EditText) rootView.findViewById(R.id.name);
    mSurname = (EditText) rootView.findViewById(R.id.surname);
    mSubmit.setOnClickListener(this);
    mUsername.setEnabled(false);/*from   w w w .java 2  s.  co m*/
    Make_get_profile_request();

    return rootView;

}

From source file:com.miz.mizuu.fragments.FanartSearchFragment.java

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

From source file:com.hybris.mobile.app.commerce.fragment.StoreDetailsFragment.java

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

From source file:com.sakisds.icymonitor.fragments.ProcessesFragment.java

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

    mSettings = getActivity().getSharedPreferences(MainViewActivity.SHAREDPREFS_FILE, Context.MODE_PRIVATE);

    mMemUsageProgress = (ProgressBar) rootView.findViewById(R.id.progressBar_memory);
    mTxtPercent = (TextView) rootView.findViewById(R.id.textView_percent);
    mTxtTotalMem = (TextView) rootView.findViewById(R.id.textView_total);
    mTxtUsedMem = (TextView) rootView.findViewById(R.id.textView_free);

    mHeader = rootView.findViewById(R.id.process_header);
    mError = rootView.findViewById(R.id.emptyhidden);
    mError.setOnClickListener(this);

    mProgressBar = rootView.findViewById(R.id.progressBar_list);

    setHasOptionsMenu(true);/* w ww  . ja  v  a2 s . c  o m*/

    return rootView;
}

From source file:es.uniovi.imovil.fcrtrainer.highscores.HighscoresFragment.java

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

    mRootView = inflater.inflate(R.layout.fragment_highscores, container, false);

    initializeLevelSpinner();/*  w  ww  .  ja  v a 2  s. c  om*/
    initializeExerciseSpinner();

    // El ListView se inicializa porque cuando se carga el spinner, se
    // genera un evento onItemSelected del spinner

    return mRootView;
}

From source file:com.chaosinmotion.securechat.fragments.LoginAccount.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    return inflater.inflate(R.layout.fragment_login, container, false);
}

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

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

    this.circle = (ImageButton) this.rootView.findViewById(R.id.circle);
    this.circle.setVisibility(View.GONE);

    this.username = (TextView) this.rootView.findViewById(R.id.username);
    this.password = (TextView) this.rootView.findViewById(R.id.password);

    this.newUser = new UserModel();

    this.username.addTextChangedListener(new TextWatcher() {
        @Override/* ww  w . j ava  2  s.  c  om*/
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (!StringUtils.isNullOrEmpty(s.toString())
                    && !StringUtils.isNullOrEmpty(password.getText().toString())) {
                circle.setVisibility(View.VISIBLE);
            } else {
                circle.setVisibility(View.GONE);
            }
            newUser.username = s.toString();
        }

        @Override
        public void afterTextChanged(Editable s) {
        }
    });
    this.password.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (!StringUtils.isNullOrEmpty(s.toString())
                    && !StringUtils.isNullOrEmpty(username.getText().toString())) {
                circle.setVisibility(View.VISIBLE);
            } else {
                circle.setVisibility(View.GONE);
            }
            newUser.password = HashUtils.sha1(s.toString());
        }

        @Override
        public void afterTextChanged(Editable s) {
        }
    });

    this.circle.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            // Register : POST /user
            List<StringPair> parameters = new ArrayList<>();
            parameters.add(new StringPair("username", "" + newUser.username));
            parameters.add(new StringPair("password", "" + newUser.password));

            if (NetUtils.isInternetConnection(getContext()) && !StringUtils.isNullOrEmpty(newUser.username)
                    && !StringUtils.isNullOrEmpty(newUser.password)) {
                requestLaunched = true;
                (new TaskPost(getActivity(), Constants.URL_DOMAIN + Config.ROUTE_USER,
                        new IPostExecuteListener() {
                            @Override
                            public void onPostExecute(JSONObject json, String body) {
                                try {
                                    if (json != null) {
                                        if (json.has("succeed") && json.getBoolean("succeed")) {
                                            Toast.makeText(getActivity(), "User added", Toast.LENGTH_SHORT)
                                                    .show();
                                        }
                                        if (json.has("user")) {
                                            JSONObject user = json.getJSONObject("user");
                                            if (user.has("id")) {
                                                Config.setUserId(getActivity(), user.getInt("id"));
                                            }
                                        }
                                    } else {
                                        Toast.makeText(getContext(), R.string.server_error, Toast.LENGTH_SHORT)
                                                .show();
                                    }
                                } catch (JSONException e) {
                                    Log.e(getClass().getName(), "Failed to convert Json", e);
                                }
                                requestLaunched = false;
                            }
                        }, parameters)).execute();
            } else {
                requestLaunched = false;
                Toast.makeText(getActivity(), "Request not sent", Toast.LENGTH_SHORT).show();
            }
        }
    });

    return this.rootView;
}

From source file:com.chess.genesis.activity.RegisterFrag.java

@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    initBaseContentFrag(container);/*from   w ww  .j a  v  a2 s.c o m*/

    final View view = inflater.inflate(R.layout.fragment_register, container, false);

    // create network client instance
    net = new NetworkClient(act, handle);
    progress = new ProgressMsg(act);

    // setup click listeners
    final View image = view.findViewById(R.id.register);
    image.setOnClickListener(this);

    return view;
}