Open suleymanccelik opened 7 years ago
Did you find a solution for this?
Same problem. I guess this is the culprit:
@Override
public void onBottomSheetItemClick(MenuItem item) {
if (!mClicked) {
if (mBehavior != null) {
mBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
}
if (mClickListener != null) {
mClickListener.onBottomSheetItemClick(item);
}
mClicked = true;
}
}
The mClicked
once true, stays true. It never changes to false.
@rubensousa , @suleymanccelik :
I'm having a similar problem.
When an item is clicked, nothing happens.
It looks like setItemClickListener, it's not working.
mBottomSheetDialog = new BottomSheetBuilder(this)
.setMode(BottomSheetBuilder.MODE_LIST)
.setItemTextColor(Color.parseColor("#000000"))
.setBackgroundColor(Color.parseColor("#ffffff"))
.addItem(0, "Add sub", R.drawable.ic_facebook_box)
.addItem(1, "Change time", R.drawable.ic_facebook_box)
.addItem(2, "Show/Hide title", R.drawable.ic_facebook_box)
.expandOnStart(true)
.setItemClickListener(new BottomSheetItemClickListener() {
@Override
public void onBottomSheetItemClick(MenuItem item) {
Log.v("ok", " click2-" + item.getTitle());
}
}).createDialog();
mBottomSheetDialog.show();
Hi, Thanks for your library.
I am trying to show BottomSheet in a fragment but a problem occurs on onBottomSheetItemClick listener. Problem steps are;
1- User clicks edit button and BottomSheet opens 2- User clicks an item and BottomSheet dismisses 3- User clicks edit button again and BottomSheet opens 4- User clicks an item but BottomSheet doesn't close and onBottomSheetItemClick is not called.
I changed your sample code using a fragment and same problem occurs. BottomSheet dialog dismisses when user clicks outside of the dialog. In my fragment, there is no coordinatorlayout.