Is it possible to change the itemResourceId layout at runtime ?
So you have two or more layout such as grid section and linear section ( gridview layout or list layout for item ).
In ItemViewHolder :
@Override
public RecyclerView.ViewHolder getItemViewHolder(View view) {
return new ItemViewHolder(view);
}
but in recyclerview you can make
@NonNull
@Override
public CustomViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) {
View itemView;
if (i == LIST_ITEM) {
itemView = layoutInflater.inflate(R.layout.list_item, parent, false);
} else {
itemView = layoutInflater.inflate(R.layout.grid_item, parent, false);
}
return new CustomViewHolder (itemView);
}
or can you add methods in Section
setItemViewHolder(/' new resource layout '/)
setHeaderViewHolder(/' new resource layout '/)
setFooterViewHolder(/' new resource layout '/)
Is it possible to change the itemResourceId layout at runtime ?
So you have two or more layout such as grid section and linear section ( gridview layout or list layout for item ).
In ItemViewHolder :
but in recyclerview you can make
@NonNull
or can you add methods in Section setItemViewHolder(/' new resource layout '/) setHeaderViewHolder(/' new resource layout '/) setFooterViewHolder(/' new resource layout '/)
Thanks in advance.