Closed
Bug 900234
Opened 11 years ago
Closed 11 years ago
Force reader to always be the left most icon in page actions
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 26
People
(Reporter: wesj, Assigned: shilpanbhagat)
Details
Attachments
(2 files, 5 obsolete files)
8.20 KB,
patch
|
shilpanbhagat
:
review+
|
Details | Diff | Splinter Review |
6.52 KB,
patch
|
shilpanbhagat
:
review+
|
Details | Diff | Splinter Review |
See description. Reader mode is a good differentiator for us. We want to show it off.
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → sbhagat
Assignee | ||
Comment 1•11 years ago
|
||
Insertion is required for forcing priority pageactions to always remain visible. This patch replaces LinkedHashMap with an ArrayList for the same.
Attachment #786413 -
Flags: review?(wjohnston)
Assignee | ||
Comment 2•11 years ago
|
||
Forgot to clean up an integer. This should be it.
Attachment #786413 -
Attachment is obsolete: true
Attachment #786413 -
Flags: review?(wjohnston)
Attachment #786418 -
Flags: review?(wjohnston)
Assignee | ||
Comment 3•11 years ago
|
||
With this patch, you can now set priority pageactions which will strive be visible over other pageactions. Currently reader mode is the only one and hence appears on the leftmost side of the page action layout.
Attachment #786512 -
Flags: review?(wjohnston)
Reporter | ||
Comment 4•11 years ago
|
||
Comment on attachment 786418 [details] [diff] [review] Part 1: Replacing LinkedHashMap with ArrayList to allow insertions Review of attachment 786418 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/base/PageActionLayout.java @@ +256,5 @@ > mPageActionsMenu.inflate(0); > mPageActionsMenu.setOnMenuItemClickListener(new GeckoPopupMenu.OnMenuItemClickListener() { > @Override > public boolean onMenuItemClick(MenuItem item) { > + mPageActionList.get(item.getItemId()).onClick(); Hmm.. does this cause issues if items are added/removed while the menu is showing?
Attachment #786418 -
Flags: review?(wjohnston) → review+
Reporter | ||
Comment 5•11 years ago
|
||
Comment on attachment 786512 [details] [diff] [review] Part 2: Force reader mode to be the left most pageaction Review of attachment 786512 [details] [diff] [review]: ----------------------------------------------------------------- Looks pretty good to me. I just want to see the cleaned up insertAt algorithm. ::: mobile/android/base/PageActionLayout.java @@ +121,5 @@ > + // Add priority pageactions at the very end of the list. > + if (mPageActionList.size() == 0) { > + mPageActionList.add(pageAction); > + } else { > + for(int i = mPageActionList.size() - 1; i >= 0; i--) { This is all pretty confusing. Can we do something simpler? int insertAt = mPageActionList.size() - 1; while(insertAt > 0 && mPageActionList.get(insertAt).isImportant()) { insertAt--; } mPageActionList.add(insertAt, pageAction); @@ +300,5 @@ > private OnPageActionClickListeners mOnPageActionClickListeners; > private Drawable mDrawable; > private String mTitle; > private String mId; > + private boolean hasPriority; Lets just call this priority... or important? ::: mobile/android/chrome/content/browser.js @@ +1652,5 @@ > type: "PageActions:Add", > id: id, > title: aOptions.title, > + icon: resolveGeckoURI(aOptions.icon), > + hasPriority: (aOptions.hasPriority != undefined) ? aOptions.hasPriority : false I think we typically do "hasPriority" in aOptions ? aOptions.hasPriority : false
Attachment #786512 -
Flags: review?(wjohnston)
Assignee | ||
Comment 6•11 years ago
|
||
Carry forward from last r+ for part 1.
Attachment #786418 -
Attachment is obsolete: true
Attachment #789054 -
Flags: review+
Assignee | ||
Comment 7•11 years ago
|
||
Made changes as mentioned
Attachment #786512 -
Attachment is obsolete: true
Attachment #789111 -
Flags: review?(wjohnston)
Reporter | ||
Comment 8•11 years ago
|
||
Comment on attachment 789111 [details] [diff] [review] Part 2: Force reader mode to be the left most pageaction Review of attachment 789111 [details] [diff] [review]: ----------------------------------------------------------------- r- because this throws and fails ::: mobile/android/base/PageActionLayout.java @@ +118,5 @@ > + public void addPageAction(final String id, final String title, final String imageData, final OnPageActionClickListeners mOnPageActionClickListeners, boolean mImportant) { > + final PageAction pageAction = new PageAction(id, title, null, mOnPageActionClickListeners, mImportant); > + > + int insertAt = mPageActionList.size(); > + if (mPageActionList.size() > 0) { Do you need this if? Won't insertAt > 0 cover this already? @@ +119,5 @@ > + final PageAction pageAction = new PageAction(id, title, null, mOnPageActionClickListeners, mImportant); > + > + int insertAt = mPageActionList.size(); > + if (mPageActionList.size() > 0) { > + while (insertAt > 0 && mPageActionList.get(insertAt).isImportant()) { mPageActionList.get(insertAt) will fail when insertAt = size.
Attachment #789111 -
Flags: review?(wjohnston) → review-
Assignee | ||
Comment 9•11 years ago
|
||
With revised insertAt algorithm
Attachment #789111 -
Attachment is obsolete: true
Attachment #790329 -
Flags: review?(wjohnston)
Reporter | ||
Comment 10•11 years ago
|
||
Comment on attachment 790329 [details] [diff] [review] Part 2: Force reader mode to be the left most pageaction Review of attachment 790329 [details] [diff] [review]: ----------------------------------------------------------------- Nice and clean. Land and nom this for uplift too! ::: mobile/android/chrome/content/browser.js @@ +1639,5 @@ > type: "PageActions:Add", > id: id, > title: aOptions.title, > + icon: resolveGeckoURI(aOptions.icon), > + isImportant: "isImportant" in aOptions ? aOptions.isImportant : false I'd probably rename this property "important" and drop the "is" part.
Attachment #790329 -
Flags: review?(wjohnston) → review+
Assignee | ||
Comment 11•11 years ago
|
||
Carry forward r+ with mentioned changes
Attachment #790329 -
Attachment is obsolete: true
Attachment #792492 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 12•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/7b7b35e4350c https://hg.mozilla.org/integration/fx-team/rev/a550304775f1
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Comment 13•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7b7b35e4350c https://hg.mozilla.org/mozilla-central/rev/a550304775f1
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 26
Reporter | ||
Comment 15•10 years ago
|
||
Hmm... Too late to uplift. This has shipped :)
Flags: needinfo?(shilpanbhagat)
Updated•3 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
•