user6556461 user6556461 - 1 year ago 109
Android Question

Sliding Up Screen Android

enter image description here

Whats the procedure of making this sliding screen. I am little bit confused. Is that Fragment which is sliding up or Activity and whats the after procedure?

Answer Source

This is android BottomSheetDialogFragment which is supported by android support library 23.2.

TO use this support library, add dependency in app's build.gradle

compile ''

You can create your own bottomsheetdialogfragment as follows:

public class TutsPlusBottomSheetDialogFragment extends BottomSheetDialogFragment {

    private BottomSheetBehavior.BottomSheetCallback mBottomSheetBehaviorCallback = new BottomSheetBehavior.BottomSheetCallback() {

        public void onStateChanged(@NonNull View bottomSheet, int newState) {
            if (newState == BottomSheetBehavior.STATE_HIDDEN) {


        public void onSlide(@NonNull View bottomSheet, float slideOffset) {

    public void setupDialog(Dialog dialog, int style) {
        super.setupDialog(dialog, style);
        View contentView = View.inflate(getContext(), R.layout.fragment_bottom_sheet, null);

        CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
        CoordinatorLayout.Behavior behavior = params.getBehavior();

        if( behavior != null && behavior instanceof BottomSheetBehavior ) {
            ((BottomSheetBehavior) behavior).setBottomSheetCallback(mBottomSheetBehaviorCallback);

To show :

BottomSheetDialogFragment bottomSheetDialogFragment = new TutsPlusBottomSheetDialogFragment();, bottomSheetDialogFragment.getTag());

For more details visit

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download