ArcGhh/CommentDialog

bottomSheetDialog点击两次才弹出问题

Opened this issue · 3 comments

bottomSheetDialog如果通过手势下滑关闭的话,再次点击show,第一次无法弹出

手势下拉关闭,不要靠惯性关闭,很容易复现

你好,我自己修复了一下:
public void onStateChanged(@nonnull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
bottomSheetDialog.dismiss();
}else if (newState == BottomSheetBehavior.STATE_SETTLING) {
if (slideOffset <= -0.28) {
//当向下滑动时 值为负数
mDialogBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
}
}
}

你好,我自己修复了一下:
public void onStateChanged(@nonnull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
bottomSheetDialog.dismiss();
}else if (newState == BottomSheetBehavior.STATE_SETTLING) {
if (slideOffset <= -0.28) {
//当向下滑动时 值为负数
mDialogBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
}
}
}