1

I have an activity with a bottom sheet container and a bottom navigation bar. The bottom sheet houses a recyclerview with a linear layout. I would like to know how can I add space at the end of the last the item on the recyclerview to prevent the bottom navigation bar from hiding the last item.

I have tried setting clipToPadding to false but it didnt work:

  <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/coordinator"
  tools:context="com.jaribio.jaribio.MainFragments.HomeFragment">
    <RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent">
      <com.github.ybq.android.spinkit.SpinKitView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        android:id="@+id/spin_kit"
        style="@style/SpinKitView.Large.CubeGrid"
        android:layout_centerHorizontal="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="50dp"
        app:SpinKit_Color="@color/colorPrimary"/>
      <ImageView
        android:layout_width="match_parent"
        android:layout_height="800dp"
        android:visibility="gone"
        android:src="@drawable/waiting"
        android:id="@+id/question_image"
        android:scaleType="centerCrop"
        />
      <com.jaribio.jaribio.Utilities.CustomTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="25sp"
        android:visibility="gone"
        android:textColor="@android:color/white"
        android:padding="10dp"
        android:layout_marginTop="10dp"
        android:layout_centerHorizontal="true"
        android:textAlignment="center"
        android:gravity="center"
        android:id="@+id/textView_header"/>
      <com.jaribio.jaribio.Utilities.CustomTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView_header"
        android:padding="10dp"
        android:visibility="gone"
        android:layout_margin="8dp"
        android:textColor="@android:color/white"
        android:textAlignment="center"
        android:gravity="center"
        android:textSize="16sp"
        android:id="@+id/textView_sub_header"/>
    </RelativeLayout>
    <android.support.v7.widget.RecyclerView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/white"
      app:layout_behavior="@string/bottom_sheet_behavior"
      android:id="@+id/home_recyclerview_bottom_sheet"
      app:behavior_peekHeight = "312dp"
      android:clipToPadding="false"
      android:paddingBottom="10dp"
      xmlns:app="http://schemas.android.com/apk/res-auto"/>
  </android.support.design.widget.CoordinatorLayout>

Is there a work around this?

spongyboss
  • 8,016
  • 15
  • 48
  • 65

0 Answers0