Activity getLayoutInflater - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Activity getLayoutInflater method.

This code example shows how to use the following methods:getLayoutInflater
 
    } 
 
    @Override 
    protected void configureList(Activity activity, ListView listView) {
        super.configureList(activity, listView);
 
        listView.setFastScrollEnabled(true);
        listView.setDividerHeight(0);
 
        getListAdapter() 
                .addHeader(activity.getLayoutInflater()
                        .inflate(R.layout.news_list_item_labels, null));
    } 
 
    @Override 
    LogoutService getLogoutService() { 
        return logoutService;
    } 
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater, getResources
  } 
 
  private View getSimpleView(int position, View convertView, ViewGroup parent) {
    View row = convertView;
    if (!(row instanceof TextView)) {
      LayoutInflater inflater = activity.getLayoutInflater();
      row = inflater.inflate(android.R.layout.simple_list_item_1, parent, false);
    } 
       
    String item = (String)getItem(position);
     
    TextView textView = (TextView)row.findViewById(android.R.id.text1);
    float scale = activity.getResources().getDisplayMetrics().density;
    boolean leftPadding = (parent.getTag().equals("right"));
    boolean topPadding = (position == 0);
    textView.setPadding((int)(20 * scale) * (leftPadding ? 2 : 1), (int)(20 * scale) * (!leftPadding && topPadding ? 1 : 0), (int)(20 * scale), 0);
    textView.setText(item);
    textView.setTextColor(Color.BLACK);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
     
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater
 
    } 
 
    @Override 
    protected void configureList(Activity activity, ListView listView) {
        super.configureList(activity, listView);
 
        listView.setFastScrollEnabled(true);
        listView.setDividerHeight(0);
 
        getListAdapter().addHeader(activity.getLayoutInflater()
                        .inflate(R.layout.user_list_item_labels, null));
    } 
 
    @Override 
    LogoutService getLogoutService() { 
        return logoutService;
    } 
 
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater
    private boolean mAutoRequery;
    private boolean mRequeryPending;
 
    public ChatListAdapter(Activity activity) {
        mActivity = activity;
        mInflate = activity.getLayoutInflater();
        mHandler = new SimpleAlertHandler(activity);
 
        mAdapter = new ListTreeAdapter(null);
 
        mContentObserver = new MyContentObserver();
        mDataSetObserver = new MyDataSetObserver();
        mQueryHandler = new QueryHandler(activity);
 
    } 
 
    public void changeConnection(IImConnection conn) {
        mQueryHandler.cancelOperation(TOKEN_ONGOING_CONVERSATION);
 
        synchronized (this) {
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater, getResources, getTheme
	private LayoutInflater inflater;
	private int color;
 
	public SpinnerAdapter(Activity context, List<T> objects) {
		this.objects = objects;
		inflater = context.getLayoutInflater();
		TypedValue tv = new TypedValue();
		context.getTheme().resolveAttribute(android.R.attr.textColorPrimary, tv, true);
		color = context.getResources().getColor(tv.resourceId);
	} 
 
	@Override 
	public int getCount() { 
		return objects.size() + 1;
	} 
 
	@Override 
	public Object getItem(int position) {
		if (position == 0)
			return null; 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getApplication, getLayoutInflater
	 * Статус дефектов для отображения. 
	 */ 
	private Status status;
 
	public HoleAdapter(Activity activity, Status status) {
		rosyama = (Rosyama) activity.getApplication();
		layoutInflater = activity.getLayoutInflater();
		this.status = status;
	} 
 
	/** 
	 * Изменяет статус дефектов для отображения. 
	 *  
	 * @param status 
	 */ 
	public void setStatus(Status status) {
		this.status = status;
		notifyDataSetChanged();
	} 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater
 
	private final LayoutInflater mInflater;
	private final String[] mItems;
	 
	public MyAdapter(Activity c,String[] objects) {
		mInflater = c.getLayoutInflater();
		mItems = objects;
	} 
	 
	public int getCount() { 
		return mItems.length;
	} 
	 
	@Override 
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.listitem, null);
		} 
		((TextView)convertView).setText(mItems[position]);
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater
 
    } 
 
    @Override 
    protected void configureList(Activity activity, ListView listView) {
        super.configureList(activity, listView);
 
        listView.setFastScrollEnabled(true);
        listView.setDividerHeight(0);
 
        getListAdapter() 
                .addHeader(activity.getLayoutInflater()
                        .inflate(R.layout.checkins_list_item_labels, null));
    } 
 
    @Override 
    LogoutService getLogoutService() { 
        return logoutService;
    } 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater, getListView, from
 
    protected LayoutInflater inflater;
 
    public ListAdapterWithProgress(ListActivity activity, int progressDrawableResourceId) {
        this.context = activity;
        this.listView = activity.getListView();
        this.progressView = activity.getLayoutInflater().inflate(progressDrawableResourceId,
            listView, false);
        this.inflater = LayoutInflater.from(activity);
    } 
 
    /** 
     * {@inheritDoc} 
     * <p> 
     * Don't use this to check for the presence of actual data items; use 
     * {@link #hasItems()} instead. 
     * </p> 
     */ 
    public int getCount() { 
        int size = 0;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLayoutInflater
   * @param flags 
   * @param layoutResourceId 
   */ 
  public SingleTypeCursorAdapter(final Activity activity, final Cursor cursor,
      final int flags, final int layoutResourceId) {
    this(activity, cursor, flags, activity.getLayoutInflater(),
        layoutResourceId);
  } 
 
  /** 
   * Create adapter 
   * 
   * @param context 
   * @param cursor 
   * @param flags 
   * @param layoutResourceId 
   */ 
  public SingleTypeCursorAdapter(final Context context, final Cursor cursor,
      final int flags, final int layoutResourceId) {
    this(context, cursor, flags, LayoutInflater.from(context), layoutResourceId);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Activity getLayoutInflater Questions & Answers:

Other Activity getLayoutInflater Examples

21:	    super.onCreate(savedInstanceState);
22:	    GestureOverlayView gestureOverlayView = new GestureOverlayView(this);
23:	    View inflate = getLayoutInflater().inflate(R.layout.main, null);
24:	    gestureOverlayView.addView(inflate);
25:	    gestureOverlayView.addOnGesturePerformedListener(this);

Read More

getLayoutInflater Method Overview
Convenience for calling getLayoutInflater().
See Code Examples for other Android Activity Methods: