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:com.chaosinmotion.securechat.fragments.OnboardingLoginAccount.java

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

From source file:com.perm.DoomPlay.LyricsDialog.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    title = getArguments().getString(keyLyricsTitle);
    View view = inflater.inflate(R.layout.dialog_lyrics, container, false);
    getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    linearLoading = (LinearLayout) view.findViewById(R.id.linearLoading);
    textView = (TextView) view.findViewById(R.id.textLyrics);

    if (savedInstanceState != null) {
        lyrics = savedInstanceState.getString("keyLyrics");
        isFirstResume = lyrics == null;/*  w  w w  . ja v  a  2 s .c  o m*/
        linearLoading.setVisibility(View.GONE);
    } else
        isFirstResume = true;

    isLoading = false;

    return view;
}

From source file:fm.krui.kruifm.ScheduleFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.new_schedule_layout, container, false);
    rootView = view;//from  w w  w  .j  a v  a  2 s. co m
    return view;
}

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

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mActivity.fullActionBar();//from w w  w .  j  a  v  a2 s . co  m
    View inflated = inflater.inflate(R.layout.fragment_thermometer, container, false);

    // Crowdfunding
    inflated.findViewById(R.id.crowdfunding).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("http://goteo.org/project/memetro-app/home"));
            startActivity(browserIntent);
        }
    });

    alertListView = (PullToRefreshListView) inflated.findViewById(R.id.alertListView);
    noAlerts = (LinearLayout) inflated.findViewById(R.id.no_alerts);

    alertListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
        @Override
        public void onRefresh(PullToRefreshBase<ListView> refreshView) {
            getAlerts();
        }
    });

    setList();
    getAlerts();

    alertListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            try {
                Alert alert = alerts.get(i - 1);
                CommentDialog.showDialog(mActivity, alert.description, alert.username,
                        (alert.username.equals(userData.username)), alert.alertId);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });

    return inflated;
}

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

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_admin_data, container, false);
    circularProgressBar = (ProgressBar) rootView.findViewById(R.id.circularProgressBar);
    this.message = (TextView) rootView.findViewById(R.id.message);

    circle = rootView.findViewById(R.id.circle);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.my_recycler_view);
    recyclerView.setHasFixedSize(true);/*from  w  w  w .ja va 2  s  .  co m*/
    mLayoutManager = new LinearLayoutManager(getActivity());
    recyclerView.setLayoutManager(mLayoutManager);

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

    swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
            android.R.color.holo_green_light, android.R.color.holo_orange_light,
            android.R.color.holo_red_light);

    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh() {
            refreshList();
        }
    });

    refreshList();

    return rootView;
}

From source file:com.ymt.demo1.plates.hub.FireHubMainFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scrollview_list_view, container, false);
    initView(view);//from www  .  ja v a 2  s  .c o  m
    return view;
}

From source file:cc.softwarefactory.lokki.android.fragments.ContactsFragment.java

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

    View rootView = inflater.inflate(R.layout.activity_contacts, container, false);
    aq = new AQuery(getActivity(), rootView);
    cancelAsynTasks = false;/*w w w .j  a v a 2  s . co m*/
    context = getActivity().getApplicationContext();
    avatarLoader = new AvatarLoader(context);
    new GetPeopleThatCanSeeMe().execute();
    return rootView;
}

From source file:com.paramonod.kikos.ListContentFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    RecyclerView recyclerView = (RecyclerView) inflater.inflate(R.layout.recycler_view, container, false);
    ContentAdapter adapter = new ContentAdapter(recyclerView.getContext());
    recyclerView.setAdapter(adapter);//w  w  w.  ja v  a  2 s  .  c om
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    return recyclerView;
}

From source file:com.mercandalli.android.apps.files.user.RegistrationFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_registration, container, false);
    this.mUsername = (EditText) rootView.findViewById(R.id.fragment_registration_username);
    this.mPassword = (EditText) rootView.findViewById(R.id.fragment_registration_password);

    ((CheckBox) rootView.findViewById(R.id.fragment_registration_auto_connection))
            .setChecked(Config.isAutoConnection());
    ((CheckBox) rootView.findViewById(R.id.fragment_registration_auto_connection))
            .setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override/*from w  w  w . j  a v a2  s  .  c  o m*/
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    Config.setAutoConnection(getContext(), isChecked);
                }
            });

    this.mUsername.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER))
                    || (actionId == EditorInfo.IME_ACTION_DONE)) {
                RegistrationFragment.this.mPassword.requestFocus();
                return true;
            }
            return false;
        }
    });

    this.mPassword.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER))
                    || (actionId == EditorInfo.IME_ACTION_DONE)) {
                inscription();
                return true;
            }
            return false;
        }
    });

    return rootView;
}

From source file:es.wolfi.app.passman.CredentialDisplay.java

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