Closed Awsom3D closed 3 years ago
In case anyone need it, here is my hotfix in kotlin, everytime I build a materialDialog.
if (resources.configuration.screenLayout and Configuration.SCREENLAYOUT_SIZE_MASK == Configuration.SCREENLAYOUT_SIZE_SMALL) // If screen is small
materialDialog.animationView.visibility = View.GONE // remove animation part
But it's not a long term solution since users won't be able to scroll if the text gets longer.
Thanks @Awsom3D for reporting this issue. Will fix this issue
@Awsom3D I tested this on the device (emulator) having dimension 3.5" and saw that it's perfectly working fine. Can you give me more details on this?
@Awsom3D Also, a small recording/snapshot of the issue would be useful.
I think the main difference is that I have a few lines of text (about 7), so my modal may be longer than yours.
What you see below is the version I have hotfix'ed, but you can try the same on your device and see that the behavior will be different, and you won't be able to see the button anymore.
Some of my users have very small screens 😅
https://user-images.githubusercontent.com/1741288/115840639-2dd67100-a41c-11eb-8a21-742da16636af.mp4
@Awsom3D Thanks for sharing these references. Now I got the problem.
So you're using this as an informative dialog. I think instead of hiding animation for smaller screens, we should support Scroll-ability for the dialog. I'll take a look at it.
Thanks, @Awsom3D for this issue. This issue has been fixed in the new version 2.2.1
.
Also, @Awsom3D, as I can see you've included the privacy policy link in the message. The good news is that now you can make it clickable 🎉.
With v2.2.1
now you can add HTML spanned text for the message.
Thank you so much @PatilShreyas ; this is awesome 😍
@PatilShreyas Just so you know, since you switched to HTML, the \n are not displayed correctly in the modal text.
I'll just use <br>
for now, but other developers could be confused or see it as a regression.
Ok @Awsom3D. As you mentioned, <br>
is recommended solution I guess.
If we could get an accessor to the Textview message, maybe we could use Linkify
without using HTML.
Linkify.addLinks(textview, Linkify.WEB_URLS)
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)
?
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.
Hi, thanks for your work on this lib, it's super useful !
Unfortunately, some of my users are complaining that they can't click on the dialog button because it's simply out of the window, in portrait or paysage. I found out that they have relatively small screens (720p or less).
On my larger smartphone, the animation is effectively disabled in paysage to make some more room, but on smaller phones it doesn't work either way.
Is there a way to fix this properly in the lib so users can scroll to the dialog button ?
Thanks for your input,