Browse Source

tweak: add in a close button for the bottom draw

feature/pgh-1-results-display-history
Quildra 5 months ago
parent
commit
79489fa4c5
  1. 12
      app/src/main/java/com/quillstudios/pokegoalshelper/ui/ResultsBottomDrawer.kt

12
app/src/main/java/com/quillstudios/pokegoalshelper/ui/ResultsBottomDrawer.kt

@ -767,9 +767,11 @@ class ResultsBottomDrawer(private val context: Context)
{ {
val deltaY = event.rawY - initialTouchY val deltaY = event.rawY - initialTouchY
if (deltaY > SWIPE_THRESHOLD && isExpanded) if (deltaY > SWIPE_THRESHOLD)
{ {
// Only collapse to minimal state if expanded, never fully dismiss if (isExpanded)
{
// Collapse to minimal state if expanded
collapseDrawer() collapseDrawer()
ObjectAnimator.ofFloat(view, "translationY", view.translationY, initialTranslationY).apply { ObjectAnimator.ofFloat(view, "translationY", view.translationY, initialTranslationY).apply {
duration = 200L duration = 200L
@ -777,6 +779,12 @@ class ResultsBottomDrawer(private val context: Context)
start() start()
} }
} }
else
{
// Fully dismiss if collapsed and swiped down far enough
hide()
}
}
else if (deltaY < EXPAND_THRESHOLD && !isExpanded) else if (deltaY < EXPAND_THRESHOLD && !isExpanded)
{ {
// Expand if swiped up enough // Expand if swiped up enough

Loading…
Cancel
Save