Closed Bug 1194770 Opened 9 years ago Closed 9 years ago

Default top sites appear on rotation in Top Sites panel

Categories

(Firefox for iOS :: Home screen, defect)

Other
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: tecgirl, Assigned: fluffyemily)

Details

Attachments

(1 file)

47 bytes, text/x-github-pull-request
sleroux
: review+
tecgirl
: ui-review-
sleroux
: feedback+
Details | Review
On fresh install, fresh sync, visit the Top Sites panel. Turn device from portrait to landscape. The default tiles [Mozilla][Mozilla Support] appear. Tap any other panel, return to the Top Sites panel, and they disappear. 

Possibly related to bug 1189991?
Attached file Pull request
Attachment #8648116 - Flags: ui-review?(randersen)
Attachment #8648116 - Flags: review?(sleroux)
Comment on attachment 8648116 [details] [review]
Pull request

Top sites no longer show on rotation but there is now a fifth column. We previously had 4 rows.
Attachment #8648116 - Flags: ui-review?(randersen) → ui-review-
Rows, not columns!  ;)
Assignee: nobody → etoop
Comment on attachment 8648116 [details] [review]
Pull request

Looks like there a bug with height/width caching their values because they are lazy properties. Left some commments on the PR.
Attachment #8648116 - Flags: review?(sleroux) → feedback+
Attachment #8648116 - Flags: review?(sleroux)
Comment on attachment 8648116 [details] [review]
Pull request

Moving the lazy to getters gets us half way there - I'm still seeing the 5 rows on the TopSitesPanel. What I noticed is that transitionToOrientation gets called only once on init which causes the heights/widths to have the incorrect value of 667 (screen height) since the panel hasn't laid out it's subviews yet. I tried to override the view controller's viewDidLayoutSubviews method like so:

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()

    if let collectionSize = collection?.frame.size {               layout.transitionToOrientation(UIView.viewOrientationForSize(collectionSize), atSize: collectionSize)
        }
}

And that seems to work since we're telling the layout to update after it's finished doing it's layout. I think with that snippet added, we're good to go on the patch!
Attachment #8648116 - Flags: review?(sleroux) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: