Skip to content

Commit

Permalink
tweak on bottomSheetBehaviorCallback to make sheet dismissed instead …
Browse files Browse the repository at this point in the history
…of getting stuck halfway when swiping down
  • Loading branch information
mzorz committed Sep 2, 2019
1 parent f408f61 commit 0830629
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ class EmojiPickerFragment : BottomSheetDialogFragment() {
dismiss()
}
}
override fun onSlide(bottomSheet: View, slideOffset: Float) {}
override fun onSlide(bottomSheet: View, slideOffset: Float) {
// Tweak to make swipe down fully dismiss the view because of this issue:
// Swiping down on the sheet, the stickers get stuck half way
// down and then you have to swipe again to fully dismiss the view.
if (slideOffset < 0.5f) {
dismiss()
}
}
}

interface EmojiListener {
Expand Down

0 comments on commit 0830629

Please sign in to comment.