bottomSheetDialogFragment full screen

In your custom BottomSheetDialogFragment you can use something like: @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialogInterface) { BottomSheetDialog bottomSheetDialog = (BottomSheetDialog) dialogInterface; setupFullHeight(bottomSheetDialog); } }); return dialog; } private void setupFullHeight(BottomSheetDialog bottomSheetDialog) { FrameLayout bottomSheet = (FrameLayout) bottomSheetDialog.findViewById(R.id.design_bottom_sheet); BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet); ViewGroup.LayoutParams … Read more

Show entire bottom sheet with EditText above Keyboard

Just reposting @jblejder from this question Keyboard hides BottomSheetDialogFragment since it worked for me, to make it easier for others to find: The most convenient way that I found to change this is by creating style: <style name=”DialogStyle” parent=”Theme.Design.Light.BottomSheetDialog”> <item name=”android:windowIsFloating”>false</item> <item name=”android:statusBarColor”>@android:color/transparent</item> <item name=”android:windowSoftInputMode”>adjustResize</item> </style> And set this in onCreate method of your BottomSheetDialogFragment: … Read more

Disabling User dragging on BottomSheet

It can be now no longer relevant, but I will leave it here: import android.content.Context import android.util.AttributeSet import androidx.coordinatorlayout.widget.CoordinatorLayout import android.view.MotionEvent import android.view.View import com.google.android.material.bottomsheet.BottomSheetBehavior @Suppress(“unused”) class LockableBottomSheetBehavior<V : View> : BottomSheetBehavior<V> { constructor() : super() constructor(context: Context, attrs: AttributeSet) : super(context, attrs) var swipeEnabled = true override fun onInterceptTouchEvent( parent: CoordinatorLayout, child: V, event: … Read more

Round corner for BottomSheetDialogFragment

Create a custom drawable rounded_dialog.xml: <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <solid android:color=”@android:color/white”/> <corners android:topLeftRadius=”16dp” android:topRightRadius=”16dp”/> </shape> Then override bottomSheetDialogTheme on styles.xml using the drawable as background: <style name=”AppTheme” parent=”Theme.AppCompat.Light.NoActionBar”> <item name=”bottomSheetDialogTheme”>@style/AppBottomSheetDialogTheme</item> </style> <style name=”AppBottomSheetDialogTheme” parent=”Theme.Design.Light.BottomSheetDialog”> <item name=”bottomSheetStyle”>@style/AppModalStyle</item> </style> <style name=”AppModalStyle” parent=”Widget.Design.BottomSheet.Modal”> <item name=”android:background”>@drawable/rounded_dialog</item> </style> This will change all the BottomSheetDialogs of your app.