Add animations

- right to left swipe
- left to right swipe
- top down swipe
This commit is contained in:
Finn M Glas 2020-06-18 10:17:04 +02:00
parent 0c3a267d62
commit 68cf994c41
No known key found for this signature in database
GPG key ID: 902A30146014DFBF
4 changed files with 33 additions and 3 deletions

View file

@ -145,7 +145,7 @@ class HomeActivity: UIObject, 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)
overridePendingTransition(0, 0)
overridePendingTransition(R.anim.top_down, android.R.anim.fade_out)
}
else if (diffY > height / 8 && abs(diffY) > strictness * abs(diffX)) {
launch(upApp, this)
@ -153,11 +153,11 @@ class HomeActivity: UIObject, AppCompatActivity(),
}
else if (diffX > width / 4 && abs(diffX) > strictness * abs(diffY)) {
launch(leftApp,this)
overridePendingTransition(0, 0)
overridePendingTransition(R.anim.right_left, android.R.anim.fade_out)
}
else if (diffX < -width / 4 && abs(diffX) > strictness * abs(diffY)) {
launch(rightApp, this)
overridePendingTransition(0, 0)
overridePendingTransition(R.anim.left_right, android.R.anim.fade_out)
}
return true