mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Just use an alpha animation until we can perfect scale to avoid such a big UI change
This commit is contained in:
parent
bb8f1c610e
commit
5f00ed899e
1 changed files with 2 additions and 6 deletions
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue