diff options
Diffstat (limited to 'adapter')
-rw-r--r-- | adapter/build.gradle | 1 | ||||
-rw-r--r-- | adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt | 16 |
2 files changed, 6 insertions, 11 deletions
diff --git a/adapter/build.gradle b/adapter/build.gradle index 772adca..15708dc 100644 --- a/adapter/build.gradle +++ b/adapter/build.gradle @@ -3,7 +3,6 @@ ext.kauSubModuleMinSdk = project.CORE_MIN_SDK apply from: '../android-lib.gradle' dependencies { - compile project(':core') compile "com.mikepenz:fastadapter:${FAST_ADAPTER}@aar" diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt index cc73100..bf38cac 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/FadeScaleAnimator.kt @@ -3,6 +3,7 @@ package ca.allanwang.kau.animators import android.support.v7.widget.RecyclerView import android.view.View import android.view.ViewPropertyAnimator +import ca.allanwang.kau.utils.scaleXY /** * Created by Allan Wang on 2017-07-11. @@ -10,20 +11,17 @@ import android.view.ViewPropertyAnimator class FadeScaleAnimatorAdd(val scaleFactor: Float = 1.0f, override var itemDelayFactor: Float = 0.125f) : KauAnimatorAdd { override fun animationPrepare(holder: RecyclerView.ViewHolder): View.() -> Unit = { - scaleX = scaleFactor - scaleY = scaleFactor + scaleXY = scaleFactor alpha = 0f } override fun animation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit = { - scaleX(1f) - scaleY(1f) + scaleXY(1f) alpha(1f) } override fun animationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit = { - scaleX = 1f - scaleY = 1f + scaleXY = 1f alpha = 1f } @@ -34,14 +32,12 @@ class FadeScaleAnimatorAdd(val scaleFactor: Float = 1.0f, override var itemDelay class FadeScaleAnimatorRemove(val scaleFactor: Float = 1.0f, override var itemDelayFactor: Float = 0.125f) : KauAnimatorRemove { override fun animation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator.() -> Unit = { - scaleX(scaleFactor) - scaleY(scaleFactor) + scaleXY(scaleFactor) alpha(0f) } override fun animationCleanup(holder: RecyclerView.ViewHolder): View.() -> Unit = { - scaleX = 1f - scaleY = 1f + scaleXY = 1f alpha = 1f } |