From 9a46ceec58ae04a5b5003e1f2c3703e613295b2d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 18 Sep 2022 11:32:19 +0200 Subject: [PATCH] speed up showing and hiding animations at the main screen --- .../com/simplemobiletools/launcher/activities/MainActivity.kt | 4 ++++ .../com/simplemobiletools/launcher/models/AppLauncher.kt | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt index dbac793..5b7c905 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt @@ -20,6 +20,8 @@ import com.simplemobiletools.launcher.interfaces.FlingListener import kotlinx.android.synthetic.main.activity_main.* class MainActivity : SimpleActivity(), FlingListener { + private val ANIMATION_DURATION = 150L + private var mTouchDownY = -1 private var mCurrentFragmentY = 0 private var mScreenHeight = 0 @@ -115,6 +117,7 @@ class MainActivity : SimpleActivity(), FlingListener { private fun showFragment(fragment: View) { ObjectAnimator.ofFloat(fragment, "y", 0f).apply { + duration = ANIMATION_DURATION interpolator = DecelerateInterpolator() start() } @@ -122,6 +125,7 @@ class MainActivity : SimpleActivity(), FlingListener { private fun hideFragment(fragment: View) { ObjectAnimator.ofFloat(fragment, "y", mScreenHeight.toFloat()).apply { + duration = ANIMATION_DURATION interpolator = DecelerateInterpolator() start() } diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/models/AppLauncher.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/models/AppLauncher.kt index 05ca7fc..0b2a00d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/models/AppLauncher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/models/AppLauncher.kt @@ -5,7 +5,6 @@ import androidx.room.* import com.simplemobiletools.commons.extensions.normalizeString import com.simplemobiletools.commons.helpers.SORT_BY_TITLE import com.simplemobiletools.commons.helpers.SORT_DESCENDING -import java.util.* @Entity(tableName = "apps", indices = [(Index(value = ["package_name"], unique = true))]) data class AppLauncher(