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:fr.cph.chicago.core.adapter.PopupBusDetailsFavoritesAdapter.java

@Override
public final View getView(final int position, final View convertView, final ViewGroup parent) {
    final LayoutInflater vi = (LayoutInflater) parent.getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    final View rowView = vi.inflate(R.layout.popup_bus_cell_0, parent, false);
    final TextView textView = (TextView) rowView.findViewById(R.id.label);
    final String toDisplay = values.get(position).getStopName() + " ("
            + WordUtils.capitalize(values.get(position).getBound().toLowerCase()) + ")";
    textView.setText(toDisplay);//w ww  . j a va  2  s .c  o  m
    return rowView;
}

From source file:com.yasiradnan.Schedule.ScheduleSlideFragment.java

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

    final ListView list = (ListView) rootView.findViewById(R.id.list);
    BinderData bindingData = new BinderData(this.getActivity(), ScheduleInformation);
    list.setAdapter(bindingData);//from   ww  w.  j a  va  2s . co m

    list.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> a, View v, int position, long id) {
            ScheduleItem item = ScheduleInformation[position];

            if (item.getItemType() == 0 || item.getItemType() == 3 || item.getItemType() == 2)
                return;

            Intent intent = new Intent(ScheduleSlideFragment.this.getActivity(), ContentExtended.class);
            intent.putExtra("title", item.getTitle());
            intent.putExtra("content", item.getContent());
            startActivity(intent);
        }
    });

    return rootView;
}

From source file:com.example.ali.rottentomatoesmaterialsample.BoxOfficeListFragment.java

@Nullable
@Override/*from  w  w  w  .ja v  a 2 s .  com*/
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_box_office_list, container, false);

    rv = (RecyclerView) view.findViewById(R.id.recyclerview);
    rv.setLayoutManager(new LinearLayoutManager(rv.getContext()));
    context = getActivity();

    mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefreshLayout);
    mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            fetchBoxOfficeMovies();
        }
    });

    //fetchBoxOfficeMoviesWithDummyData();
    fetchBoxOfficeMovies();

    return view;
}

From source file:com.givon.baseproject.xinlu.fragment.CollectionFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View convertView = inflater.inflate(R.layout.layout_listview_fragment, container, false);
    mListView = (PullListView) convertView.findViewById(R.id.id_pull_listview);
    mListView.setHeaderDividersEnabled(false);
    mListView.setFooterDividersEnabled(false);
    return convertView;
}

From source file:com.krayzk9s.imgurholo.ui.ImagePager.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View result = inflater.inflate(R.layout.image_viewpager, container, false);
    pager = (ViewPager) result.findViewById(R.id.pager);
    ImageAdapter adapter = new ImageAdapter(getChildFragmentManager());
    pager.setAdapter(adapter);/*from   w ww .  ja v  a2 s. c  om*/
    if (savedInstanceState == null)
        pager.setCurrentItem(start);
    return (result);
}

From source file:cz.msebera.unbound.dns.fragments.MainLogFragment.java

@Nullable
@Override//from   w  w w  .  j  a v a 2 s.c o  m
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.textview, container, false);
    mTextArea = (TextView) v.findViewById(R.id.textview);
    File logFile = new File(getActivity().getFilesDir(), getString(R.string.path_mainlog));
    mTailer = Tailer.create(logFile, this, 400, true);
    return v;
}

From source file:li.klass.fhem.appwidget.view.widget.base.otherWidgets.OtherWidgetsFragment.java

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

    ListView listView = (ListView) view.findViewById(R.id.list);
    listView.setOnItemClickListener(new OnItemClickListener() {
        @Override//from  w  w  w  .  ja v a2  s .c  om
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            WidgetType widgetType = (WidgetType) view.getTag();
            OtherWidgetsFragment.this.onClick(widgetType);
        }
    });

    OtherWidgetsAdapter adapter = new OtherWidgetsAdapter(getActivity());
    listView.setAdapter(adapter);

    LinearLayout emptyView = (LinearLayout) view.findViewById(R.id.emptyView);
    fillEmptyView(emptyView, R.string.widgetNoOther, container);

    return view;
}

From source file:com.royclarkson.springagram.HomeFragment.java

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

From source file:com.example.administrator.myapplication2._4_Detail.LeftFragment.java

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

    Intent myIntent = getActivity().getIntent();
    if (myIntent != null) {
        seq = myIntent.getStringExtra("seq");
    }//  w  w w.ja  va 2  s . com

    tvHeart = (TextView) rootView.findViewById(R.id.tvHeart);
    tvDistance = (TextView) rootView.findViewById(R.id.tvDistance);
    tvCalorie = (TextView) rootView.findViewById(R.id.tvCalorie);
    tvWeight = (TextView) rootView.findViewById(R.id.tvWeight);
    ;
    tvRuntime = (TextView) rootView.findViewById(R.id.tvRuntime);

    SharedPreferences myPrefs = this.getActivity().getSharedPreferences("login", Context.MODE_PRIVATE);
    if ((myPrefs != null) && (myPrefs.contains("id"))) {
        id = myPrefs.getString("id", "");
        Log.i("logintest", id.toString());
    }

    getRecentData();

    return rootView;
}

From source file:com.google.cast.samples.games.starcast.StarCastFragment.java

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

    mTouchControllerView = (TouchControllerView) view.findViewById(R.id.touch_controller);

    mFireButton = (Button) view.findViewById(R.id.button_fire);
    mFireButton.setOnClickListener(new OnClickListener() {

        @Override//from   w ww  . jav  a  2  s.c om
        public void onClick(View view) {
            StarcastApplication.getInstance().getSendMessageHandler().enqueueMessage(MESSAGE_TYPE_STARCAST_FIRE,
                    createFireMessage());
        }

    });
    return view;
}