Closed Bug 1383733 Opened 8 years ago Closed 8 years ago

Activity Stream: Transform top sites into pager with 2-row grid

Categories

(Firefox for Android Graveyard :: General, enhancement, P1)

All
Android
enhancement

Tracking

(firefox57 verified)

VERIFIED FIXED
Firefox 57
Tracking Status
firefox57 --- verified

People

(Reporter: sebastian, Assigned: sebastian)

References

()

Details

(Whiteboard: [MobileAS] 1.27)

Attachments

(2 files)

(See linked mocks)
Assignee: nobody → s.kaspari
Status: NEW → ASSIGNED
Iteration: --- → 1.27
Priority: P2 → P1
Whiteboard: [MobileAS] → [MobileAS] 1.27
Follow-up needed for partially showing next page.
Attached image tworowsites.png
Rebased on top of the other changes that looks like this.
Comment on attachment 8894571 [details] Bug 1383733 - Show two rows of top sites. https://reviewboard.mozilla.org/r/165730/#review170930 ::: mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/ActivityStreamPanel.java:108 (Diff revision 2) > protected void onSizeChanged(int w, int h, int oldw, int oldh) { > super.onSizeChanged(w, h, oldw, oldh); > > int tiles = (w - tileMargin) / (desiredTileWidth + tileMargin); > > - if (tiles < MINIMUM_TILES) { > + if (tiles < TOP_SITES_COLUMNS) { I think there should be a way to simplify this logic - I'm struggling to understand what the intent of this code is. Perhaps it's something like: ```java int tiles = TOP_SITES_COLUMNS; int actualTileSize = // compute if (actualTileSize < desiredTileSize) { setPadding(0, 0, 0, 0; } else { // calculate & set padding } // continue... ``` ::: mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/topsites/TopSitesPage.java:26 (Diff revision 2) > > setLayoutManager(new GridLayoutManager(context, 1)); > } > > public void setTiles(int tiles) { > - setLayoutManager(new GridLayoutManager(getContext(), tiles)); > + setLayoutManager(new GridLayoutManager(getContext(), ActivityStreamPanel.TOP_SITES_COLUMNS)); If these values are constant and the args are unused, do we need the `setTiles` method? Can we set this in the constructor?
Attachment #8894571 - Flags: review?(michael.l.comella) → review+
Comment on attachment 8894571 [details] Bug 1383733 - Show two rows of top sites. https://reviewboard.mozilla.org/r/165730/#review170930 > I think there should be a way to simplify this logic - I'm struggling to understand what the intent of this code is. Perhaps it's something like: > > ```java > int tiles = TOP_SITES_COLUMNS; > int actualTileSize = // compute > if (actualTileSize < desiredTileSize) { > setPadding(0, 0, 0, 0; > } else { > // calculate & set padding > } > > // continue... > ``` I simplified the code a bit and added comments. > If these values are constant and the args are unused, do we need the `setTiles` method? Can we set this in the constructor? Yeah, this is not needed anymore.
Depends on: 1388392
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Top sites is properly displayed as a 2 row grid. Marking as verified.
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: