From 6be51423c15986bed13a1c32154c13affcada8a8 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 31 Dec 2021 15:57:15 +0100 Subject: [PATCH] Blink continue search button --- .../eu/faircode/email/FragmentMessages.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 81cb4877ef..287fe452d1 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -34,6 +34,8 @@ import static me.everything.android.ui.overscroll.OverScrollBounceEffectDecorato import static me.everything.android.ui.overscroll.OverScrollBounceEffectDecoratorBase.DEFAULT_TOUCH_DRAG_MOVE_RATIO_BCK; import static me.everything.android.ui.overscroll.OverScrollBounceEffectDecoratorBase.DEFAULT_TOUCH_DRAG_MOVE_RATIO_FWD; +import android.animation.ObjectAnimator; +import android.animation.ValueAnimator; import android.app.Activity; import android.app.Dialog; import android.app.NotificationManager; @@ -282,6 +284,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. private TextView tvSelectedCount; private FloatingActionButton fabSearch; private FloatingActionButton fabError; + private ObjectAnimator animator; private String type; private long account; @@ -526,6 +529,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. fabSearch = view.findViewById(R.id.fabSearch); fabError = view.findViewById(R.id.fabError); + animator = Helper.getFabAnimator(fabSearch, this); + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); // Wire controls @@ -1336,12 +1341,20 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. criteria.with_encrypted || criteria.with_attachments || criteria.with_notes || - criteria.with_types != null) + criteria.with_types != null) { fabSearch.hide(); - else + if (animator.isStarted()) + animator.end(); + } else { fabSearch.show(); - } else + if (!animator.isStarted()) + animator.start(); + } + } else { fabSearch.hide(); + if (animator.isStarted()) + animator.end(); + } fabMore.hide(); tvSelectedCount.setVisibility(View.GONE);