Add learn more link to export account data.

This commit is contained in:
Clark
2023-03-30 16:28:30 -04:00
committed by Alex Hart
parent f249a6edd5
commit 666020c3dc
4 changed files with 78 additions and 5 deletions

View File

@@ -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