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();
}
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;
}
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;
}
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;
}
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);
}
}
Aggregations