Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: set expanded state by default in BaseBottomSheetFragment (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
teixeira0x authored Sep 10, 2024
1 parent b093f74 commit 8c48a0a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import android.app.Dialog;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;

public abstract class BaseBottomSheetFragment extends BottomSheetDialogFragment {
Expand All @@ -30,6 +32,10 @@ public abstract class BaseBottomSheetFragment extends BottomSheetDialogFragment
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
mDialog = super.onCreateDialog(savedInstanceState);

var behavior = ((BottomSheetDialog) mDialog).getBehavior();
behavior.setPeekHeight(BottomSheetBehavior.PEEK_HEIGHT_AUTO);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
return mDialog;
}

Expand Down

0 comments on commit 8c48a0a

Please sign in to comment.