From e2835e3e95410499b712d89cb874a16157656124 Mon Sep 17 00:00:00 2001 From: Zakhar Timoshenko Date: Sat, 1 Jul 2023 23:45:03 +0300 Subject: [PATCH] Use `FastOutSlowInInterpolator` for segmented bar --- .../koitharu/kotatsu/core/ui/widgets/SegmentedBarView.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/widgets/SegmentedBarView.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/widgets/SegmentedBarView.kt index 12920d740..6550dadf5 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/widgets/SegmentedBarView.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/ui/widgets/SegmentedBarView.kt @@ -9,15 +9,13 @@ import android.graphics.Paint import android.util.AttributeSet import android.view.View import android.view.ViewOutlineProvider -import android.view.animation.DecelerateInterpolator import androidx.annotation.ColorInt import androidx.annotation.FloatRange +import androidx.interpolator.view.animation.FastOutSlowInInterpolator import org.koitharu.kotatsu.core.util.ext.getAnimationDuration -import org.koitharu.kotatsu.core.util.ext.getThemeColor import org.koitharu.kotatsu.core.util.ext.isAnimationsEnabled import org.koitharu.kotatsu.core.util.ext.resolveDp import org.koitharu.kotatsu.parsers.util.replaceWith -import com.google.android.material.R as materialR class SegmentedBarView @JvmOverloads constructor( context: Context, @@ -97,7 +95,7 @@ class SegmentedBarView @JvmOverloads constructor( invalidate() val animator = ValueAnimator.ofFloat(0f, 1f) animator.duration = context.getAnimationDuration(android.R.integer.config_longAnimTime) - animator.interpolator = DecelerateInterpolator() + animator.interpolator = FastOutSlowInInterpolator() animator.addUpdateListener(this@SegmentedBarView) animator.addListener(this@SegmentedBarView) scaleAnimator = animator