D29357: Display rich text notification messages on Android (API level 24+)
Luca Weiss
noreply at phabricator.kde.org
Mon May 11 09:49:51 BST 2020
z3ntu added a comment.
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);
}
REPOSITORY
R289 KNotifications
BRANCH
pending
REVISION DETAIL
https://phabricator.kde.org/D29357
To: vkrause, tfella
Cc: z3ntu, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200511/69f94e96/attachment.htm>
More information about the Kde-frameworks-devel
mailing list