Closed
Bug 883300
Opened 10 years ago
Closed 10 years ago
Make ListView in about:home bookmarks a class of its own
Categories
(Firefox for Android Graveyard :: Theme and Visual Design, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 26
People
(Reporter: sriram, Assigned: sriram)
References
Details
(Whiteboard: fixed-fig)
Attachments
(4 files)
3.25 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
32.53 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
1.43 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
3.27 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
Currently BookmarksPage holds everything related to the ListView. However, BookmarksPage will soon have a GridView. It's better to factor out the ListView in its own class.
Assignee | ||
Comment 1•10 years ago
|
||
This moves the ListView to an XML -- so that we can add a grid view later.
Attachment #762831 -
Flags: review?(margaret.leibovic)
Assignee | ||
Comment 2•10 years ago
|
||
This moves a big chunk from BookmarksPage to BookmarksListView. (nothing scary ;) ).
Attachment #762834 -
Flags: review?(margaret.leibovic)
Updated•10 years ago
|
Attachment #762831 -
Flags: review?(margaret.leibovic) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Minor documentation ;)
Attachment #762840 -
Flags: review?(margaret.leibovic)
Comment 4•10 years ago
|
||
Comment on attachment 762834 [details] [diff] [review] Part 2: ListView as its own class Review of attachment 762834 [details] [diff] [review]: ----------------------------------------------------------------- I really like where this is going, it makes BookmarksPage much more manageable. I just have some questions about some of the OnUrlOpenListener stuff. ::: mobile/android/base/home/BookmarksListView.java @@ +28,5 @@ > +import java.util.LinkedList; > + > +public class BookmarksListView extends HomeListView > + implements AdapterView.OnItemClickListener{ > + Nit: whitespace ::: mobile/android/base/home/BookmarksPage.java @@ +46,5 @@ > @Override > public void onDetach() { > super.onDetach(); > > mUrlOpenListener = null; Should we also be setting ListView.setOnUrlOpenListener(null) here, and then reset it onAttach? I'm not familiar with the lifecycle relationship between onAttach/onDetatch and onViewCreated, but it would be good to make sure we don't end up with a bad reference. ::: mobile/android/base/home/HomeListView.java @@ +31,5 @@ > // ContextMenuInfo associated with the currently long pressed list item. > private HomeContextMenuInfo mContextMenuInfo; > > + // On URL open listener > + private OnUrlOpenListener mUrlOpenListener; I don't really like that we're adding OnUrlOpenListener code in even more places, since I find it confusing to follow as it is. Maybe we can file a follow-up to try to clean up how we need to store all these references?
Attachment #762834 -
Flags: review?(margaret.leibovic) → review-
Comment 5•10 years ago
|
||
Comment on attachment 762834 [details] [diff] [review] Part 2: ListView as its own class Oops, I meant to make that an r+. But I still want to make sure we look into the things I mentioned :)
Attachment #762834 -
Flags: review- → review+
Comment 6•10 years ago
|
||
Comment on attachment 762840 [details] [diff] [review] Part 3: Minor documentation Review of attachment 762840 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/base/home/BookmarksListView.java @@ +27,5 @@ > > import java.util.LinkedList; > > +/** > + * A List view of bookmarks. Nit: why is List capitalized? I would expect this to either say ListView or list view. Also, maybe we should add a bit more to this comment about what this is doing, since right now it basically just says exactly what the class name says :)
Attachment #762840 -
Flags: review?(margaret.leibovic) → review+
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to :Margaret Leibovic from comment #4) > Comment on attachment 762834 [details] [diff] [review] > Part 2: ListView as its own class > > Review of attachment 762834 [details] [diff] [review]: > ----------------------------------------------------------------- > > I really like where this is going, it makes BookmarksPage much more > manageable. I just have some questions about some of the OnUrlOpenListener > stuff. > > ::: mobile/android/base/home/BookmarksListView.java > @@ +28,5 @@ > > +import java.util.LinkedList; > > + > > +public class BookmarksListView extends HomeListView > > + implements AdapterView.OnItemClickListener{ > > + > > Nit: whitespace > > ::: mobile/android/base/home/BookmarksPage.java > @@ +46,5 @@ > > @Override > > public void onDetach() { > > super.onDetach(); > > > > mUrlOpenListener = null; > > Should we also be setting ListView.setOnUrlOpenListener(null) here, and then > reset it onAttach? > > I'm not familiar with the lifecycle relationship between onAttach/onDetatch > and onViewCreated, but it would be good to make sure we don't end up with a > bad reference. > Oh, I can reset it in HomeListView -- as it owns this variable -- in onDetachedFromWindow(). Anyways, list view is recreated everytime, and when we detach, we are sure that we are not using the ListView again.
Comment 8•10 years ago
|
||
(In reply to Sriram Ramasubramanian [:sriram] from comment #7) > (In reply to :Margaret Leibovic from comment #4) > > Comment on attachment 762834 [details] [diff] [review] > > Part 2: ListView as its own class > > > > Review of attachment 762834 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > I really like where this is going, it makes BookmarksPage much more > > manageable. I just have some questions about some of the OnUrlOpenListener > > stuff. > > > > ::: mobile/android/base/home/BookmarksListView.java > > @@ +28,5 @@ > > > +import java.util.LinkedList; > > > + > > > +public class BookmarksListView extends HomeListView > > > + implements AdapterView.OnItemClickListener{ > > > + > > > > Nit: whitespace > > > > ::: mobile/android/base/home/BookmarksPage.java > > @@ +46,5 @@ > > > @Override > > > public void onDetach() { > > > super.onDetach(); > > > > > > mUrlOpenListener = null; > > > > Should we also be setting ListView.setOnUrlOpenListener(null) here, and then > > reset it onAttach? > > > > I'm not familiar with the lifecycle relationship between onAttach/onDetatch > > and onViewCreated, but it would be good to make sure we don't end up with a > > bad reference. > > > > Oh, I can reset it in HomeListView -- as it owns this variable -- in > onDetachedFromWindow(). Anyways, list view is recreated everytime, and when > we detach, we are sure that we are not using the ListView again. Do we still need to hold onto mUrlOpenListener at all in BookmarksPage? I only see it being used to call ListView.setOnUrlOpenListener.
Assignee | ||
Comment 9•10 years ago
|
||
I can clean that in a separate patch. :)
Assignee | ||
Comment 10•10 years ago
|
||
This removes the URL listener. BookmarksPage is so clean (and empty :D ).
Attachment #762865 -
Flags: review?(margaret.leibovic)
Assignee | ||
Comment 11•10 years ago
|
||
(In reply to :Margaret Leibovic from comment #6) > Comment on attachment 762840 [details] [diff] [review] > Part 3: Minor documentation > > Review of attachment 762840 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: mobile/android/base/home/BookmarksListView.java > @@ +27,5 @@ > > > > import java.util.LinkedList; > > > > +/** > > + * A List view of bookmarks. > > Nit: why is List capitalized? I would expect this to either say ListView or > list view. Also, maybe we should add a bit more to this comment about what > this is doing, since right now it basically just says exactly what the class > name says :) Exactly :D It's just a start. When we spin documentation for our code, we'll be more inclined to come up with a good message. I somehow didn't like a class name following a big list of imports. Readability was lacking a bit. So I added 2 lines of comments to separate it :D
Assignee | ||
Comment 12•10 years ago
|
||
http://hg.mozilla.org/projects/fig/rev/21426026164f http://hg.mozilla.org/projects/fig/rev/6cd11ae108b5 http://hg.mozilla.org/projects/fig/rev/202981fc6c93
Comment 13•10 years ago
|
||
Comment on attachment 762865 [details] [diff] [review] Part 4: Url listener cleanup Review of attachment 762865 [details] [diff] [review]: ----------------------------------------------------------------- Nice. And thanks for clarifying about the lifecycle issues.
Attachment #762865 -
Flags: review?(margaret.leibovic) → review+
Assignee | ||
Comment 14•10 years ago
|
||
http://hg.mozilla.org/projects/fig/rev/5b02134ccd2d
Assignee: nobody → sriram
Whiteboard: fixed-fig
Comment 15•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/21426026164f https://hg.mozilla.org/mozilla-central/rev/6cd11ae108b5 https://hg.mozilla.org/mozilla-central/rev/202981fc6c93 https://hg.mozilla.org/mozilla-central/rev/5b02134ccd2d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Updated•2 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
•