staggered layout manager recyclerview android code example
Example 1: recyclerview linearlayoutmanager kotlin
var linearLayoutManager: LinearLayoutManager = LinearLayoutManager(
activity?.applicationContext,
LinearLayout.VERTICAL,
false
)
list.layoutManager = linearLayoutManager
Example 2: recyclerview layout oncreatw
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_listitem,parent,false);
ViewHolder Holder = new ViewHolder(view);
return Holder;
}