diff options
author | Danny Baumann <dannybaumann@web.de> | 2013-04-26 15:08:20 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2013-04-26 15:08:20 +0200 |
commit | f028eae181aa7ad58e526e472ed35cc20c93b6d0 (patch) | |
tree | 113efd05e305d116b0b37189daf8f0fea0c5471e /src | |
parent | 05a6ae70487bfca5c1ab9ea315a1734d463efda8 (diff) | |
download | packages_apps_Settings-f028eae181aa7ad58e526e472ed35cc20c93b6d0.zip packages_apps_Settings-f028eae181aa7ad58e526e472ed35cc20c93b6d0.tar.gz packages_apps_Settings-f028eae181aa7ad58e526e472ed35cc20c93b6d0.tar.bz2 |
Fix light settings dialog being unusable in landscape.
Change-Id: I38eeeafd1d8260ab4a7c8de9099a7e270c1462f2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/notificationlight/AlphaPatternDrawable.java | 4 | ||||
-rw-r--r-- | src/com/android/settings/notificationlight/ColorPickerView.java | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/settings/notificationlight/AlphaPatternDrawable.java b/src/com/android/settings/notificationlight/AlphaPatternDrawable.java index 04fa0b6..58b4a04 100644 --- a/src/com/android/settings/notificationlight/AlphaPatternDrawable.java +++ b/src/com/android/settings/notificationlight/AlphaPatternDrawable.java @@ -56,7 +56,9 @@ public class AlphaPatternDrawable extends Drawable { @Override public void draw(Canvas canvas) { - canvas.drawBitmap(mBitmap, null, getBounds(), mPaint); + if (mBitmap != null) { + canvas.drawBitmap(mBitmap, null, getBounds(), mPaint); + } } @Override diff --git a/src/com/android/settings/notificationlight/ColorPickerView.java b/src/com/android/settings/notificationlight/ColorPickerView.java index 56bfa32..b896614 100644 --- a/src/com/android/settings/notificationlight/ColorPickerView.java +++ b/src/com/android/settings/notificationlight/ColorPickerView.java @@ -572,7 +572,7 @@ public class ColorPickerView extends View { // If calculated height (based on the width) is more than the // allowed height. - if (height > heightAllowed) { + if (height > heightAllowed && heightMode != MeasureSpec.UNSPECIFIED) { height = heightAllowed; width = (int) (height + PANEL_SPACING + HUE_PANEL_WIDTH); } else { @@ -582,7 +582,7 @@ public class ColorPickerView extends View { width = (int) (heightAllowed - ALPHA_PANEL_HEIGHT + HUE_PANEL_WIDTH); - if (width > widthAllowed) { + if (width > widthAllowed && widthMode != MeasureSpec.UNSPECIFIED) { width = widthAllowed; height = (int) (widthAllowed - HUE_PANEL_WIDTH + ALPHA_PANEL_HEIGHT); } else { |