Just use an alpha animation until we can perfect scale to avoid such a big UI change

This commit is contained in:
Luna712 2024-07-13 17:15:23 -06:00 committed by GitHub
parent bb8f1c610e
commit 5f00ed899e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,5 @@
package com.lagradost.cloudstream3.ui.download package com.lagradost.cloudstream3.ui.download
import android.animation.AnimatorSet
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.text.format.Formatter.formatShortFileSize import android.text.format.Formatter.formatShortFileSize
import android.view.LayoutInflater import android.view.LayoutInflater
@ -342,11 +341,8 @@ class DownloadAdapter(
} }
fun animateSelection(isSelected: Boolean) { fun animateSelection(isSelected: Boolean) {
val scaleValue = if (isSelected) 0.95f else 1.0f val alphaValue = if (isSelected) 0.5f else 1.0f
val scaleX = ObjectAnimator.ofFloat(itemView, View.SCALE_X, scaleValue) ObjectAnimator.ofFloat(itemView, View.ALPHA, alphaValue).apply {
val scaleY = ObjectAnimator.ofFloat(itemView, View.SCALE_Y, scaleValue)
AnimatorSet().apply {
playTogether(scaleX, scaleY)
duration = 200 duration = 200
start() start()
} }