Use absolute top bounce

This commit is contained in:
M66B 2019-05-11 20:35:11 +02:00
parent 5e7e546f68
commit 1fb2e775d1
2 changed files with 4 additions and 8 deletions

View File

@ -53,6 +53,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.TranslateAnimation;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
@ -477,7 +478,9 @@ public class FragmentMessages extends FragmentBase {
int first = llm.findFirstVisibleItemPosition();
View child = rvMessage.getChildAt(pos - (first < 0 ? 0 : first));
if (child != null) {
Animation bounce = AnimationUtils.loadAnimation(getContext(), R.anim.bounce_top);
TranslateAnimation bounce = new TranslateAnimation(
0, 0, Helper.dp2pixels(getContext(), 12), 0);
bounce.setDuration(getResources().getInteger(android.R.integer.config_shortAnimTime));
child.startAnimation(bounce);
}

View File

@ -1,7 +0,0 @@
<?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>