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)
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 | ||
Updated•8 years ago
|
Assignee: nobody → s.kaspari
Status: NEW → ASSIGNED
Blocks: 1383734
Iteration: --- → 1.27
Priority: P2 → P1
Whiteboard: [MobileAS] → [MobileAS] 1.27
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•8 years ago
|
||
Follow-up needed for partially showing next page.
Assignee | ||
Comment 3•8 years ago
|
||
Rebased on top of the other changes that looks like this.
Comment hidden (mozreview-request) |
Comment 5•8 years ago
|
||
mozreview-review |
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+
Assignee | ||
Comment 6•8 years ago
|
||
mozreview-review-reply |
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.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Pushed by s.kaspari@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c9f1712d723d
Show two rows of top sites. r=mcomella
Comment 10•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Comment 11•7 years ago
|
||
Top sites is properly displayed as a 2 row grid. Marking as verified.
Status: RESOLVED → VERIFIED
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•