Kennyc1012 / BottomSheetMenu

BottomSheetMenu style dialogs for Android
Apache License 2.0
887 stars 99 forks source link

hide bottom sheet #39

Closed abbasalim closed 7 years ago

abbasalim commented 7 years ago

i .setCancelable(false) and use custom view, how i can hide bottom sheet when click one item of my custom view?

Kennyc1012 commented 7 years ago

When you create the view, you will need to get reference to some view findVIewById(...) and set up a click listener for that view that will close the bottomsheet.

EXAMPLE:

java View view = ...; final BottomSheet bottomSheet= BottomSheet.Builder(this) .setView(view) .setListener(this) .build();

view.findViewById(R.id.button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { bottomSheet.dismiss(); } });

bottomSheet.show();