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 popupAnimator: Animator? = null

View file

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

View file

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