Closed
Bug 862794
Opened 13 years ago
Closed 12 years ago
About:home "visited" panel
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 26
People
(Reporter: ibarlow, Assigned: lucasr)
References
Details
(Whiteboard: fixed-fig)
Attachments
(3 files, 1 obsolete file)
|
261.05 KB,
image/png
|
Details | |
|
12.35 KB,
patch
|
bnicholson
:
review+
|
Details | Diff | Splinter Review |
|
12.14 KB,
patch
|
bnicholson
:
review+
|
Details | Diff | Splinter Review |
This is the bug to track work on the new "visited" panel on about:home.
This panel is intended to display a places the user has been, including their frecency (awesomebar) list, history, and tabs from last time
Mockups to follow shortly.
| Reporter | ||
Comment 1•13 years ago
|
||
| Reporter | ||
Comment 2•13 years ago
|
||
Work in this bug should include
* Creating a frecency based history list
* Creating secondary sections for chronological History and Tabs from last time
* Restyling list elements
* Set text overflow to fade to white, instead of using an ellipsis
* Apply dominant background / border colors to list items with small (16px) favicons. See bug 837392
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → lucasr.at.mozilla
| Assignee | ||
Comment 3•12 years ago
|
||
Attachment #762070 -
Flags: review?(bnicholson)
| Assignee | ||
Comment 4•12 years ago
|
||
Attachment #762071 -
Flags: review?(bnicholson)
| Assignee | ||
Comment 5•12 years ago
|
||
FYI: the "history" and "tabs from last time" will be implemented in separate patches (see bug 882715 and bug 882716)
Comment 6•12 years ago
|
||
Comment on attachment 762070 [details] [diff] [review]
(1/2) Factor out the code for handling favicon loaders
Review of attachment 762070 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/home/FaviconsLoader.java
@@ +29,5 @@
> + // Argument containing list of urls for the favicons loader
> + private static final String FAVICONS_LOADER_URLS_ARG = "urls";
> +
> + private FaviconsLoader() {
> + }
AH TABS
@@ +84,5 @@
> + public static void restartFromCursor(LoaderManager manager, int loaderId,
> + LoaderCallbacks<Cursor> callbacks, Cursor c) {
> + // If there urls without in-memory favicons, trigger a new loader
> + // to load the images from disk to memory.
> + ArrayList<String> urls = getUrlsWithoutFavicon(c);
NO! MOAR TABS
@@ +99,5 @@
> + return new FaviconsCursorLoader(context, urls);
> + }
> +
> + private static class FaviconsCursorLoader extends SimpleCursorLoader {
> + private ArrayList<String> mUrls;
nit: final
Attachment #762070 -
Flags: review?(bnicholson) → review+
Comment 7•12 years ago
|
||
Comment on attachment 762071 [details] [diff] [review]
(2/2) Implement Visited page in about:home
Review of attachment 762071 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/home/VisitedPage.java
@@ +79,5 @@
> + @Override
> + public void onDetach() {
> + super.onDetach();
> +
> + mUrlOpenListener = null;
You should also clear the mInflater reference here.
@@ +86,5 @@
> + @Override
> + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
> + // All list views are styled to look the same with a global activity theme.
> + // If the style of the list changes, inflate it from an XML.
> + mList = new HomeListView(container.getContext());
Set mList to null in onDestroyView() so it doesn't leak.
@@ +94,5 @@
> + @Override
> + public void onViewCreated(View view, Bundle savedInstanceState) {
> + super.onViewCreated(view, savedInstanceState);
> +
> + mList.setOnItemClickListener(this);
Do you think it would be better to register this handler internally like you do with CursorLoaderCallbacks? That way VisitedPage wouldn't have to expose a new onItemClick() method.
Attachment #762071 -
Flags: review?(bnicholson) → review+
| Assignee | ||
Comment 8•12 years ago
|
||
(In reply to Brian Nicholson (:bnicholson) (gone through June 22) from comment #6)
> Comment on attachment 762070 [details] [diff] [review]
> (1/2) Factor out the code for handling favicon loaders
>
> Review of attachment 762070 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: mobile/android/base/home/FaviconsLoader.java
> @@ +29,5 @@
> > + // Argument containing list of urls for the favicons loader
> > + private static final String FAVICONS_LOADER_URLS_ARG = "urls";
> > +
> > + private FaviconsLoader() {
> > + }
>
> AH TABS
Eek, removed :-)
> @@ +84,5 @@
> > + public static void restartFromCursor(LoaderManager manager, int loaderId,
> > + LoaderCallbacks<Cursor> callbacks, Cursor c) {
> > + // If there urls without in-memory favicons, trigger a new loader
> > + // to load the images from disk to memory.
> > + ArrayList<String> urls = getUrlsWithoutFavicon(c);
>
> NO! MOAR TABS
Argh, removed.
> @@ +99,5 @@
> > + return new FaviconsCursorLoader(context, urls);
> > + }
> > +
> > + private static class FaviconsCursorLoader extends SimpleCursorLoader {
> > + private ArrayList<String> mUrls;
>
> nit: final
Fixed.
| Assignee | ||
Comment 9•12 years ago
|
||
(In reply to Brian Nicholson (:bnicholson) (gone through June 22) from comment #7)
> Comment on attachment 762071 [details] [diff] [review]
> (2/2) Implement Visited page in about:home
>
> Review of attachment 762071 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: mobile/android/base/home/VisitedPage.java
> @@ +79,5 @@
> > + @Override
> > + public void onDetach() {
> > + super.onDetach();
> > +
> > + mUrlOpenListener = null;
>
> You should also clear the mInflater reference here.
Done.
> @@ +86,5 @@
> > + @Override
> > + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
> > + // All list views are styled to look the same with a global activity theme.
> > + // If the style of the list changes, inflate it from an XML.
> > + mList = new HomeListView(container.getContext());
>
> Set mList to null in onDestroyView() so it doesn't leak.
Setting to references null is only necessary when you're dealing with a component that we don't own. Once the fragment is removed, it will eventually be GC'd together with its internal bits.
In other words, I'd be surprised if mList is leaked if we don't set it to null here.
> @@ +94,5 @@
> > + @Override
> > + public void onViewCreated(View view, Bundle savedInstanceState) {
> > + super.onViewCreated(view, savedInstanceState);
> > +
> > + mList.setOnItemClickListener(this);
>
> Do you think it would be better to register this handler internally like you
> do with CursorLoaderCallbacks? That way VisitedPage wouldn't have to expose
> a new onItemClick() method.
Not sure I follow. You mean encapsulate the onItemClick handler into a class so that it can be shared or something? I feel like this is not enough code to warrant such an effort.
Comment 10•12 years ago
|
||
(In reply to Lucas Rocha (:lucasr) from comment #9)
> Setting to references null is only necessary when you're dealing with a
> component that we don't own. Once the fragment is removed, it will
> eventually be GC'd together with its internal bits.
Yeah, I was just referring to the period when the fragment is alive. It won't affect us as long as we're using a FragmentStatePagerAdapter, but if we decide to switch to a FragmentPagerAdapter, we don't want to hold onto that view reference when going between pages.
> Not sure I follow. You mean encapsulate the onItemClick handler into a class
> so that it can be shared or something? I feel like this is not enough code
> to warrant such an effort.
Not so it can be shared, but just so it isn't exposed as an additional public method. Using inheritance over composition here unnecessarily breaks encapsulation when methods are made public in a class just so they can implement internal callbacks. It also makes things harder to read IMO when a class implements multiple listeners and I have to figure out which methods are associated with which interfaces.
We already do this in lots of other places though (both in Gecko and Java), so I don't feel too strongly about it -- just a suggestion.
Comment 11•12 years ago
|
||
"Using inheritance over composition here unnecessarily breaks
encapsulation when methods are made public in a class just so they can
implement internal callbacks."
Woah!
| Assignee | ||
Comment 12•12 years ago
|
||
Attachment #764233 -
Flags: review?(bnicholson)
| Assignee | ||
Updated•12 years ago
|
Attachment #762071 -
Attachment is obsolete: true
Comment 13•12 years ago
|
||
Comment on attachment 764233 [details] [diff] [review]
Implement Visited page in about:home
Review of attachment 764233 [details] [diff] [review]:
-----------------------------------------------------------------
Nice.
Attachment #764233 -
Flags: review?(bnicholson) → review+
| Assignee | ||
Comment 14•12 years ago
|
||
Pushed:
http://hg.mozilla.org/projects/fig/rev/5e477b9520a2
http://hg.mozilla.org/projects/fig/rev/3561c794b2e4
Whiteboard: fixed-fig
Comment 15•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5e477b9520a2
https://hg.mozilla.org/mozilla-central/rev/3561c794b2e4
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Updated•5 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
•