Skip to content

Instantly share code, notes, and snippets.

@Shivamdhuria
Created May 2, 2020 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shivamdhuria/e09a579987c66c6f67610f472f4983f9 to your computer and use it in GitHub Desktop.
Save Shivamdhuria/e09a579987c66c6f67610f472f4983f9 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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">
//This view helps to put everything else outside focus
<View
android:id="@+id/scrim_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:background="?attr/scrimBackground"
android:visibility="gone" />
<FrameLayout
android:id="@+id/background_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:behavior_halfExpandedRatio="0.6"
app:behavior_hideable="true"
app:behavior_skipCollapsed="true"
//This is important.
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/nav_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:orientation="vertical"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager" />
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment