Example usage for android.view LayoutInflater from

List of usage examples for android.view LayoutInflater from

Introduction

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

Prototype

public static LayoutInflater from(Context context) 

Source Link

Document

Obtains the LayoutInflater from the given context.

Usage

From source file:com.best.ui.Otpdescdetail.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT)
        TransitionEffect.callOverridePendingTransition(this);

    me = this;// w w w  .  jav a 2 s  . c o  m
    m_context = this;
    me.setContentView(com.best.ui.R.layout.routing);
    mInflater = LayoutInflater.from(m_context);

    Bundle bundle = getIntent().getExtras();

    String DESCRIP = bundle.getString("routeName"); //my description string.
    routeNames = DESCRIP.split(",");
    System.out.println("CPlan.plan.size() " + CPlan.plan.size());
    System.out.println("CPlan.plan.get(0).legs.size()" + CPlan.plan.get(0).legs.size());
    System.out.println("CPlan.plan.get(1).legs.size()" + CPlan.plan.get(1).legs.size());
    System.out.println("routeNames.length" + routeNames.length);
    position = bundle.getInt("position"); //CPlan.plan.get(position).legs.get(0).v2.size()
    System.out.println("position " + position); //legs.get(CPlan.i).v2.size()
    System.out.println(" CPlan.plan.size() " + CPlan.plan.size());

    ItineraryObject = CPlan.ItineraryListJsonObject.get(position);
    ItineraryJsonObject = (JSONObject) ItineraryObject;//legs.get(CPlan.i).v2.size()

    ctrip = CPlan.plan.get(position);
    System.out.println("CTrip.legs.size()*  " + ctrip.legs.size());

    legStartTime = new String[routeNames.length];
    legFrom_name = new String[routeNames.length];
    legEndTime = new String[routeNames.length];
    legto_name = new String[routeNames.length]; //no of legs
    for (int j = 0; j < routeNames.length; j++) {
        System.out.println("j " + j);

        legStartTime[j] = ctrip.legs.get(j).legStartTimeObject;//legStartTimeObject

        legFrom_name[j] = ctrip.legs.get(j).From_name.toString(); //From_name

        legEndTime[j] = ctrip.legs.get(j).legEndTime; //legEndTime

        legto_name[j] = ctrip.legs.get(j).To_name.toString();
    }
    System.out.println("busHead.length " + legStartTime.length);
    System.out.println("totalDist.length " + legFrom_name.length);
    System.out.println("busFreq.length " + legto_name.length);
    System.out.println("no_Stops.length " + legEndTime.length);

    init(this);
}

From source file:arun.com.popularmovies.adapters.GridAdapter.java

@Override
public GridAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    // create a new view
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.grid_item_layout, parent, false);
    return new ViewHolder(view);
}

From source file:ac.robinson.mediaphone.provider.NarrativeAdapter.java

public NarrativeAdapter(BrowserActivity activity, boolean showKeyFrames, boolean isTemplateView) {
    super(activity, null, 0); // null cursor and no auto querying - we use a loader to manage cursors

    mActivity = activity;//from w  w  w  .j av  a 2  s  .  c om
    mInflater = LayoutInflater.from(activity);

    mShowKeyFrames = showKeyFrames;
    mIsTemplateView = isTemplateView;

    // bit of a hack - use "null" for an item id that isn't (probably...) in the database
    mEmptyAdapter = new FrameAdapter(mActivity, "null");
    mEmptyAdapter.setShowKeyFrames(false);
    mEmptyAdapter.setSelectAllFramesAsOne(false);
}

From source file:app.webelement.com.employeetracker.rd.RecyclerListAdapter.java

@Override
public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_main, parent, false);
    ItemViewHolder itemViewHolder = new ItemViewHolder(view);
    return itemViewHolder;
}

From source file:com.chintans.venturebox.cards.SystemCard.java

public SystemCard(Context context, AttributeSet attrs, RomUpdater romUpdater, Bundle savedInstanceState) {
    super(context, attrs, savedInstanceState);
    setLayoutId(R.layout.card_system);/*from w  ww. jav  a 2s. c  o  m*/
    setTopTitle(getResources().getString(R.string.system_title), getResources().getColor(R.color.primary_text));
    mContext = context;
    mRomUpdater = new RomUpdater(mContext, false);

    LayoutInflater inflater = LayoutInflater.from(context);
    View view = inflater.inflate(R.layout.card_system, this);

    TextView romView = (TextView) view.findViewById(R.id.rom);
    romView.setText(getResources().getString(R.string.system_rom, romUpdater.getVersion().toString(false)));

    TextView maintainerView = (TextView) view.findViewById(R.id.maintainer);
    maintainerView.setText(getResources().getString(R.string.system_maintainer, romUpdater.getMaintainer()));

    mSeparator = view.findViewById(R.id.separator);
    mUpdateItem = (Item) view.findViewById(R.id.update_found);
    refreshCard();
}

From source file:androidv7.rmenu.BaseMenuPresenter.java

@Override
public void initForMenu(Context context, MBuilder menu) {
    mContext = context;
    mInflater = LayoutInflater.from(mContext);
    mMenu = menu;
}

From source file:android.support.wear.internal.widget.drawer.MultiPageUi.java

@Override
public void initialize(WearableNavigationDrawerView drawer, WearableNavigationDrawerPresenter presenter) {
    if (drawer == null) {
        throw new IllegalArgumentException("Received null drawer.");
    }/*from  w  w w . j  a v  a2s.c  o  m*/
    if (presenter == null) {
        throw new IllegalArgumentException("Received null presenter.");
    }
    mPresenter = presenter;

    LayoutInflater inflater = LayoutInflater.from(drawer.getContext());
    final View content = inflater.inflate(R.layout.ws_navigation_drawer_view, drawer, false /* attachToRoot */);

    mNavigationPager = (ViewPager) content.findViewById(R.id.ws_navigation_drawer_view_pager);
    mPageIndicatorView = (PageIndicatorView) content.findViewById(R.id.ws_navigation_drawer_page_indicator);

    drawer.setDrawerContent(content);
}

From source file:com.knurld.dropboxdemo.KnurldActivity.java

public PopupWindow showLoadingPopup(View view) {
    View spinnerView = LayoutInflater.from((Activity) context).inflate(R.layout.loading_popup, null);
    ProgressBar progressBar = (ProgressBar) spinnerView.findViewById(R.id.speakProgress);
    progressBar.getIndeterminateDrawable().setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);

    PopupWindow popupWindow = new PopupWindow(spinnerView, 500, 500);
    popupWindow.setFocusable(true);//  w  w w .j av  a  2s .  c o m
    popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
    return popupWindow;
}

From source file:com.QuarkLabs.BTCeClient.fragments.OrdersBookFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPairsSpinner = (Spinner) LayoutInflater.from(getActivity()).inflate(R.layout.spinner, null);
    mPairsSpinner.setAdapter(new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1,
            getResources().getStringArray(R.array.ExchangePairs)));
    //restoring spinner position
    if (savedInstanceState != null) {
        mPairsSpinner.setSelection(savedInstanceState.getInt("position"));
    }//from  w ww  .  ja  v a  2 s  .com
    mPairsSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            String selected = parent.getSelectedItem().toString();
            Bundle bundle = new Bundle();
            bundle.putString("pair", selected);
            if (mFragmentOpenedFirstTime) {
                getLoaderManager().initLoader(LOADER_ID, bundle, OrdersBookFragment.this);
                mFragmentOpenedFirstTime = false;
            } else {
                getLoaderManager().restartLoader(LOADER_ID, bundle, OrdersBookFragment.this);
            }
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {

        }
    });

    mAsksAdapter = new OrdersBookAdapter(getActivity());
    mBidsAdapter = new OrdersBookAdapter(getActivity());
}

From source file:com.ibuildapp.romanblack.CouponPlugin.CouponAdapter.java

/**
 * Constructs new EventsAdapter instance
 * @param context - Activity that using this adapter
 * @param list - event items list//from w w  w  .  ja  va 2 s.c  o  m
 * @param bgColor 
 */
CouponAdapter(Context context, ArrayList<CouponItem> list, int bgColor) {
    items = list;
    layoutInflater = LayoutInflater.from(context);

    downloadTask = new ImageDownloadTask();
    downloadTask.execute(items);
}