summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-10-18 00:26:00 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-18 00:26:00 +0000
commit6fffe58bf414adaaaa0b381ab0f6b99ed4d801dd (patch)
tree01a1c5522daf9304af1330b532772b1256546898 /core
parenta15a75f32d69bd9d08c31a7499bb82ec58b133f2 (diff)
parent15e7b2ac60b0e6355e6ed5c1be676744c23f5a0e (diff)
downloadframeworks_base-6fffe58bf414adaaaa0b381ab0f6b99ed4d801dd.zip
frameworks_base-6fffe58bf414adaaaa0b381ab0f6b99ed4d801dd.tar.gz
frameworks_base-6fffe58bf414adaaaa0b381ab0f6b99ed4d801dd.tar.bz2
am 15e7b2ac: Merge "Translate compound button drawable by scroll position" into lmp-dev
* commit '15e7b2ac60b0e6355e6ed5c1be676744c23f5a0e': Translate compound button drawable by scroll position
Diffstat (limited to 'core')
-rw-r--r--core/java/android/widget/CompoundButton.java10
-rw-r--r--core/res/res/layout/select_dialog_item_material.xml4
-rw-r--r--core/res/res/layout/select_dialog_multichoice_material.xml4
-rw-r--r--core/res/res/layout/select_dialog_singlechoice_material.xml4
4 files changed, 15 insertions, 7 deletions
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 2ccd18d..7d9d305 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -398,7 +398,15 @@ public abstract class CompoundButton extends Button implements Checkable {
super.onDraw(canvas);
if (buttonDrawable != null) {
- buttonDrawable.draw(canvas);
+ final int scrollX = mScrollX;
+ final int scrollY = mScrollY;
+ if (scrollX == 0 && scrollY == 0) {
+ buttonDrawable.draw(canvas);
+ } else {
+ canvas.translate(scrollX, scrollY);
+ buttonDrawable.draw(canvas);
+ canvas.translate(-scrollX, -scrollY);
+ }
}
}
diff --git a/core/res/res/layout/select_dialog_item_material.xml b/core/res/res/layout/select_dialog_item_material.xml
index 59b432e..fe326f3 100644
--- a/core/res/res/layout/select_dialog_item_material.xml
+++ b/core/res/res/layout/select_dialog_item_material.xml
@@ -28,6 +28,6 @@
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:textColor="?android:attr/textColorAlertDialogListItem"
android:gravity="center_vertical"
- android:paddingStart="16dip"
- android:paddingEnd="16dip"
+ android:paddingStart="@dimen/alert_dialog_padding_material"
+ android:paddingEnd="@dimen/alert_dialog_padding_material"
android:ellipsize="marquee" />
diff --git a/core/res/res/layout/select_dialog_multichoice_material.xml b/core/res/res/layout/select_dialog_multichoice_material.xml
index 01e4cfa..e5b5b62 100644
--- a/core/res/res/layout/select_dialog_multichoice_material.xml
+++ b/core/res/res/layout/select_dialog_multichoice_material.xml
@@ -23,8 +23,8 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorAlertDialogListItem"
android:gravity="center_vertical"
- android:paddingStart="16dip"
- android:paddingEnd="16dip"
+ android:paddingStart="@dimen/alert_dialog_padding_material"
+ android:paddingEnd="@dimen/alert_dialog_padding_material"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:checkMarkGravity="start"
android:ellipsize="marquee" />
diff --git a/core/res/res/layout/select_dialog_singlechoice_material.xml b/core/res/res/layout/select_dialog_singlechoice_material.xml
index 0f3c277..a9e603d 100644
--- a/core/res/res/layout/select_dialog_singlechoice_material.xml
+++ b/core/res/res/layout/select_dialog_singlechoice_material.xml
@@ -23,8 +23,8 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorAlertDialogListItem"
android:gravity="center_vertical"
- android:paddingStart="16dip"
- android:paddingEnd="16dip"
+ android:paddingStart="@dimen/alert_dialog_padding_material"
+ android:paddingEnd="@dimen/alert_dialog_padding_material"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:checkMarkGravity="start"
android:ellipsize="marquee" />