mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-05 01:47:24 +00:00
Improved horizontal swiping
This commit is contained in:
parent
db49cdf7c4
commit
75d90e3b1c
1 changed files with 4 additions and 2 deletions
|
|
@ -1039,8 +1039,9 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
|||
}
|
||||
|
||||
// Swipe left
|
||||
else if (deltaX < -swipeThreshold && abs(velocityX) > swipeVelocityThreshold && sharedPreferenceManager.isGestureEnabled("left")){
|
||||
else if (deltaX < 0 && abs(deltaX) > swipeThreshold && abs(velocityX) > swipeVelocityThreshold && sharedPreferenceManager.isGestureEnabled("left")){
|
||||
if (leftSwipeActivity.first != null && leftSwipeActivity.second != null) {
|
||||
canLaunchShortcut = false
|
||||
launcherApps.startMainActivity(leftSwipeActivity.first!!.componentName, launcherApps.profiles[leftSwipeActivity.second!!], null, null)
|
||||
} else {
|
||||
Toast.makeText(this@MainActivity, "Cannot launch app", Toast.LENGTH_SHORT).show()
|
||||
|
|
@ -1049,8 +1050,9 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
|||
|
||||
|
||||
// Swipe right
|
||||
else if (deltaX > -swipeThreshold && abs(velocityX) > swipeVelocityThreshold && sharedPreferenceManager.isGestureEnabled("right")) {
|
||||
else if (deltaX > 0 && abs(deltaX) > swipeThreshold && abs(velocityX) > swipeVelocityThreshold && sharedPreferenceManager.isGestureEnabled("right")) {
|
||||
if (rightSwipeActivity.first != null && rightSwipeActivity.second != null) {
|
||||
canLaunchShortcut = false
|
||||
launcherApps.startMainActivity(rightSwipeActivity.first!!.componentName, launcherApps.profiles[rightSwipeActivity.second!!], null, null)
|
||||
} else {
|
||||
Toast.makeText(this@MainActivity, "Cannot launch app", Toast.LENGTH_SHORT).show()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue