I am using Recyclerview with StaggeredGridLayoutManager
StaggeredGridLayoutManager gridLayoutManager =
new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL);
recyclerView.setLayoutManager(gridLayoutManager);
I want variable columns having fixed height row.
item.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp">
<Button
android:id="@+id/btnName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_bg"
android:padding="4dp"
android:singleLine="true"
android:text="@string/category_name"
android:textAppearance="@style/TextAppearance.AppCompat" />
</RelativeLayout>
Desired View Example
Current view