PatilShreyas/MaterialDialog-Android

Generic Message support: Support for separate plain text and Spanned text

Closed this issue · 3 comments

IMO using the html markup <br> is an hotfix, because if you want the MaterialDialog to be easy to use for users switching from classic AlertDialog, you can't ask them to change all of their translations, and use another language (even if HTML is pretty simple) to make it work.

Maybe keep the way things were before and add an dialog.enableHtml(boolean) ?

Originally posted by @Awsom3D in #44 (comment)

Actually, support for HTML is not only to show links. Developers can customise message styling as they want. But whatever you mentioned above makes sense. So I think, instead of directly getting input from Builder, we can have another builder method specific for spanned text like .setMessage(Spanned spannedText) which will be more generic and specific for HTML formatting.

#44 (comment)

@Awsom3D this is also fixed. Now it's more generic and control is in the hand of the developer and now, the library is not formatting text internally.

Example:

.setMessage("Lorem Ipsum") // This will set plain text message
.setMessage(Html.fromHtml("<b>Lorem Ipsum</b>")) // This will set spanned text message

Thank you for having a discussion on this and helping this library to make it better!

@PatilShreyas many thanks ! I'm glad I could help.