diff options
author | Patrick Scott <phanna@android.com> | 2010-03-09 16:02:08 -0500 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2010-03-11 10:19:12 -0500 |
commit | c1cf63a4c15ad81f4d19e10574e9dba91f0b83e4 (patch) | |
tree | 3233b47f7524012efdfe7e48a5756711e21f11fe /src/com/android/browser/BrowserBookmarksPage.java | |
parent | f739271c1cf974a1057a9a8a3f42b89937836228 (diff) | |
download | packages_apps_Browser-c1cf63a4c15ad81f4d19e10574e9dba91f0b83e4.zip packages_apps_Browser-c1cf63a4c15ad81f4d19e10574e9dba91f0b83e4.tar.gz packages_apps_Browser-c1cf63a4c15ad81f4d19e10574e9dba91f0b83e4.tar.bz2 |
Request icons in the background.
BrowserBookmarksAdapter does not need to request bookmark icons as most of the
bookmarks have up-to-date icons. We still need to request all icons on start up
because a new icon may be loaded as a result of clicking a history items.
Move the icon request to a background thread to not block the ui thread on large
db lookups.
Remove MostVisitedActivity as it is no longer used.
Bug: 2496872
Change-Id: I378dce8fdb7e825da96594cd31b720ea24758af1
Diffstat (limited to 'src/com/android/browser/BrowserBookmarksPage.java')
-rw-r--r-- | src/com/android/browser/BrowserBookmarksPage.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java index 1183b70..bff7c79 100644 --- a/src/com/android/browser/BrowserBookmarksPage.java +++ b/src/com/android/browser/BrowserBookmarksPage.java @@ -47,6 +47,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.ContextMenu.ContextMenuInfo; +import android.webkit.WebIconDatabase.IconListener; import android.widget.AdapterView; import android.widget.GridView; import android.widget.ListView; @@ -373,6 +374,23 @@ public class BrowserBookmarksPage extends Activity implements if (mVerticalList != null) { mVerticalList.setAdapter(mBookmarksAdapter); } + // Add our own listener in case there are favicons that + // have yet to be loaded. + if (mMostVisited) { + IconListener listener = new IconListener() { + public void onReceivedIcon(String url, + Bitmap icon) { + if (mGridPage != null) { + mGridPage.setAdapter(mBookmarksAdapter); + } + if (mVerticalList != null) { + mVerticalList.setAdapter(mBookmarksAdapter); + } + } + }; + CombinedBookmarkHistoryActivity.getIconListenerSet() + .addListener(listener); + } break; } } |