diff options
Diffstat (limited to 'library/src/main/kotlin/ca/allanwang/kau/animators/SlideUpExitRightAnimator.kt')
-rw-r--r-- | library/src/main/kotlin/ca/allanwang/kau/animators/SlideUpExitRightAnimator.kt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/library/src/main/kotlin/ca/allanwang/kau/animators/SlideUpExitRightAnimator.kt b/library/src/main/kotlin/ca/allanwang/kau/animators/SlideUpExitRightAnimator.kt new file mode 100644 index 0000000..8670493 --- /dev/null +++ b/library/src/main/kotlin/ca/allanwang/kau/animators/SlideUpExitRightAnimator.kt @@ -0,0 +1,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()) + } + } +}
\ No newline at end of file |