From e1eff7b74472317c2f4bc2be9bf360f3022f7b87 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 29 Feb 2020 13:23:42 -0500 Subject: [PATCH] Remove FAB animation files left over from bad cherry picking --- .../tachiyomi/widget/FABAnimationBase.kt | 34 ------------- .../tachiyomi/widget/FABAnimationUpDown.kt | 51 ------------------- 2 files changed, 85 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt deleted file mode 100644 index eaa4201e1b..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationBase.kt +++ /dev/null @@ -1,34 +0,0 @@ -package eu.kanade.tachiyomi.widget - -import android.support.design.widget.CoordinatorLayout -import android.support.design.widget.FloatingActionButton -import android.support.v4.view.ViewCompat -import android.view.View - -abstract class FABAnimationBase : FloatingActionButton.Behavior() { - - var isAnimatingOut = false - - override fun onStartNestedScroll(coordinatorLayout: CoordinatorLayout, child: FloatingActionButton, - directTargetChild: View, target: View, axes: Int, type: Int): Boolean { - // Ensure we react to vertical scrolling - return axes == ViewCompat.SCROLL_AXIS_VERTICAL || - super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type) - } - - override fun onNestedScroll(coordinatorLayout: CoordinatorLayout, child: FloatingActionButton, - target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, - dyUnconsumed: Int, type: Int) { - super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type) - if (dyConsumed > 0 && !isAnimatingOut && child.visibility == View.VISIBLE) { - // User scrolled down and the FAB is currently visible -> hide the FAB - animateOut(child) - } else if (dyConsumed < 0 && child.visibility != View.VISIBLE) { - // User scrolled up and the FAB is currently not visible -> show the FAB - animateIn(child) - } - } - - abstract fun animateOut(button: FloatingActionButton) - abstract fun animateIn(button: FloatingActionButton) -} \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt deleted file mode 100644 index e1c4245d27..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/FABAnimationUpDown.kt +++ /dev/null @@ -1,51 +0,0 @@ -package eu.kanade.tachiyomi.widget - -import android.content.Context -import android.support.design.widget.FloatingActionButton -import android.support.v4.view.animation.FastOutSlowInInterpolator -import android.util.AttributeSet -import android.view.View -import android.view.animation.Animation -import android.view.animation.AnimationUtils -import eu.kanade.tachiyomi.R - -@Suppress("unused", "UNUSED_PARAMETER") -class FABAnimationUpDown @JvmOverloads constructor(ctx: Context, attrs: AttributeSet? = null) : FABAnimationBase() { - - private val INTERPOLATOR = FastOutSlowInInterpolator() - - private val outAnimation by lazy { - AnimationUtils.loadAnimation(ctx, R.anim.fab_hide_to_bottom).apply { - duration = 200 - interpolator = INTERPOLATOR - } - } - private val inAnimation by lazy { - AnimationUtils.loadAnimation(ctx, R.anim.fab_show_from_bottom).apply { - duration = 200 - interpolator = INTERPOLATOR - } - } - - override fun animateOut(button: FloatingActionButton) { - outAnimation.setAnimationListener(object : Animation.AnimationListener { - override fun onAnimationStart(animation: Animation) { - isAnimatingOut = true - } - - override fun onAnimationEnd(animation: Animation) { - isAnimatingOut = false - button.visibility = View.INVISIBLE - } - - override fun onAnimationRepeat(animation: Animation) { - } - }) - button.startAnimation(outAnimation) - } - - override fun animateIn(button: FloatingActionButton) { - button.visibility = View.VISIBLE - button.startAnimation(inAnimation) - } -} \ No newline at end of file