Details
Details
- Reviewers
tfella - Commits
- R289:c14be41192d2: Display rich text notification messages on Android
Diff Detail
Diff Detail
- Repository
- R289 KNotifications
- Branch
- rich-text
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 26726 Build 26744: arc lint + arc unit
Comment Actions
I don't see a reason why rich text should be limited to API24+? Yes, the fromHtml(String source, int flags) method is API 24+ but for APIs lower than that you can use fromHtml(String source) as for example wrapped in androidx.core.text.HtmlCompat:
/** * Invokes {@link Html#fromHtml(String, int)} on API 24 and newer, otherwise {@code flags} are * ignored and {@link Html#fromHtml(String)} is used. */ @NonNull public static Spanned fromHtml(@NonNull String source, @FromHtmlFlags int flags) { if (Build.VERSION.SDK_INT >= 24) { return Html.fromHtml(source, flags); } //noinspection deprecation return Html.fromHtml(source); }