summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/EdgeSwipeView.java
diff options
context:
space:
mode:
authorPankaj Garg <pgarg@codeaurora.org>2015-09-14 11:21:19 -0700
committerjrizzoli <joey@cyanogenmoditalia.it>2015-11-05 14:22:56 +0100
commit036365be068b993cb63322ca2540873507941095 (patch)
tree14e725e77f7b3ffebd880ee24f14288183de29c6 /src/com/android/browser/EdgeSwipeView.java
parentf5e6af684d2dc16d150561290aabdd2cfc45e583 (diff)
downloadandroid_packages_apps_Gello-036365be068b993cb63322ca2540873507941095.tar.gz
android_packages_apps_Gello-036365be068b993cb63322ca2540873507941095.tar.bz2
android_packages_apps_Gello-036365be068b993cb63322ca2540873507941095.zip
Fixes to Edge Navigation for missing bitmaps
- Show prominent color from favicon when bitmap capture of a navigation entry is missing - More active purging of bitmaps on navigation Change-Id: I2c137385bd1b1179dbbb16c0c3e933783d499c34
Diffstat (limited to 'src/com/android/browser/EdgeSwipeView.java')
-rw-r--r--src/com/android/browser/EdgeSwipeView.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/browser/EdgeSwipeView.java b/src/com/android/browser/EdgeSwipeView.java
index a777c26f..bce8aef3 100644
--- a/src/com/android/browser/EdgeSwipeView.java
+++ b/src/com/android/browser/EdgeSwipeView.java
@@ -135,10 +135,10 @@ public class EdgeSwipeView {
return (mViewGroup.getHeight() < mViewGroup.getWidth());
}
- private void setBitmap(ImageView view, Bitmap bitmap) {
+ private void setBitmap(ImageView view, Bitmap bitmap, int color) {
clampViewIfNeeded(view);
if (bitmap == null) {
- bitmap = getColorBitmap(Color.DKGRAY);
+ bitmap = getColorBitmap(color);
}
int offset = 0;
@@ -146,6 +146,12 @@ public class EdgeSwipeView {
offset = mTitleBar.getNavigationBar().getMeasuredHeight();
}
+ if ((view.getMeasuredHeight() > view.getMeasuredWidth()) !=
+ (bitmap.getHeight() > bitmap.getWidth())) {
+ view.setImageBitmap(bitmap);
+ return;
+ }
+
int bitmap_height = bitmap.getHeight();
if (view.getMeasuredHeight() != 0) {
@@ -161,18 +167,18 @@ public class EdgeSwipeView {
}
}
- public void setStationaryViewBitmap(Bitmap bitmap) {
+ public void setStationaryViewBitmap(Bitmap bitmap, int color) {
mbStationaryViewBMSet = null != bitmap;
- setBitmap(mStationaryView, bitmap);
+ setBitmap(mStationaryView, bitmap, color);
}
public void setStationaryViewAlpha(float alpha) {
mStationaryView.setAlpha(alpha);
}
- public void setSlidingViewBitmap(Bitmap bitmap) {
+ public void setSlidingViewBitmap(Bitmap bitmap, int color) {
mbSlidingViewBMSet = null != bitmap;
- setBitmap(mSlidingView, bitmap);
+ setBitmap(mSlidingView, bitmap, color);
}
public boolean slidingViewHasImage() {