Added bounce left/right

This commit is contained in:
M66B
2019-05-11 10:24:18 +02:00
parent 61c3c8e77b
commit 71b50a1c6f
3 changed files with 24 additions and 2 deletions

View File

@@ -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);
}
});

View 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>

View 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>