Example usage for android.content Context LAYOUT_INFLATER_SERVICE

List of usage examples for android.content Context LAYOUT_INFLATER_SERVICE

Introduction

In this page you can find the example usage for android.content Context LAYOUT_INFLATER_SERVICE.

Prototype

String LAYOUT_INFLATER_SERVICE

To view the source code for android.content Context LAYOUT_INFLATER_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.view.LayoutInflater for inflating layout resources in this context.

Usage

From source file:com.money.manager.ex.currency.list.CurrencyListAdapter.java

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.item_currency, parent, false);

    // holder/* w w  w.  j a v  a2  s.  c o m*/
    CurrencyListItemViewHolder holder = new CurrencyListItemViewHolder(view);
    // add holder to the view.
    view.setTag(holder);

    return view;
}

From source file:biz.easymenu.easymenung.ErrorFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    li = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    //this.setCancelable(false);
}

From source file:com.accia77.mockey.adapters.ManageEntriesCustomCursorAdapter.java

public ManageEntriesCustomCursorAdapter(Context context, Cursor c, int flags) {
    super(context, c, flags);
    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

From source file:com.hybris.mobile.adapter.BasketAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    CartItem cartItem = items.get(position);
    View rowView = null;//from w  ww .  ja  va2s.  c o m

    if (cartItem instanceof CartEntry) {
        CartEntry cartEntry = (CartEntry) cartItem;

        rowView = inflater.inflate(R.layout.cart_row, parent, false);

        TextView lblProductTitle = (TextView) rowView.findViewById(R.id.lbl_product_title);
        TextView lblProductPrice = (TextView) rowView.findViewById(R.id.lbl_price_quantity);
        TextView lblManufacturer = (TextView) rowView.findViewById(R.id.lbl_productManufacturer);
        TextView lblTotal = (TextView) rowView.findViewById(R.id.lbl_total);
        ImageView productImage = (ImageView) rowView.findViewById(R.id.img_product);

        if (StringUtils.isEmpty(cartEntry.getProduct().getManufacturer())) {
            lblManufacturer.setHeight(0);
        } else {
            lblManufacturer.setText(cartEntry.getProduct().getManufacturer());
        }
        lblProductTitle.setText(cartEntry.getProduct().getName());
        lblProductPrice.setText(cartEntry.getBasePrice().getFormattedValue() + " - "
                + this.getContext().getString(R.string.cartentry_quantity_placeholder)
                + cartEntry.getQuantity().toString());
        lblManufacturer.setText(cartEntry.getProduct().getManufacturer());

        lblTotal.setText(cartEntry.getTotalPrice().getFormattedValue());
        UrlImageViewHelper.setUrlDrawable(productImage, cartEntry.getProduct().getThumbnail(),
                R.drawable.loading_drawable);
    }

    return rowView;
}

From source file:com.irccloud.android.fragment.TextListFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Context ctx = getActivity();/*ww w  .  j ava  2 s. c  o m*/
    if (ctx == null)
        return null;

    LayoutInflater inflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.dialog_textlist, null);
    textView = v.findViewById(R.id.textView);
    textView.setHorizontallyScrolling(true);
    textView.setMovementMethod(new ScrollingMovementMethod());

    if (savedInstanceState != null && savedInstanceState.containsKey("text")) {
        text = savedInstanceState.getString("text");
    }

    if (text != null) {
        setText(text);
    }

    Dialog d = new AlertDialog.Builder(ctx).setView(v).setTitle(title)
            .setNegativeButton("Close", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            }).create();
    return d;
}

From source file:com.hybris.mobile.adapter.AddressAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.selectable_row, parent, false);
    TextView textView = (TextView) rowView.findViewById(android.R.id.text1);
    TextView textTitle = (TextView) rowView.findViewById(R.id.textTitle);

    String strName = "";

    CartDeliveryAddress address = addresses.get(position);

    if (StringUtils.isNotBlank(address.getLine1())) {
        strName = address.getLine1();/*www.  java 2s  .c o m*/
    }
    if (StringUtils.isNotBlank(address.getLine2())) {
        strName = strName + "\n" + address.getLine2();
    }
    if (StringUtils.isNotBlank(address.getTown())) {
        strName = strName + "\n" + address.getTown();
    }
    if (StringUtils.isNotBlank(address.getPostalCode())) {
        strName = strName + "\n" + address.getPostalCode();
    }
    if (address.getCountry() != null) {
        strName = strName + "\n" + address.getCountry().getName();
    }

    textTitle.setText(address.getTitle() + " " + address.getFirstName() + " " + address.getLastName());
    textTitle.setVisibility(View.VISIBLE);

    textView.setText(strName);

    return rowView;
}

From source file:com.emuneee.nctrafficcams.ui.adapters.DefaultCamerasAdapter.java

public DefaultCamerasAdapter(Context context, Cursor cursor) {
    super(context, cursor, 0);
    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

From source file:com.google.android.leanbackjank.presenter.HeaderItemPresenter.java

@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup) {
    mUnselectedAlpha = viewGroup.getResources().getFraction(R.fraction.lb_browse_header_unselect_alpha, 1, 1);
    LayoutInflater inflater = (LayoutInflater) viewGroup.getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View view = inflater.inflate(R.layout.header_item, null);
    view.setAlpha(mUnselectedAlpha); // Initialize icons to be at half-opacity.

    return new ViewHolder(view);
}

From source file:an.it.disasterassistancesystem.fragments.AdvancedSearchFragment.java

private void setupViewPager() {
    ArrayList<ViewPagerViewer> lst = new ArrayList<ViewPagerViewer>();

    lst.add(new ViewPagerViewer() {
        @Override/*from  ww  w .  j  av  a  2  s.  c o  m*/
        public View getView() {
            LayoutInflater inflater = (LayoutInflater) getContext()
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View v = inflater.inflate(R.layout.fragment_advanced_search_drivers, null);

            return v;

        }

        @Override
        public String getViewTitle() {
            return "Find Driver";
        }
    });
    lst.add(new ViewPagerViewer() {
        //  private ATextBoxGroup mLiencesTBG;

        @Override
        public View getView() {
            LayoutInflater inflater = (LayoutInflater) getContext()
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View v = inflater.inflate(R.layout.fragment_advanced_search_employers, null);
            //  //   mLiencesTBG = (ATextBoxGroup) v.findViewById(R.id.atbgr_license);
            /*      ((LinearLayout) v.findViewById(R.id.ln_liences)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                final ArrayList<String> titles = new ArrayList<String>();
                titles.add("A1");
                titles.add("A2");
                titles.add("A3");
                titles.add("B1");
                titles.add("B2");
                    
                final CheckBoxDialog dialog = new CheckBoxDialog(getContext());
                dialog.setLstCheck(titles);
                dialog.setTitle(getResources().getString(R.string.title_licenses));
                dialog.show();
                dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
                    @Override
                    public void onDismiss(DialogInterface dialogInterface) {
                    
                        mLiencesTBG.setTextBoxList(dialog.getCheckedList());
                    }
                });
            }
                  });*/
            return v;
        }

        @Override
        public String getViewTitle() {
            return "Find Employer";
        }
    });
    AnITVPAdapter adapter = new AnITVPAdapter(lst);
    mViewPager.setAdapter(adapter);
}

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);/*  ww w  .j  av  a  2s .  c o  m*/
    return rowView;
}