mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
Added bounce left/right
This commit is contained in:
@@ -629,15 +629,23 @@ public class FragmentMessages extends FragmentBase {
|
||||
final SwipeListener swipeListener = new SwipeListener(getContext(), new SwipeListener.ISwipeListener() {
|
||||
@Override
|
||||
public boolean onSwipeRight() {
|
||||
if (previous != null)
|
||||
if (previous == null) {
|
||||
Animation shake = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_right);
|
||||
view.startAnimation(shake);
|
||||
} else
|
||||
navigate(previous, true);
|
||||
|
||||
return (previous != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSwipeLeft() {
|
||||
if (next != null)
|
||||
if (next == null) {
|
||||
Animation shake = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_left);
|
||||
view.startAnimation(shake);
|
||||
} else
|
||||
navigate(next, false);
|
||||
|
||||
return (next != null);
|
||||
}
|
||||
});
|
||||
|
||||
7
app/src/main/res/anim/bounce_left.xml
Normal file
7
app/src/main/res/anim/bounce_left.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromXDelta="-10%"
|
||||
android:toXDelta="0%" />
|
||||
</set>
|
||||
7
app/src/main/res/anim/bounce_right.xml
Normal file
7
app/src/main/res/anim/bounce_right.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromXDelta="10%"
|
||||
android:toXDelta="0%" />
|
||||
</set>
|
||||
Reference in New Issue
Block a user