Skip to content

Commit 8c48a0a

Browse files
authored
fix: set expanded state by default in BaseBottomSheetFragment (AndroidIDEOfficial#1903)
1 parent b093f74 commit 8c48a0a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/app/src/main/java/com/itsaky/androidide/fragments/sheets/BaseBottomSheetFragment.java

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import android.app.Dialog;
2121
import android.os.Bundle;
2222
import androidx.annotation.NonNull;
23+
import com.google.android.material.bottomsheet.BottomSheetBehavior;
24+
import com.google.android.material.bottomsheet.BottomSheetDialog;
2325
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
2426

2527
public abstract class BaseBottomSheetFragment extends BottomSheetDialogFragment {
@@ -30,6 +32,10 @@ public abstract class BaseBottomSheetFragment extends BottomSheetDialogFragment
3032
@Override
3133
public Dialog onCreateDialog(Bundle savedInstanceState) {
3234
mDialog = super.onCreateDialog(savedInstanceState);
35+
36+
var behavior = ((BottomSheetDialog) mDialog).getBehavior();
37+
behavior.setPeekHeight(BottomSheetBehavior.PEEK_HEIGHT_AUTO);
38+
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
3339
return mDialog;
3440
}
3541

0 commit comments

Comments
 (0)