Subtle top bounce effect

This commit is contained in:
M66B 2019-05-11 18:27:00 +02:00
parent 92c83b66b9
commit a4e24cef54
3 changed files with 13 additions and 16 deletions

View File

@ -477,8 +477,8 @@ public class FragmentMessages extends FragmentBase {
int first = llm.findFirstVisibleItemPosition();
View child = rvMessage.getChildAt(pos - (first < 0 ? 0 : first));
if (child != null) {
Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.enter_from_bottom);
child.startAnimation(animation);
Animation bounce = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_top);
child.startAnimation(bounce);
}
rvMessage.scrollToPosition(pos);
@ -633,8 +633,8 @@ public class FragmentMessages extends FragmentBase {
@Override
public boolean onSwipeRight() {
if (previous == null) {
Animation shake = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_right);
view.startAnimation(shake);
Animation bounce = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_right);
view.startAnimation(bounce);
} else
navigate(previous, true);
@ -644,8 +644,8 @@ public class FragmentMessages extends FragmentBase {
@Override
public boolean onSwipeLeft() {
if (next == null) {
Animation shake = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_left);
view.startAnimation(shake);
Animation bounce = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_left);
view.startAnimation(bounce);
} else
navigate(next, false);

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_shortAnimTime"
android:fromYDelta="2%"
android:toYDelta="0%" />
</set>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="@android:integer/config_shortAnimTime"
android:fromXDelta="0%"
android:fromYDelta="100%"
android:toXDelta="0%"
android:toYDelta="0%" />
</set>