Rotating multi-pane fragments in Settings displays margins incorrectly

NEW
Unassigned

Status

()

6 years ago
5 years ago

People

(Reporter: liuche, Unassigned)

Tracking

Trunk
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 2 obsolete attachments)

Comment hidden (empty)
(Reporter)

Comment 1

6 years ago
Was playing around with the new settings, and noticed that the margins are set based on what orientation the tablet is in when Settings is launched, not what orientation the Settings screen is displayed in. This means if Settings is launched in horizontal mode, the larger margin settings persist even when the tablet is rotated to vertical (this cuts off some text); vice versa is also true (with smaller margins persisting).

STR:
1. Have tablet in horizontal mode.
2. Launch Settings - margins are present on either side of the two panes to center the view.
3. Rotate tablet to vertical.

Expected:
Margins decrease to fit smaller horizontal space.

Actual:
Margins remain, even with smaller horizontal viewing space. This cramps the text (and truncates some titles).
Depends on: 773535
(Reporter)

Comment 2

6 years ago
Created attachment 741611 [details]
Screenshot: Vertical view margins from vertical launch
(Reporter)

Comment 3

6 years ago
Created attachment 741612 [details]
Screenshot: Vertical view margins from horizontal launch
(Reporter)

Comment 4

6 years ago
Created attachment 741613 [details]
Screenshot: Vertical view margins from vertical launch

(derp, rotated)
Attachment #741611 - Attachment is obsolete: true
(Reporter)

Comment 5

6 years ago
Created attachment 741614 [details]
Screenshot: Vertical view margins from horizontal launch
Attachment #741612 - Attachment is obsolete: true
We probably need to reinflate the content on rotations....

Updated

6 years ago
Blocks: 862793

Updated

6 years ago
No longer blocks: 862793

Comment 7

5 years ago
Created attachment 786732 [details] [diff] [review]
Patch: Preferences pane now sets correct layout on config change

Does as described above. Pretty straight forward.
Attachment #786732 - Flags: review?(liuche)

Updated

5 years ago
Assignee: nobody → sbhagat

Updated

5 years ago
Assignee: sbhagat → nobody
(Reporter)

Comment 8

5 years ago
Comment on attachment 786732 [details] [diff] [review]
Patch: Preferences pane now sets correct layout on config change

Clearing the review flag because it turns out that the fix for this would be much more complicated than we first thought.

Removing "onConfigChange" does fix the margin bug, but regresses some other behavior [1]. We decided that there are higher priority bugs to focus on, especially in light of the gains (fixed margins) versus added code complexity of the correct fix.

[1] Removing onConfigChange causes recreation of the activity on all rotations, so we lose state for some dialogs that might be open (Clear private data, Master password, Import from Android, etc). If we ever move to having separate screens for these preferences (unlikely) this would be easier to fix.

The correct fix would be to implement View.onSaveInstanceState and View.onRestoreInstanceState, but to do this correctly involves handling saving some extra preference state. For instance, for Clear private data, there are a series of checkboxes whose state should be saved on rotation, on "confirm", but not on "cancel." One approach would be to save a separate preference for the checkbox state that gets cleared on "cancel" or "commit," but persists through config changes.
Attachment #786732 - Flags: review?(liuche)
(Reporter)

Comment 9

5 years ago
[2] The other regression I forgot to mention is that the Fragment titles disappeared on rotation until a header is clicked.
You need to log in before you can comment on or make changes to this bug.