2

How can I show a BottomSheet from the top instead of the bottom?

    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
        }
    });

    mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheetLayout);
John Sardinha
  • 3,566
  • 6
  • 25
  • 55
  • You have to write your own BottomSheetBehaviour. Look into the implementation from support library and modify it according to your needs. – R. Zagórski Jul 05 '16 at 07:11
  • Use custom bottom sheet. Check this - 1) http://stackoverflow.com/questions/26721403/android-how-to-implement-bottom-sheet-from-material-design-docs 2) http://android-developers.blogspot.in/2016/02/android-support-library-232.html – Onkar Nene Jul 05 '16 at 07:14

1 Answers1

0

I think you may want a 'top' version of BottomSheetBehavior.

Use this

Above code is forked from the original repository, but I fixed some library dependencies (old android.support library -> androidx library) for latest version of Android.

gprathour
  • 14,813
  • 5
  • 66
  • 90
Han Park
  • 487
  • 4
  • 7