Search in sources :

Example 1 with CustomURLSpan

use of com.keylesspalace.tusky.util.CustomURLSpan in project Tusky by tuskyapp.

the class StatusDetailedViewHolder method setApplication.

private void setApplication(@Nullable Status.Application app) {
    if (app != null) {
        timestampInfo.append("  •  ");
        if (app.getWebsite() != null) {
            URLSpan span = new CustomURLSpan(app.getWebsite());
            SpannableStringBuilder text = new SpannableStringBuilder(app.getName());
            text.setSpan(span, 0, app.getName().length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
            timestampInfo.append(text);
            timestampInfo.setMovementMethod(LinkMovementMethod.getInstance());
        } else {
            timestampInfo.append(app.getName());
        }
    }
}
Also used : CustomURLSpan(com.keylesspalace.tusky.util.CustomURLSpan) CustomURLSpan(com.keylesspalace.tusky.util.CustomURLSpan) URLSpan(android.text.style.URLSpan) SpannableStringBuilder(android.text.SpannableStringBuilder)

Aggregations

SpannableStringBuilder (android.text.SpannableStringBuilder)1 URLSpan (android.text.style.URLSpan)1 CustomURLSpan (com.keylesspalace.tusky.util.CustomURLSpan)1