ArcGhh / CommentDialog

这是一个Android评论框,类似抖音评论弹框
381 stars 50 forks source link

bottomSheetDialog点击两次才弹出问题 #3

Open shixiangyu opened 4 years ago

shixiangyu commented 4 years ago

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

shixiangyu commented 4 years ago

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

shixiangyu commented 4 years ago

你好,我自己修复了一下: 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); } } }

ArcGhh commented 4 years ago

你好,我自己修复了一下: 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); } } }