diff options
| author | 2014-04-16 17:56:29 -0700 | |
|---|---|---|
| committer | 2014-04-16 17:56:29 -0700 | |
| commit | dccbe8b02a34a3c78028a31ee158d4d2818c72ba (patch) | |
| tree | 5aa7821cfc07189ac35c3c0e9d42df75b031a0cb | |
| parent | 70802d2501dd5607ca0f38d7aa36771d9e0c7b20 (diff) | |
Fix alert dialog alignment and touch feedback masking
BUG: 13905057
Change-Id: Ia2bf4d170370c83f4ea863ecae24fffecc6fc020
4 files changed, 19 insertions, 16 deletions
diff --git a/core/res/res/drawable/btn_borderless_quantum.xml b/core/res/res/drawable/btn_borderless_quantum.xml index 2e3c515fcac1..69a891a67d8b 100644 --- a/core/res/res/drawable/btn_borderless_quantum.xml +++ b/core/res/res/drawable/btn_borderless_quantum.xml @@ -16,6 +16,7 @@ <touch-feedback xmlns:android="http://schemas.android.com/apk/res/android" android:tint="?attr/colorButtonPressed"> + <item android:drawable="@color/transparent" /> <item android:id="@id/mask" android:drawable="@drawable/btn_qntm_alpha" /> </touch-feedback> diff --git a/core/res/res/layout/alert_dialog_quantum.xml b/core/res/res/layout/alert_dialog_quantum.xml index 98b687973ebd..537162a109a0 100644 --- a/core/res/res/layout/alert_dialog_quantum.xml +++ b/core/res/res/layout/alert_dialog_quantum.xml @@ -91,32 +91,32 @@ style="?android:attr/buttonBarStyle" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" - android:layoutDirection="locale" - android:measureWithLargestChild="true"> + android:layoutDirection="locale"> <Button android:id="@+id/button3" + style="?android:attr/buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="start" android:layout_marginRight="8dip" android:maxLines="2" - android:minHeight="@dimen/alert_dialog_button_bar_height" - style="?android:attr/buttonBarButtonStyle" /> + android:minHeight="@dimen/alert_dialog_button_bar_height" /> + <View + android:layout_width="0dp" + android:layout_height="@dimen/alert_dialog_button_bar_height" + android:layout_weight="1" + android:visibility="invisible" /> <Button android:id="@+id/button2" + style="?android:attr/buttonBarButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="end" - android:layout_marginRight="8dip" android:maxLines="2" - android:minHeight="@dimen/alert_dialog_button_bar_height" - style="?android:attr/buttonBarButtonStyle" /> + android:minHeight="@dimen/alert_dialog_button_bar_height" /> <Button android:id="@+id/button1" + style="?android:attr/buttonBarButtonStyle" + android:layout_marginLeft="8dip" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="end" android:maxLines="2" - android:minHeight="@dimen/alert_dialog_button_bar_height" - style="?android:attr/buttonBarButtonStyle" /> + android:minHeight="@dimen/alert_dialog_button_bar_height" /> </LinearLayout> </LinearLayout> </LinearLayout> diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml index a28496eb654b..c2e31f47c5a7 100644 --- a/core/res/res/values/themes_quantum.xml +++ b/core/res/res/values/themes_quantum.xml @@ -317,7 +317,7 @@ please see themes_device_defaults.xml. <item name="dividerVertical">?attr/listDivider</item> <item name="dividerHorizontal">?attr/listDivider</item> <item name="buttonBarStyle">@style/Widget.Quantum.ButtonBar</item> - <item name="buttonBarButtonStyle">?attr/borderlessButtonStyle</item> + <item name="buttonBarButtonStyle">@style/Widget.Quantum.Button.Borderless.Small</item> <item name="segmentedButtonStyle">@style/Widget.Quantum.SegmentedButton</item> <!-- SearchView attributes --> @@ -662,7 +662,7 @@ please see themes_device_defaults.xml. <item name="dividerVertical">?attr/listDivider</item> <item name="dividerHorizontal">?attr/listDivider</item> <item name="buttonBarStyle">@style/Widget.Quantum.Light.ButtonBar</item> - <item name="buttonBarButtonStyle">?attr/borderlessButtonStyle</item> + <item name="buttonBarButtonStyle">@style/Widget.Quantum.Light.Button.Borderless.Small</item> <item name="segmentedButtonStyle">@style/Widget.Quantum.Light.SegmentedButton</item> <!-- SearchView attributes --> diff --git a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java b/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java index 3773a4986504..5f594678f730 100644 --- a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java +++ b/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java @@ -44,6 +44,8 @@ import java.io.IOException; * Documentation pending. */ public class TouchFeedbackDrawable extends LayerDrawable { + private static final PorterDuffXfermode DST_IN = new PorterDuffXfermode(Mode.DST_IN); + /** The maximum number of ripples supported. */ private static final int MAX_RIPPLES = 10; @@ -397,7 +399,7 @@ public class TouchFeedbackDrawable extends LayerDrawable { if (mask != null && drewRipples) { // TODO: This will also mask the lower layer, which is bad. canvas.saveLayer(bounds.left, bounds.top, bounds.right, - bounds.bottom, getMaskingPaint(mState.mTintXfermode), 0); + bounds.bottom, getMaskingPaint(DST_IN), 0); mask.draw(canvas); } |