Experiment: mark clicked links

This commit is contained in:
M66B
2020-11-10 19:37:39 +01:00
parent 986540b770
commit ab224f1103
2 changed files with 9 additions and 2 deletions

View File

@@ -4114,8 +4114,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (url.equals(title))
title = null;
if (onOpenLink(uri, title))
if (onOpenLink(uri, title)) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(widget.getContext());
boolean experiments = prefs.getBoolean("experiments", false);
if (experiments) {
int colorPrimary = Helper.resolveColor(widget.getContext(), android.R.attr.textColorPrimary);
buffer.setSpan(new ForegroundColorSpan(colorPrimary), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return true;
}
}
ImageSpan[] image = buffer.getSpans(off, off, ImageSpan.class);