Search in sources :

Example 16 with LayoutInflater

use of android.view.LayoutInflater in project cw-android by commonsguy.

the class ConstantsBrowser method add.

private void add() {
    LayoutInflater inflater = LayoutInflater.from(this);
    View addView = inflater.inflate(R.layout.add_edit, null);
    final DialogWrapper wrapper = new DialogWrapper(addView);
    new AlertDialog.Builder(this).setTitle(R.string.add_title).setView(addView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            processAdd(wrapper);
        }
    }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
        // ignore, just dismiss
        }
    }).show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) LayoutInflater(android.view.LayoutInflater) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 17 with LayoutInflater

use of android.view.LayoutInflater in project UltimateRecyclerView by cymcsg.

the class SimpleSectionedAdapter method onCreateSectionHeaderViewHolder.

@Override
protected HeaderViewHolder onCreateSectionHeaderViewHolder(ViewGroup parent, int viewType) {
    LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    View view = inflater.inflate(getLayoutResource(), parent, false);
    HeaderViewHolder holder = new HeaderViewHolder(view, getTitleTextID());
    return holder;
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 18 with LayoutInflater

use of android.view.LayoutInflater in project PhotoPicker by donglua.

the class PopupDirectoryListAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
        LayoutInflater mLayoutInflater = LayoutInflater.from(parent.getContext());
        convertView = mLayoutInflater.inflate(R.layout.__picker_item_directory, parent, false);
        holder = new ViewHolder(convertView);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    holder.bindData(directories.get(position));
    return convertView;
}
Also used : LayoutInflater(android.view.LayoutInflater)

Example 19 with LayoutInflater

use of android.view.LayoutInflater in project UltimateRecyclerView by cymcsg.

the class DragAdatper method onCreateViewHolder.

@Override
public MainViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    View view = inflater.inflate(R.layout.rv_item_linear, parent, false);
    MainViewHolder holder = new MainViewHolder(this, view);
    view.setOnClickListener(holder);
    view.setOnLongClickListener(holder);
    return holder;
}
Also used : LayoutInflater(android.view.LayoutInflater) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 20 with LayoutInflater

use of android.view.LayoutInflater in project UltimateRecyclerView by cymcsg.

the class SwipeableUltimateRecyclerview method initViews.

@Override
protected void initViews() {
    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.swipeable_ultimate_recycler_view_layout, this);
    mRecyclerView = (SwipeListView) view.findViewById(R.id.ultimate_list);
    mSwipeRefreshLayout = (VerticalSwipeRefreshLayout) view.findViewById(R.id.swipe_refresh_layout);
    setScrollbars();
    mSwipeRefreshLayout.setEnabled(false);
    if (mRecyclerView != null) {
        mRecyclerView.setClipToPadding(mClipToPadding);
        if (mPadding != -1.1f) {
            mRecyclerView.setPadding(mPadding, mPadding, mPadding, mPadding);
        } else {
            mRecyclerView.setPadding(mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom);
        }
    }
    defaultFloatingActionButton = (FloatingActionButton) view.findViewById(R.id.defaultFloatingActionButton);
    setDefaultScrollListener();
    mEmpty = (ViewStub) view.findViewById(R.id.emptyview);
    mFloatingButtonViewStub = (ViewStub) view.findViewById(R.id.floatingActionViewStub);
    mEmpty.setLayoutResource(mEmptyId);
    mFloatingButtonViewStub.setLayoutResource(mFloatingButtonId);
    if (mEmptyId != 0)
        mEmptyView = mEmpty.inflate();
    mEmpty.setVisibility(View.GONE);
    if (mFloatingButtonId != 0) {
        mFloatingButtonView = mFloatingButtonViewStub.inflate();
        mFloatingButtonView.setVisibility(View.VISIBLE);
    }
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) SwipeListView(com.marshalchen.ultimaterecyclerview.swipelistview.SwipeListView)

Aggregations

LayoutInflater (android.view.LayoutInflater)1227 View (android.view.View)743 TextView (android.widget.TextView)570 ImageView (android.widget.ImageView)242 ViewGroup (android.view.ViewGroup)127 Context (android.content.Context)123 ListView (android.widget.ListView)115 LinearLayout (android.widget.LinearLayout)102 AdapterView (android.widget.AdapterView)94 RecyclerView (android.support.v7.widget.RecyclerView)87 Intent (android.content.Intent)81 DialogInterface (android.content.DialogInterface)74 AlertDialog (android.app.AlertDialog)71 FrameLayout (android.widget.FrameLayout)48 TypedArray (android.content.res.TypedArray)43 OnClickListener (android.view.View.OnClickListener)40 Button (android.widget.Button)40 Bundle (android.os.Bundle)39 Activity (android.app.Activity)38 AlertDialog (android.support.v7.app.AlertDialog)37