ui: fix multitoolbar clicks

This commit is contained in:
Alexander Capehart
2026-03-29 19:49:51 -06:00
parent 868f024062
commit 1e94786074
2 changed files with 8 additions and 2 deletions
@@ -139,9 +139,13 @@ class Effect private constructor(@AttrRes val attr: Int, @StyleRes val defaultSt
spring = springForce spring = springForce
setStartValue(from) setStartValue(from)
setMinimumVisibleChange(1f / 255f) setMinimumVisibleChange(1f / 255f)
addUpdateListener { _, value, _ -> view.alpha = value } addUpdateListener { _, value, _ ->
view.alpha = value
view.isInvisible = view.alpha == 0f
}
addEndListener { _, canceled, value, _ -> addEndListener { _, canceled, value, _ ->
view.scale = if (!canceled || jumpOnCancellation) to else value view.alpha = if (!canceled || jumpOnCancellation) to else value
view.isInvisible = view.alpha == 0f
} }
animateToFinalPosition(to) animateToFinalPosition(to)
} }
@@ -24,6 +24,7 @@ import android.widget.FrameLayout
import androidx.annotation.AttrRes import androidx.annotation.AttrRes
import androidx.annotation.IdRes import androidx.annotation.IdRes
import androidx.core.view.children import androidx.core.view.children
import androidx.core.view.isInvisible
import androidx.dynamicanimation.animation.SpringAnimation import androidx.dynamicanimation.animation.SpringAnimation
import org.oxycblt.auxio.util.scale import org.oxycblt.auxio.util.scale
import timber.log.Timber as L import timber.log.Timber as L
@@ -46,6 +47,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
getChildAt(i).apply { getChildAt(i).apply {
scale = 0.9f scale = 0.9f
alpha = 0f alpha = 0f
isInvisible = true
} }
} }
} }