mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Add learn more link to export account data.
This commit is contained in:
@@ -24,6 +24,7 @@ import android.text.style.RelativeSizeSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.text.style.TextAppearanceSpan;
|
||||
import android.text.style.TypefaceSpan;
|
||||
import android.text.style.URLSpan;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
@@ -155,6 +156,17 @@ public final class SpanUtil {
|
||||
return clickSubstring(text, text, onLearnMoreClicked, color);
|
||||
}
|
||||
|
||||
public static Spanned urlSubsequence(@NonNull CharSequence fullString, @NonNull CharSequence substring, @NonNull String url) {
|
||||
SpannableString spannable = new SpannableString(fullString);
|
||||
int start = TextUtils.indexOf(fullString, substring);
|
||||
int end = start + substring.length();
|
||||
|
||||
if (start >= 0 && end <= fullString.length()) {
|
||||
spannable.setSpan(new URLSpan(url), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
return spannable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes two resources:
|
||||
* - one resource that has a single string placeholder
|
||||
|
||||
Reference in New Issue
Block a user