summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/NavScreen.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-08-09 16:00:35 -0700
committerJohn Reck <jreck@google.com>2011-08-09 16:17:21 -0700
commit8ee633fd62f94cd66c85c2904232d7c9e204cc9c (patch)
treee451ff70a2367befb1282180d924fa140b8bc2fc /src/com/android/browser/NavScreen.java
parent37d9f2f4c540131453b692d6cb17468637dcef9e (diff)
downloadpackages_apps_Browser-8ee633fd62f94cd66c85c2904232d7c9e204cc9c.zip
packages_apps_Browser-8ee633fd62f94cd66c85c2904232d7c9e204cc9c.tar.gz
packages_apps_Browser-8ee633fd62f94cd66c85c2904232d7c9e204cc9c.tar.bz2
Reduce capture frequency
Bug: 5142655 Only capture while the navscreen is visible Fix Tab.capture to never capture the title bar Fix navscreen not responding to updated thumbnails Change-Id: Id48ad32bb131c398c7d1ce4243e92f04cd421ade
Diffstat (limited to 'src/com/android/browser/NavScreen.java')
-rw-r--r--src/com/android/browser/NavScreen.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java
index face39e..0190c1b 100644
--- a/src/com/android/browser/NavScreen.java
+++ b/src/com/android/browser/NavScreen.java
@@ -38,9 +38,12 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import com.android.browser.NavTabGallery.OnRemoveListener;
+import com.android.browser.TabControl.OnThumbnailUpdatedListener;
+
+import java.util.HashMap;
public class NavScreen extends RelativeLayout
- implements OnClickListener, OnMenuItemClickListener {
+ implements OnClickListener, OnMenuItemClickListener, OnThumbnailUpdatedListener {
UiController mUiController;
PhoneUi mUi;
@@ -62,6 +65,7 @@ public class NavScreen extends RelativeLayout
TabAdapter mAdapter;
int mOrientation;
boolean mNeedsMenu;
+ HashMap<Tab, View> mTabViews;
public NavScreen(Activity activity, UiController ctl, PhoneUi ui) {
super(activity);
@@ -119,7 +123,9 @@ public class NavScreen extends RelativeLayout
mNewTab.setOnClickListener(this);
mMore.setOnClickListener(this);
mScroller = (NavTabGallery) findViewById(R.id.scroller);
- mAdapter = new TabAdapter(mContext, mUiController.getTabControl());
+ TabControl tc = mUiController.getTabControl();
+ mTabViews = new HashMap<Tab, View>(tc.getTabCount());
+ mAdapter = new TabAdapter(mContext, tc);
mScroller.setAdapter(mAdapter);
mScroller.setOrientation(mOrientation == Configuration.ORIENTATION_LANDSCAPE
? LinearLayout.HORIZONTAL : LinearLayout.VERTICAL);
@@ -239,6 +245,7 @@ public class NavScreen extends RelativeLayout
final NavTabView tabview = new NavTabView(mActivity);
final Tab tab = getItem(position);
tabview.setWebView(mUi, tab);
+ mTabViews.put(tab, tabview.mImage);
tabview.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
@@ -262,4 +269,13 @@ public class NavScreen extends RelativeLayout
}
+ @Override
+ public void onThumbnailUpdated(Tab t) {
+ View v = mTabViews.get(t);
+ if (v != null) {
+ v.invalidate();
+ mScroller.invalidate();
+ }
+ }
+
}