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

Full screen dialogs #249

Open
plfiorini opened this issue May 8, 2018 · 0 comments
Open

Full screen dialogs #249

plfiorini opened this issue May 8, 2018 · 0 comments
Milestone

Comments

@plfiorini
Copy link
Member

https://material.io/guidelines/components/dialogs.html#dialogs-full-screen-dialogs

(Details of this issue are copied from papyros/qml-material#287)

In the Google Calendar application on Android, you can get an example of full-screen dialog when you create a new event. On a device with a small screen, the full-screen dialog fills the screen:

917a63c6-5ddf-11e5-984d-fa07feb2c1f5
Nexus 4

But on a device with a larger screen, the dialog does not fill the screen horizontally or vertically (depending on the screen orientation and the screen size):

8301784e-5df7-11e5-8999-3bf55ceb6dcb
Nexus 10 (portrait)

889109d2-5df7-11e5-8512-586f90f865ee
Nexus 10 (landscape)

60e78424-5df7-11e5-80f4-41031215864b
Nexus 7 (portrait)

90232b9e-5df7-11e5-935f-d0cda4227b78
Nexus 7 (landscape)

We can see that several parameters influence how the screen is filled. After several tests, I got the following results:

  • Landscape mode:
    • If parent.width / density < 600 then dialog.width = parent.width else dialog.width = parent.width / 2
    • dialog.height = parent.height
  • Portrait mode:
    • If parent.height / density < min_height then dialog.height = parent.height else dialog.height = parent.height / r1
    • If parent.height / density < min_height then dialog.width = parent.width else dialog.width = parent.width / r2

min_height, r1 and r2 have to be defined more precisely.

In my tests, I found min_height = 1280 but it could be lower since there is a big gap between my test devices (between 640 and 1280).
The ratio r1 seems to be around 1.12 but I don't have a clear idea about it. My tests gave me 1.1186833... (quite a strange value).
For r2, I got a "round" value, 1.25, that seems acceptable.

The specs don't talk about these cases but the full-screen dialogs look much better that way on bigger screens.

@plfiorini plfiorini added this to the Post 1.0 milestone May 8, 2018
@plfiorini plfiorini removed the feature label Oct 13, 2018
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

No branches or pull requests

1 participant