diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java index 7281b614..98b13a04 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java @@ -68,6 +68,7 @@ public class EntryHolder extends RecyclerView.ViewHolder { _buttonRefresh = view.findViewById(R.id.buttonRefresh); _selected = view.findViewById(R.id.ivSelected); _selectedHandler = new Handler(); + _animationHandler = new Handler(); _progressBar = view.findViewById(R.id.progressBar); int primaryColorId = view.getContext().getResources().getColor(R.color.colorPrimary); @@ -106,6 +107,7 @@ public class EntryHolder extends RecyclerView.ViewHolder { _selected.clearAnimation(); _selected.setVisibility(View.GONE); _selectedHandler.removeCallbacksAndMessages(null); + _animationHandler.removeCallbacksAndMessages(null); // only show the progress bar if there is no uniform period and the entry type is TotpInfo setShowProgress(showProgress); @@ -246,9 +248,8 @@ public class EntryHolder extends RecyclerView.ViewHolder { } public void animateCopyText() { - if (_animationHandler != null) { - _animationHandler.removeCallbacksAndMessages(null); - } + _animationHandler.removeCallbacksAndMessages(null); + Animation slideDownFadeIn = AnimationUtils.loadAnimation(itemView.getContext(), R.anim.slide_down_fade_in); Animation slideDownFadeOut = AnimationUtils.loadAnimation(itemView.getContext(), R.anim.slide_down_fade_out); Animation fadeOut = AnimationUtils.loadAnimation(itemView.getContext(), R.anim.fade_out); @@ -257,14 +258,9 @@ public class EntryHolder extends RecyclerView.ViewHolder { _profileCopied.startAnimation(slideDownFadeIn); _description.startAnimation(slideDownFadeOut); - - _animationHandler = new Handler(); - _animationHandler.postDelayed(new Runnable() { - @Override - public void run() { - _profileCopied.startAnimation(fadeOut); - _description.startAnimation(fadeIn); - } + _animationHandler.postDelayed(() -> { + _profileCopied.startAnimation(fadeOut); + _description.startAnimation(fadeIn); }, 3000); }