Closed Bug 1202737 Opened 9 years ago Closed 4 years ago

Rework tab tray preview dimensions

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mhaigh, Unassigned)

References

Details

The current tabs tray implementation doesn't quite get the preview image dimensions correct.  This bug is to track tweaking the dimens files
So I've taken the approach of splitting everything up in to buckets targeting the smallest width dimension of a given device, this approach is good for all devices on android 14 and over (4.0) - for GB devices we'll have to hard-code the values in the default dimens file.

Personally I don't own a device which is on Android 4+ which is under sw320dp, but just in case I've opted to support as low as 240.  These are the proposed buckets: sw240dp, sw280dp, sw320dp, sw360dp, sw400dp  

Tablet isn't as size restricted so these calculations will only concentrate on mobile.  For each bucket I assume we will want two columns in portrait mode.  For each bucket I work out the required tab preview width by subtracting from the smallest width the edge padding, desired middle column separation and two lots of two highlight border widths.

  (screen dimension - (2 * side padding) - desired middle column separation) / number of columns - (2 * highlight border width)

For example, for a sw320dp device with side and centre paddings of 15dp, the calculation looks like this:

  (320 - (2 * 15) - 15) / 2 - (2 * 4) = 129

and we're using an aspect ratio of 0.74 so the width is 129dp and the height is 129*0.74 = 96dp

This seems to work well on all the devices I've tried it on so far.

To maximize the thumbnail size, I've adjusted the side and middle spacings to:
 - sw240dp & sw280dp: 12dp
 - sw320dp : 15dp
 - sw360dp : 18dp
 - sw400dp and above : 20dp

APK here to try out: https://dl.dropboxusercontent.com/u/7163922/Work/1202737.apk
Assignee: mhaigh → s.kaspari
Assignee: s.kaspari → nobody
Blocks: tabs-tray-v3
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.