From 9fed3bc0a35284c04484672c58fdd8fc2bd0906a Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 9 May 2019 16:42:23 +0200 Subject: [PATCH] Fade in on up navigation --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 7 +++++++ app/src/main/res/anim/fade_in_fast.xml | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 app/src/main/res/anim/fade_in_fast.xml diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index b38910648f..489528456a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -471,6 +471,13 @@ public class FragmentMessages extends FragmentBase { do { Long key = adapter.getKeyAtPosition(pos); if (key != null && isExpanded(key)) { + int first = llm.findFirstVisibleItemPosition(); + View child = rvMessage.getChildAt(pos - (first < 0 ? 0 : first)); + if (child != null) { + Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.fade_in_fast); + child.startAnimation(animation); + } + rvMessage.scrollToPosition(pos); break; } diff --git a/app/src/main/res/anim/fade_in_fast.xml b/app/src/main/res/anim/fade_in_fast.xml new file mode 100644 index 0000000000..bbb2089fe7 --- /dev/null +++ b/app/src/main/res/anim/fade_in_fast.xml @@ -0,0 +1,6 @@ + +