Skip to content

Commit

Permalink
Reverting to old blink logic - looks much better
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Apr 14, 2024
1 parent b4652e6 commit fe20625
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

0 comments on commit fe20625

Please sign in to comment.