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. 22
      app/src/main/java/com/quillstudios/pokegoalshelper/ui/ResultsBottomDrawer.kt

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

@ -767,14 +767,22 @@ 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)
collapseDrawer() {
ObjectAnimator.ofFloat(view, "translationY", view.translationY, initialTranslationY).apply { // Collapse to minimal state if expanded
duration = 200L collapseDrawer()
interpolator = AccelerateDecelerateInterpolator() ObjectAnimator.ofFloat(view, "translationY", view.translationY, initialTranslationY).apply {
start() duration = 200L
interpolator = AccelerateDecelerateInterpolator()
start()
}
}
else
{
// Fully dismiss if collapsed and swiped down far enough
hide()
} }
} }
else if (deltaY < EXPAND_THRESHOLD && !isExpanded) else if (deltaY < EXPAND_THRESHOLD && !isExpanded)

Loading…
Cancel
Save