Category : bottom-sheet

I am trying to include my bottom_sheet.xml file into my activity activity_main.xml file. I am trying to achieve this by using <include layout="@layout/bottom_sheet"/> However, the bottom sheet isn’t showing in my activity_main.xml file. Code of activity_main.xml file: <?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" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/Theme.FaceDetector.AppBarOverlay"> <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" ..

Read more

I am using leakcanary and it detects leaks in standard bottom sheet behaviour. But I can’t fix this issue, How can I fix that leak? Ref my leak canary report. standardBottomSheetBehaviour ┬─── │ GC Root: System class │ ├─ leakcanary.internal.InternalLeakCanary class │ Leaking: NO (MainActivity↓ is not leaking and a class is never leaking) │ ..

Read more

I tried below mentioned code to set peekheight for the bottom sheet, but I need to set the content height to the bottom sheet not parent height or fixed height. View view = getView(); view.post(() -> { View parent = (View) view.getParent(); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) (parent).getLayoutParams(); CoordinatorLayout.Behavior behavior = params.getBehavior(); bottomSheetBehavior = (BottomSheetBehavior) behavior; ..

Read more