I have a very simple question that for some reason cannot be implemented. I have a RecyclerView that populates only once when it creates an activity. I want to add another look to it.
If the RecyclerView does not fill the entire length of the screen (usually in portrait mode), the view should be located directly below it.
If the RecyclerView exceeds the length of the screen (usually in landscape mode), the view should still be located under it, but also should be fixed on the bottom of the screen.
Here it is.
I tried to arrange them in RelativeLayout, LinearLayout or CoordinatorLayout. With match_parent, wrap_content (with or without setAutoMeasureEnabled). With app: layout_anchor and app: layout_anchorGravity, but nothing works.
Appreciate any help.
This is an example of one of my attempts:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" /> </android.support.design.widget.AppBarLayout> <android.support.v7.widget.RecyclerView android:id="@+id/features_list" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_anchor="@id/features_list" app:layout_anchorGravity="bottom" /> </android.support.design.widget.CoordinatorLayout>
Asafk source share