use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.
the class DraggableWithSectionExampleAdapter method onCreateViewHolder.
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
final View v;
switch(viewType) {
case ITEM_VIEW_TYPE_SECTION_HEADER:
v = inflater.inflate(R.layout.list_section_header, parent, false);
break;
case ITEM_VIEW_TYPE_SECTION_ITEM:
v = inflater.inflate(R.layout.list_item_draggable, parent, false);
break;
default:
throw new IllegalStateException("Unexpected viewType (= " + viewType + ")");
}
return new MyViewHolder(v);
}
use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.
the class DraggableSwipeableExampleAdapter method onCreateViewHolder.
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
final View v = inflater.inflate((viewType == 0) ? R.layout.list_item_draggable : R.layout.list_item2_draggable, parent, false);
return new MyViewHolder(v);
}
use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.
the class AddRemoveExpandableExampleAdapter method onCreateGroupViewHolder.
@Override
public MyGroupViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
final View v = inflater.inflate(R.layout.list_group_item_with_add_remove_buttons, parent, false);
return new MyGroupViewHolder(v, mItemOnClickListener);
}
use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.
the class ExpandableDraggableWithSectionExampleAdapter method onCreateGroupViewHolder.
@Override
public MyGroupViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
final View v;
switch(viewType) {
case GROUP_ITEM_VIEW_TYPE_SECTION_HEADER:
v = inflater.inflate(R.layout.list_section_header, parent, false);
break;
case GROUP_ITEM_VIEW_TYPE_SECTION_ITEM:
v = inflater.inflate(R.layout.list_group_item_draggable, parent, false);
break;
default:
throw new IllegalStateException("Unexpected viewType (= " + viewType + ")");
}
return new MyGroupViewHolder(v);
}
use of android.view.LayoutInflater in project android-advancedrecyclerview by h6ah4i.
the class SwipeableExampleAdapter method onCreateViewHolder.
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
final LayoutInflater inflater = LayoutInflater.from(parent.getContext());
final View v = inflater.inflate(R.layout.list_item, parent, false);
return new MyViewHolder(v);
}
Aggregations