Fixes #1430 - Implements UX feedback for the FenixSnackbar
parent
49b4eaf182
commit
4fae36f0af
|
@ -110,25 +110,26 @@ private class FenixSnackbarCallback(
|
||||||
) : com.google.android.material.snackbar.ContentViewCallback {
|
) : com.google.android.material.snackbar.ContentViewCallback {
|
||||||
|
|
||||||
override fun animateContentIn(delay: Int, duration: Int) {
|
override fun animateContentIn(delay: Int, duration: Int) {
|
||||||
content.scaleY = minScaleY
|
content.translationY = (content.height).toFloat()
|
||||||
content.animate().apply {
|
content.animate().apply {
|
||||||
scaleY(maxScaleY)
|
translationY(defaultYTranslation)
|
||||||
setDuration(duration.toLong())
|
setDuration(animateInDuration)
|
||||||
startDelay = delay.toLong()
|
startDelay = delay.toLong()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun animateContentOut(delay: Int, duration: Int) {
|
override fun animateContentOut(delay: Int, duration: Int) {
|
||||||
content.scaleY = maxScaleY
|
content.translationY = defaultYTranslation
|
||||||
content.animate().apply {
|
content.animate().apply {
|
||||||
scaleY(minScaleY)
|
translationY((content.height).toFloat())
|
||||||
setDuration(duration.toLong())
|
setDuration(animateOutDuration)
|
||||||
startDelay = delay.toLong()
|
startDelay = delay.toLong()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val minScaleY = 0f
|
private const val defaultYTranslation = 0f
|
||||||
private const val maxScaleY = 1f
|
private const val animateInDuration = 200L
|
||||||
|
private const val animateOutDuration = 150L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue