summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-10-11 13:26:48 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-11 13:26:48 -0700
commite1e4e1b2ad588f227872468cf7dbe51e647b565e (patch)
tree28a12c839659e0ecd2a6d3e2e0e4e45a38985857 /src
parent938db80ec52fc02fd54027628772d528db0fe3c7 (diff)
parent1adf0307932f3933be792e631612ea1a2fd4e6e2 (diff)
downloadpackages_apps_Browser-e1e4e1b2ad588f227872468cf7dbe51e647b565e.zip
packages_apps_Browser-e1e4e1b2ad588f227872468cf7dbe51e647b565e.tar.gz
packages_apps_Browser-e1e4e1b2ad588f227872468cf7dbe51e647b565e.tar.bz2
Merge "Fix crash with qc" into ics-mr0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/NavScreen.java3
-rw-r--r--src/com/android/browser/NavTabScroller.java2
-rw-r--r--src/com/android/browser/PhoneUi.java30
3 files changed, 20 insertions, 15 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java
index 45b1dcc..14b1e84 100644
--- a/src/com/android/browser/NavScreen.java
+++ b/src/com/android/browser/NavScreen.java
@@ -110,7 +110,8 @@ public class NavScreen extends RelativeLayout
}
public void refreshAdapter() {
- mAdapter.notifyDataSetChanged();
+ mScroller.handleDataChanged(
+ mUiController.getTabControl().getTabPosition(mUi.getActiveTab()));
}
private void init() {
diff --git a/src/com/android/browser/NavTabScroller.java b/src/com/android/browser/NavTabScroller.java
index 8251928..1dfddff 100644
--- a/src/com/android/browser/NavTabScroller.java
+++ b/src/com/android/browser/NavTabScroller.java
@@ -213,7 +213,7 @@ public class NavTabScroller extends ScrollerView {
handleDataChanged(INVALID_POSITION);
}
- protected void handleDataChanged(int newscroll) {
+ void handleDataChanged(int newscroll) {
int scroll = getScrollValue();
if (mGapAnimator != null) {
mGapAnimator.cancel();
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index ddb4e0e..d39909e 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -324,8 +324,7 @@ public class PhoneUi extends BaseUi {
mAnimScreen = new AnimScreen(mActivity);
}
mAnimScreen.set(getTitleBar(), getWebView());
- final View animView = mAnimScreen.mMain;
- mCustomViewContainer.addView(animView, COVER_SCREEN_PARAMS);
+ mCustomViewContainer.addView(mAnimScreen.mMain, COVER_SCREEN_PARAMS);
mCustomViewContainer.setVisibility(View.VISIBLE);
mCustomViewContainer.bringToFront();
int fromLeft = 0;
@@ -356,7 +355,8 @@ public class PhoneUi extends BaseUi {
1f, 0f);
ObjectAnimator sx = ObjectAnimator.ofFloat(mAnimScreen, "scaleFactor",
1f, scaleFactor);
- ObjectAnimator blend1 = ObjectAnimator.ofFloat(mAnimScreen.mMain, "alpha", 1, 0);
+ ObjectAnimator blend1 = ObjectAnimator.ofFloat(mAnimScreen.mMain,
+ "alpha", 1f, 0f);
blend1.setDuration(100);
inanim.playTogether(tx, ty, tr, tb, sx, title);
@@ -364,7 +364,7 @@ public class PhoneUi extends BaseUi {
set1.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator anim) {
- mCustomViewContainer.removeView(animView);
+ mCustomViewContainer.removeView(mAnimScreen.mMain);
finishAnimationIn();
mUiController.setBlockEvents(false);
}
@@ -512,15 +512,19 @@ public class PhoneUi extends BaseUi {
}
public void set(TitleBar tbar, WebView web) {
- if (mTitleBarBitmap == null
- || mTitleBarBitmap.getWidth() != tbar.getWidth()
- || mTitleBarBitmap.getHeight() != tbar.getEmbeddedHeight()) {
- mTitleBarBitmap = Bitmap.createBitmap(tbar.getWidth(),
- tbar.getEmbeddedHeight(), Bitmap.Config.RGB_565);
+ if (tbar.getWidth() > 0 && tbar.getEmbeddedHeight() > 0) {
+ if (mTitleBarBitmap == null
+ || mTitleBarBitmap.getWidth() != tbar.getWidth()
+ || mTitleBarBitmap.getHeight() != tbar.getEmbeddedHeight()) {
+ mTitleBarBitmap = Bitmap.createBitmap(tbar.getWidth(),
+ tbar.getEmbeddedHeight(), Bitmap.Config.RGB_565);
+ }
+ Canvas c = new Canvas(mTitleBarBitmap);
+ tbar.draw(c);
+ c.setBitmap(null);
+ } else {
+ mTitleBarBitmap = null;
}
- Canvas c = new Canvas(mTitleBarBitmap);
- tbar.draw(c);
- c.setBitmap(null);
mTitle.setImageBitmap(mTitleBarBitmap);
mTitle.setVisibility(View.VISIBLE);
int h = web.getHeight() - tbar.getEmbeddedHeight();
@@ -530,7 +534,7 @@ public class PhoneUi extends BaseUi {
mContentBitmap = Bitmap.createBitmap(web.getWidth(), h,
Bitmap.Config.RGB_565);
}
- c.setBitmap(mContentBitmap);
+ Canvas c = new Canvas(mContentBitmap);
int tx = web.getScrollX();
int ty = web.getScrollY();
c.translate(-tx, -ty - tbar.getEmbeddedHeight());