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

[BUG] Button not accessible on small screens #44

Closed
Awsom3D opened this issue Apr 19, 2021 · 14 comments · Fixed by #46 or #48
Closed

[BUG] Button not accessible on small screens #44

Awsom3D opened this issue Apr 19, 2021 · 14 comments · Fixed by #46 or #48
Assignees

Comments

@Awsom3D
Copy link

Awsom3D commented Apr 19, 2021

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,

@Awsom3D
Copy link
Author

Awsom3D commented Apr 19, 2021

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.

@PatilShreyas
Copy link
Owner

Thanks @Awsom3D for reporting this issue. Will fix this issue

@PatilShreyas
Copy link
Owner

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

@PatilShreyas
Copy link
Owner

@Awsom3D Also, a small recording/snapshot of the issue would be useful.

@Awsom3D
Copy link
Author

Awsom3D commented Apr 23, 2021

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 😅

Screenshot_20210423-100254

21-04-23-10-05-07.mp4

@PatilShreyas
Copy link
Owner

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

This was referenced Apr 24, 2021
@PatilShreyas PatilShreyas linked a pull request Apr 24, 2021 that will close this issue
@PatilShreyas
Copy link
Owner

Thanks, @Awsom3D for this issue. This issue has been fixed in the new version 2.2.1.

@PatilShreyas
Copy link
Owner

PatilShreyas commented Apr 24, 2021

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.

@Awsom3D
Copy link
Author

Awsom3D commented Apr 24, 2021

Thank you so much @PatilShreyas ; this is awesome 😍

@Awsom3D
Copy link
Author

Awsom3D commented Apr 24, 2021

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

Screenshot_20210424-181807

@PatilShreyas
Copy link
Owner

PatilShreyas commented Apr 24, 2021

Ok @Awsom3D. As you mentioned, <br> is recommended solution I guess.

@Awsom3D
Copy link
Author

Awsom3D commented Apr 24, 2021

If we could get an accessor to the Textview message, maybe we could use Linkify without using HTML.

Linkify.addLinks(textview, Linkify.WEB_URLS)

@Awsom3D
Copy link
Author

Awsom3D commented Apr 24, 2021

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) ?

@PatilShreyas
Copy link
Owner

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.

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