diff --git a/res/layout-land/dialog_light_settings.xml b/res/layout-land/dialog_light_settings.xml new file mode 100644 index 0000000..2e87ea7 --- /dev/null +++ b/res/layout-land/dialog_light_settings.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 AlphaPatternDrawable(int rectangleSize) { @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 815e304..532d12b 100644 --- a/src/com/android/settings/notificationlight/ColorPickerView.java +++ b/src/com/android/settings/notificationlight/ColorPickerView.java @@ -571,7 +571,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { // 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 { @@ -581,7 +581,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 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 {