speed up showing and hiding animations at the main screen
This commit is contained in:
parent
3a64c8ede4
commit
9a46ceec58
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue