Remove Child view if Parent has empty child in Expandable list view Kotlin

Issue Adapter Class —————— class FilterByTypeExpandableListAdapter(val filterByData: (FilterByItemDataModel) -> Unit) : BaseExpandableListAdapter() { private lateinit var parentList: ArrayList<String> private lateinit var childList: HashMap<String, ArrayList<String>> override fun getGroupCount(): Int { return parentList.size } override fun getChildrenCount(groupPosition: Int): Int { val childCount:

Continue reading

How to set RecyclerView Max Height

Issue I want to set Max Height of RecylerView.I am able to set max height using below code.Below code makes height 60% of current screen. DisplayMetrics displaymetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); int a = (displaymetrics.heightPixels * 60) / 100; recyclerview1.getLayoutParams().height

Continue reading

Android: Creating RecyclerView programmatically won't work

Issue I have a RecyclerView in the xml like this: <LinearLayout android:id="@+id/llTestMenuMain" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/gradient" android:orientation="vertical"> <androidx.recyclerview.widget.RecyclerView android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone" android:id="@+id/rv" /> </LinearLayout> and using it to show a dynamic list of buttons like this: int buttonFontSize = 20; RecyclerView

Continue reading