mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-01 17:26:12 +00:00
Subtle top bounce effect
This commit is contained in:
parent
92c83b66b9
commit
a4e24cef54
3 changed files with 13 additions and 16 deletions
app/src/main
|
@ -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);
|
||||
|
||||
|
|
7
app/src/main/res/anim/bounce_top.xml
Normal file
7
app/src/main/res/anim/bounce_top.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_shortAnimTime"
|
||||
android:fromYDelta="2%"
|
||||
android:toYDelta="0%" />
|
||||
</set>
|
|
@ -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>
|
Loading…
Reference in a new issue