Improve links in profiles
This commit is contained in:
parent
b674c0c179
commit
9c354f17f8
|
@ -747,22 +747,22 @@ public class Account implements Parcelable {
|
||||||
int endPosition = startPosition + targetedAccount.length();
|
int endPosition = startPosition + targetedAccount.length();
|
||||||
if( endPosition <= fieldSpan.toString().length() && endPosition >= startPosition)
|
if( endPosition <= fieldSpan.toString().length() && endPosition >= startPosition)
|
||||||
fieldSpan.setSpan(new ClickableSpan() {
|
fieldSpan.setSpan(new ClickableSpan() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(@NonNull View textView) {
|
public void onClick(@NonNull View textView) {
|
||||||
CrossActions.doCrossProfile(context,accountMention);
|
CrossActions.doCrossProfile(context,accountMention);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void updateDrawState(@NonNull TextPaint ds) {
|
public void updateDrawState(@NonNull TextPaint ds) {
|
||||||
super.updateDrawState(ds);
|
super.updateDrawState(ds);
|
||||||
ds.setUnderlineText(false);
|
ds.setUnderlineText(false);
|
||||||
if (theme == THEME_DARK)
|
if (theme == THEME_DARK)
|
||||||
ds.setColor(ContextCompat.getColor(context, R.color.dark_link_toot));
|
ds.setColor(ContextCompat.getColor(context, R.color.dark_link_toot));
|
||||||
else if (theme == THEME_BLACK)
|
else if (theme == THEME_BLACK)
|
||||||
ds.setColor(ContextCompat.getColor(context, R.color.black_link_toot));
|
ds.setColor(ContextCompat.getColor(context, R.color.black_link_toot));
|
||||||
else if (theme == THEME_LIGHT)
|
else if (theme == THEME_LIGHT)
|
||||||
ds.setColor(ContextCompat.getColor(context, R.color.mastodonC4));
|
ds.setColor(ContextCompat.getColor(context, R.color.mastodonC4));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
startPosition, endPosition,
|
startPosition, endPosition,
|
||||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue