mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Fix animations
- Until now only the bottom up (swipe action) animation is implemented
This commit is contained in:
parent
2ab8bec8c0
commit
e1a9e4aa33
3 changed files with 9 additions and 9 deletions
|
@ -80,7 +80,10 @@ class MainActivity : AppCompatActivity(),
|
|||
showSettingsIcon()
|
||||
|
||||
// As older APIs somehow do not recognize the xml defined onClick
|
||||
activity_main_settings_icon.setOnClickListener() { openSettings(this) }
|
||||
activity_main_settings_icon.setOnClickListener() {
|
||||
openSettings(this)
|
||||
overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out)
|
||||
}
|
||||
|
||||
// Load apps list first - speed up settings that way
|
||||
AsyncTask.execute { viewAdapter =
|
||||
|
@ -166,7 +169,10 @@ class MainActivity : AppCompatActivity(),
|
|||
|
||||
// Only open if the swipe was not from the phones top edge
|
||||
if (diffY < -height / 8 && abs(diffY) > strictness * abs(diffX) && e1.y > 100) launch(downApp, this)
|
||||
else if (diffY > height / 8 && abs(diffY) > strictness * abs(diffX)) launch(upApp, this)
|
||||
else if (diffY > height / 8 && abs(diffY) > strictness * abs(diffX)) {
|
||||
launch(upApp, this)
|
||||
overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out)
|
||||
}
|
||||
else if (diffX > width / 4 && abs(diffX) > strictness * abs(diffY)) launch(leftApp, this)
|
||||
else if (diffX < -width / 4 && abs(diffX) > strictness * abs(diffY)) launch(rightApp, this)
|
||||
|
||||
|
|
|
@ -153,10 +153,6 @@ fun launchApp(packageName: String, context: Context) {
|
|||
|
||||
if (intent != null) {
|
||||
context.startActivity(intent)
|
||||
|
||||
if (context is Activity) {
|
||||
context.overridePendingTransition(0, 0)
|
||||
}
|
||||
} else {
|
||||
if (isInstalled(packageName, context)){
|
||||
|
||||
|
@ -218,7 +214,6 @@ fun openAppSettings(pkg :String, context:Context){
|
|||
|
||||
fun openSettings(activity: Activity){
|
||||
activity.startActivity(Intent(activity, SettingsActivity::class.java))
|
||||
activity.overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out)
|
||||
}
|
||||
|
||||
fun openAppsList(activity: Activity){
|
||||
|
@ -226,7 +221,6 @@ fun openAppsList(activity: Activity){
|
|||
intent.putExtra("action", "view")
|
||||
intendedSettingsPause = true
|
||||
activity.startActivity(intent)
|
||||
activity.overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out)
|
||||
}
|
||||
|
||||
fun loadSettings(sharedPref : SharedPreferences){
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
android:fromYDelta="75%p"
|
||||
android:toYDelta="0%p"
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:duration="150"/>
|
||||
android:duration="100"/>
|
||||
|
||||
</set>
|
Loading…
Add table
Reference in a new issue