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.*
|
import kotlinx.android.synthetic.main.activity_main.*
|
||||||
|
|
||||||
class MainActivity : SimpleActivity(), FlingListener {
|
class MainActivity : SimpleActivity(), FlingListener {
|
||||||
|
private val ANIMATION_DURATION = 150L
|
||||||
|
|
||||||
private var mTouchDownY = -1
|
private var mTouchDownY = -1
|
||||||
private var mCurrentFragmentY = 0
|
private var mCurrentFragmentY = 0
|
||||||
private var mScreenHeight = 0
|
private var mScreenHeight = 0
|
||||||
|
@ -115,6 +117,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
||||||
|
|
||||||
private fun showFragment(fragment: View) {
|
private fun showFragment(fragment: View) {
|
||||||
ObjectAnimator.ofFloat(fragment, "y", 0f).apply {
|
ObjectAnimator.ofFloat(fragment, "y", 0f).apply {
|
||||||
|
duration = ANIMATION_DURATION
|
||||||
interpolator = DecelerateInterpolator()
|
interpolator = DecelerateInterpolator()
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
@ -122,6 +125,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
||||||
|
|
||||||
private fun hideFragment(fragment: View) {
|
private fun hideFragment(fragment: View) {
|
||||||
ObjectAnimator.ofFloat(fragment, "y", mScreenHeight.toFloat()).apply {
|
ObjectAnimator.ofFloat(fragment, "y", mScreenHeight.toFloat()).apply {
|
||||||
|
duration = ANIMATION_DURATION
|
||||||
interpolator = DecelerateInterpolator()
|
interpolator = DecelerateInterpolator()
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import androidx.room.*
|
||||||
import com.simplemobiletools.commons.extensions.normalizeString
|
import com.simplemobiletools.commons.extensions.normalizeString
|
||||||
import com.simplemobiletools.commons.helpers.SORT_BY_TITLE
|
import com.simplemobiletools.commons.helpers.SORT_BY_TITLE
|
||||||
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
|
import com.simplemobiletools.commons.helpers.SORT_DESCENDING
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
@Entity(tableName = "apps", indices = [(Index(value = ["package_name"], unique = true))])
|
@Entity(tableName = "apps", indices = [(Index(value = ["package_name"], unique = true))])
|
||||||
data class AppLauncher(
|
data class AppLauncher(
|
||||||
|
|
Loading…
Reference in New Issue