Compare commits

...

2 commits

Author SHA1 Message Date
firelight
decc1a4178
Update ActorAdaptor.kt 2026-07-09 15:48:14 +00:00
firelight
ff6a125913
Feat: Animation to actor adapter 2026-07-09 15:09:03 +00:00
2 changed files with 23 additions and 1 deletions

View file

@ -5,6 +5,9 @@ import android.content.Intent
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.OvershootInterpolator
import android.view.animation.ScaleAnimation
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.lagradost.cloudstream3.ActorData import com.lagradost.cloudstream3.ActorData
import com.lagradost.cloudstream3.ActorRole import com.lagradost.cloudstream3.ActorRole
@ -46,6 +49,24 @@ class ActorAdaptor(
} }
} }
override fun onUpdateContent(holder: ViewHolderState<Any>, item: ActorData, position: Int) {
when (val binding = holder.view) {
is CastItemBinding -> {
val anim: Animation = ScaleAnimation(
0.8f, 1f,
0.8f, 1f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f
)
anim.fillAfter = true
anim.duration = 200
anim.interpolator = OvershootInterpolator()
binding.voiceActorImageHolder2.startAnimation(anim)
}
}
super.onUpdateContent(holder, item, position)
}
override fun onBindContent(holder: ViewHolderState<Any>, item: ActorData, position: Int) { override fun onBindContent(holder: ViewHolderState<Any>, item: ActorData, position: Int) {
when (val binding = holder.view) { when (val binding = holder.view) {
is CastItemBinding -> { is CastItemBinding -> {

View file

@ -47,6 +47,7 @@
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/voice_actor_image_holder2"
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="70dp" android:layout_height="70dp"
android:foreground="@drawable/outline_drawable" android:foreground="@drawable/outline_drawable"