speed up showing and hiding animations at the main screen

This commit is contained in:
tibbi 2022-09-18 11:32:19 +02:00
parent 3a64c8ede4
commit 9a46ceec58
2 changed files with 4 additions and 1 deletions

View File

@ -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()
}

View File

@ -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(