diff options
author | Allan Wang <me@allanwang.ca> | 2019-10-19 22:38:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-19 22:38:45 -0700 |
commit | cd068b144ef533bccafc20b8b25ff72b56a93e23 (patch) | |
tree | f1136e879ef1e92b7f0390c23ea52f34a8e96e1e /adapter | |
parent | 8d42b8ec4049b62424ec3ea9cd80487409e381d9 (diff) | |
parent | 7007e61879bf33c09115b5d8bc16f27af2731045 (diff) | |
download | kau-cd068b144ef533bccafc20b8b25ff72b56a93e23.tar.gz kau-cd068b144ef533bccafc20b8b25ff72b56a93e23.tar.bz2 kau-cd068b144ef533bccafc20b8b25ff72b56a93e23.zip |
Merge pull request #233 from AllanWang/kotlin-math
Convert java math to kotlin math
Diffstat (limited to 'adapter')
-rw-r--r-- | adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt b/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt index b9df946..935c484 100644 --- a/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt +++ b/adapter/src/main/kotlin/ca/allanwang/kau/animators/KauAnimator.kt @@ -19,6 +19,7 @@ import android.view.ViewPropertyAnimator import androidx.recyclerview.widget.RecyclerView import ca.allanwang.kau.utils.KAU_BOTTOM import ca.allanwang.kau.utils.KAU_RIGHT +import kotlin.math.max /** * Created by Allan Wang on 2017-06-27. @@ -30,7 +31,7 @@ open class KauAnimator( ) : BaseItemAnimator() { open fun startDelay(holder: RecyclerView.ViewHolder, duration: Long, factor: Float) = - Math.max(0L, (holder.adapterPosition * duration * factor).toLong()) + max(0L, (holder.adapterPosition * duration * factor).toLong()) override fun removeAnimation(holder: RecyclerView.ViewHolder): ViewPropertyAnimator { return holder.itemView.animate().apply { |