diff --git a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java index d25383f6a0..3ee141e8ac 100644 --- a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java +++ b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java @@ -15,7 +15,6 @@ import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; -import android.os.Handler; import android.text.Spannable; import android.text.Spanned; import android.text.TextUtils; @@ -587,7 +586,7 @@ private void showAndFlash(final File file) { _recyclerView.postDelayed(() -> { final RecyclerView.ViewHolder holder = _recyclerView.findViewHolderForLayoutPosition(pos); if (holder != null) { - GsContextUtils.flashView(holder.itemView); + GsContextUtils.blinkView(holder.itemView); } }, 250); } diff --git a/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java b/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java index b272b25f47..9fa9970806 100644 --- a/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java +++ b/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java @@ -2878,10 +2878,10 @@ public boolean isDarkModeEnabled(final Context context) { return false; } - public static void flashView(final View view) { + public static void blinkView(final View view) { if (view != null) { - view.setBackgroundColor(Color.LTGRAY); // Highlight - view.postDelayed(() -> view.setBackgroundColor(Color.TRANSPARENT), 300); + final float init = view.getAlpha(); + ObjectAnimator.ofFloat(view, View.ALPHA, init, 0.1f, 1.0f, 0.1f, 1.0f, init).setDuration(1000).start(); } } }