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.nextgis.woody.fragment.PhotoFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_empty, container, false);
    LinearLayout layout = (LinearLayout) view.findViewById(R.id.photo_holder);
    IFormControl control = (PhotoGallery) getActivity().getLayoutInflater()
            .inflate(com.nextgis.maplibui.R.layout.formtemplate_photo, layout, false);

    MapBase mapBase = MapBase.getInstance();
    VectorLayer layer = (VectorLayer) mapBase.getLayerByName(Constants.KEY_MAIN);
    ((PhotoGallery) control).init(layer, mFeatureId);
    try {//www .jav a2 s .  c o m
        control.init(null, null, null, null, null);
    } catch (JSONException e) {
        e.printStackTrace();
    }
    control.addToLayout(layout);
    return view;
}

From source file:com.fusionx.lightirc.ui.IRCFragment.java

protected View createView(final ViewGroup container, final LayoutInflater inflater) {
    return inflater.inflate(R.layout.fragment_irc, container, false);
}

From source file:com.deveo.android.ProjectTeamFragment.java

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

    if (rootView != null) {
        ListView listView = (ListView) rootView.findViewById(R.id.list_view_events_project_team);
        listView.setAdapter(adapter);/*from   ww  w  .  jav  a2  s.  c  o m*/
    }

    return rootView;
}

From source file:com.deveo.android.ProjectSCMFragment.java

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

    if (rootView != null) {
        ListView listView = (ListView) rootView.findViewById(R.id.list_view_events_project_scm);
        listView.setAdapter(adapter);//  ww w.j av a  2  s .  c  o m
    }

    return rootView;
}

From source file:com.gammalabs.wifianalyzer.wifi.ChannelAvailableAdapter.java

@NonNull
@Override//  ww  w. ja va2 s. com
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.channel_available_details, parent, false);
    }
    WiFiChannelCountry wiFiChannelCountry = getItem(position);
    ((TextView) view.findViewById(R.id.channel_available_country))
            .setText(wiFiChannelCountry.getCountryCode() + " - " + wiFiChannelCountry.getCountryName());
    ((TextView) view.findViewById(R.id.channel_available_title_ghz_2))
            .setText(String.format(Locale.ENGLISH, "%s : ", WiFiBand.GHZ2.getBand()));
    ((TextView) view.findViewById(R.id.channel_available_ghz_2))
            .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ2().toArray(), ","));
    ((TextView) view.findViewById(R.id.channel_available_title_ghz_5))
            .setText(String.format(Locale.ENGLISH, "%s : ", WiFiBand.GHZ5.getBand()));
    ((TextView) view.findViewById(R.id.channel_available_ghz_5))
            .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ5().toArray(), ","));
    return view;
}

From source file:kr.co.generic.wifianalyzer.wifi.ChannelAvailableAdapter.java

@NonNull
@Override/*from  w  w  w  .  j av a  2s .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(kr.co.generic.wifianalyzer.R.layout.channel_available_details, parent,
                false);
    }
    WiFiChannelCountry wiFiChannelCountry = getItem(position);
    ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_country))
            .setText(wiFiChannelCountry.getCountryCode() + " - " + wiFiChannelCountry.getCountryName());
    ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_title_ghz_2))
            .setText(String.format(Locale.ENGLISH, "%s : ", WiFiBand.GHZ2.getBand()));
    ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_ghz_2))
            .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ2().toArray(), ","));
    ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_title_ghz_5))
            .setText(String.format(Locale.ENGLISH, "%s : ", WiFiBand.GHZ5.getBand()));
    ((TextView) view.findViewById(kr.co.generic.wifianalyzer.R.id.channel_available_ghz_5))
            .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ5().toArray(), ","));
    return view;
}

From source file:com.vrem.wifianalyzer.wifi.channelavailable.ChannelAvailableAdapter.java

@NonNull
@Override/*from ww w .jav a 2  s .c om*/
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.channel_available_details, parent, false);
    }

    WiFiChannelCountry wiFiChannelCountry = getItem(position);
    ((TextView) view.findViewById(R.id.channel_available_country))
            .setText(wiFiChannelCountry.getCountryCode() + " - " + wiFiChannelCountry.getCountryName());
    ((TextView) view.findViewById(R.id.channel_available_title_ghz_2)).setText(String.format(Locale.ENGLISH,
            "%s : ", view.getResources().getString(WiFiBand.GHZ2.getTextResource())));
    ((TextView) view.findViewById(R.id.channel_available_ghz_2))
            .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ2().toArray(), ","));
    ((TextView) view.findViewById(R.id.channel_available_title_ghz_5)).setText(String.format(Locale.ENGLISH,
            "%s : ", view.getResources().getString(WiFiBand.GHZ5.getTextResource())));
    ((TextView) view.findViewById(R.id.channel_available_ghz_5))
            .setText(StringUtils.join(wiFiChannelCountry.getChannelsGHZ5().toArray(), ","));
    return view;
}

From source file:com.vrem.wifianalyzer.wifi.timegraph.TimeGraphFragment.java

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

    swipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.graphRefresh);
    swipeRefreshLayout.setOnRefreshListener(new ListViewOnRefreshListener());

    timeGraphAdapter = new TimeGraphAdapter();
    addGraphViews(swipeRefreshLayout, timeGraphAdapter);

    Scanner scanner = MainContext.INSTANCE.getScanner();
    scanner.register(timeGraphAdapter);/*from   w w w .  j  a v a 2 s. c  om*/

    return view;
}

From source file:edu.stanford.mobisocial.dungbeetle.ui.adapter.ObjectListCursorAdapter.java

@Override
public View newView(Context context, Cursor c, ViewGroup parent) {
    final LayoutInflater inflater = LayoutInflater.from(context);
    View v = inflater.inflate(R.layout.objects_item, parent, false);
    bindView(v, context, c);/*ww  w . j av a2  s  .c o  m*/

    return v;
}

From source file:com.vrem.wifianalyzer.wifi.channelgraph.ChannelGraphFragment.java

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

    swipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.graphRefresh);
    swipeRefreshLayout.setOnRefreshListener(new ListViewOnRefreshListener());

    LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.graphNavigation);
    ChannelGraphNavigation channelGraphNavigation = new ChannelGraphNavigation(linearLayout, getActivity());
    channelGraphAdapter = new ChannelGraphAdapter(channelGraphNavigation);
    addGraphViews(swipeRefreshLayout, channelGraphAdapter);

    Scanner scanner = MainContext.INSTANCE.getScanner();
    scanner.register(channelGraphAdapter);

    return view;/*from  w w w .  jav  a2  s .c  o m*/
}