blob: 8670493cbae2d7feafa31a7a6fbd1a9b91b9de50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package ca.allanwang.kau.animators
import android.support.v7.widget.RecyclerView
import android.view.ViewPropertyAnimator
/**
* Created by Allan Wang on 2017-06-27.
*/
class SlideUpExitRightAnimator(itemDelayFactor: Float = 0.125f) : BaseSlideAlphaAnimator(itemDelayFactor) {
override fun addAnimationPrepare(holder: RecyclerView.ViewHolder) {
with(holder.itemView) {
translationY = height.toFloat()
alpha = 0f
}
}
override fun removeAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator {
return super.removeAnimation(holder).apply {
translationX(holder.itemView.width.toFloat())
}
}
}
|