Added bounce left/right

pull/156/head
M66B 5 years ago
parent 61c3c8e77b
commit 71b50a1c6f

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

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

@ -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>
Loading…
Cancel
Save