Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
PatilShreyas opened this issue Apr 25, 2021 · 3 comments · Fixed by #50
Closed

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

PatilShreyas opened this issue Apr 25, 2021 · 3 comments · Fixed by #50

Comments

@PatilShreyas
Copy link
Owner

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)

@PatilShreyas
Copy link
Owner Author

PatilShreyas commented Apr 25, 2021

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)

@PatilShreyas
Copy link
Owner Author

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

@Awsom3D
Copy link

Awsom3D commented May 2, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants