Reputation: 894
I have created BottomSheetDialogFragment
and access into my fragment but it not open fully, it shows only small bar in bottom like below
I am using default BottomSheetDialogFragment
file without changing anything.
xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="@dimen/list_item_spacing_half"
android:paddingBottom="@dimen/list_item_spacing_half"
tools:context=".ui.SettingFragment"
tools:listitem="@layout/fragment_setting_list_dialog_item" />
Show call function
val addBottomDialogFragment: SettingFragment = SettingFragment.newInstance(10)
addBottomDialogFragment.show(supportFragmentManager, "tag")
Upvotes: 2
Views: 1269
Reputation: 169
Height of BottomSheet depend on child content height So first you should add some child view or content under bottom sheet view. If you using RecyclerView then set adapter with data.
Upvotes: 2
Reputation: 1282
Because your BottomSheet don't have content, You have to add content to it
Upvotes: 1