mozilla-mobile / focus-android

⚠️ Firefox Focus (Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
2.11k stars 711 forks source link

Adjust size of "Open with..." bottom sheet on tablets #248

Closed pocmo closed 7 years ago

pocmo commented 7 years ago

Our "open with" screen:

open_with

Compare with native "Share" screen:

share

And while we are fixing that... the initial height of the bottom sheet is weird on tablets. It's only showing one option and therefore looks like that's all there is:

initial

antlam commented 7 years ago

+1, let's match that Share sheet

ahunt commented 7 years ago

device-2017-03-22-125618

ahunt commented 7 years ago

The fix I landed makes the dialog much taller. It looks like it's using a 16:9 keyline relative to the width of the dialog (as opposed to 16:9 keyline relative to the whole screen, which is what the system one does). I'll see if I can fix that too.

ahunt commented 7 years ago

Ignore my previous comment: the reason the dialog was previously showing only 1 line was because it was using a 16:9 keyline relative to the entire screen.

The system version uses 50% of the screen height, which isn't explicitly mentioned in the spec - but that's what the example tablet screens show: https://material.io/guidelines/components/bottom-sheets.html#bottom-sheets-modal-bottom-sheets

ahunt commented 7 years ago

I've updated the heights to match what Android does on my N9 (approx 320dp height, although it reduces the height slightly below that in landscape - which is odd): open2portrait open2landscape

ahunt commented 7 years ago

I'm slightly concerned that the system share dialog size might vary on other devices (I've only tested with an N9 so far). Another potential issue is that we enable this for sw600dp and larger, I don't know what criteria Android uses to decide the BottomSheet size.

(It seems that the system share dialog uses a completely separate implementation to the support library, since I haven't found any code explaining even the height that they use on tablets, or even code that makes the dialog narrower on tablets. I haven't found the system implementation yet.)