ui: change materialfader anim sepcs

Probably a little more in-line w/the docs.
This commit is contained in:
Alexander Capehart 2024-10-22 21:45:01 -06:00
parent 89110c2798
commit bd685f1f9c
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
3 changed files with 8 additions and 8 deletions

View file

@ -111,7 +111,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
} }
} }
private val fader = MaterialFader.forSmallComponent(context) private val fader = MaterialFader.quickLopsided(context)
private var thumbAnimator: Animator? = null private var thumbAnimator: Animator? = null
private var popupAnimator: Animator? = null private var popupAnimator: Animator? = null

View file

@ -93,7 +93,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
private val selectionBadge: ImageView? private val selectionBadge: ImageView?
private val iconSize: Int? private val iconSize: Int?
private val fader = MaterialFader.forSmallComponent(context) private val fader = MaterialFader.quickLopsided(context)
private var fadeAnimator: Animator? = null private var fadeAnimator: Animator? = null
private val indicatorMatrix = Matrix() private val indicatorMatrix = Matrix()
private val indicatorMatrixSrc = RectF() private val indicatorMatrixSrc = RectF()

View file

@ -163,7 +163,7 @@ private constructor(
} }
companion object { companion object {
fun forSmallComponent(context: Context) = fun quickLopsided(context: Context) =
MaterialFader( MaterialFader(
context, context,
0.6f, 0.6f,
@ -174,21 +174,21 @@ private constructor(
AnimConfig.SHORT1, AnimConfig.SHORT1,
AnimConfig.MEDIUM3) AnimConfig.MEDIUM3)
fun forLargeComponent(context: Context) = fun symmetric(context: Context) =
MaterialFader( MaterialFader(
context, context,
0.9f, 0.9f,
AnimConfig.EMPHASIZED_ACCELERATE, AnimConfig.EMPHASIZED_ACCELERATE,
AnimConfig.SHORT3, AnimConfig.SHORT3,
AnimConfig.MEDIUM1, AnimConfig.MEDIUM1,
AnimConfig.EMPHASIZED, AnimConfig.EMPHASIZED_DECELERATE,
AnimConfig.LONG2, AnimConfig.SHORT3,
AnimConfig.LONG2) AnimConfig.MEDIUM1)
} }
} }
class MaterialFlipper(context: Context) { class MaterialFlipper(context: Context) {
private val fader = MaterialFader.forLargeComponent(context) private val fader = MaterialFader.symmetric(context)
fun jump(from: View) { fun jump(from: View) {
fader.jumpToFadeOut(from) fader.jumpToFadeOut(from)