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

Loading…
Cancel
Save