summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-09-06 00:15:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-06 00:15:09 +0000
commit9ffe8c06e5baa730229fd5eaeaccb7ff8f8d9518 (patch)
treeeb42369e61181e39d2b6d7937fd254328759be79
parentbf7f53e29d8cb1de4d4b028002d3e157d89cbfe3 (diff)
parenta3e49a4b1df9c2a22b637af0833e0a813ecbd9b7 (diff)
downloadframeworks_base-9ffe8c06e5baa730229fd5eaeaccb7ff8f8d9518.zip
frameworks_base-9ffe8c06e5baa730229fd5eaeaccb7ff8f8d9518.tar.gz
frameworks_base-9ffe8c06e5baa730229fd5eaeaccb7ff8f8d9518.tar.bz2
Merge "Propagate drawable hotspots when duplicate parent state is enabled" into lmp-dev
-rw-r--r--core/java/android/view/ViewGroup.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index ac1b6a9..c1e66de 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -5724,6 +5724,28 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
@Override
+ public void drawableHotspotChanged(float x, float y) {
+ super.drawableHotspotChanged(x, y);
+
+ if ((mGroupFlags & FLAG_NOTIFY_CHILDREN_ON_DRAWABLE_STATE_CHANGE) != 0) {
+ if ((mGroupFlags & FLAG_ADD_STATES_FROM_CHILDREN) != 0) {
+ throw new IllegalStateException("addStateFromChildren cannot be enabled if a"
+ + " child has duplicateParentState set to true");
+ }
+
+ final View[] children = mChildren;
+ final int count = mChildrenCount;
+
+ for (int i = 0; i < count; i++) {
+ final View child = children[i];
+ if ((child.mViewFlags & DUPLICATE_PARENT_STATE) != 0) {
+ child.drawableHotspotChanged(x, y);
+ }
+ }
+ }
+ }
+
+ @Override
protected int[] onCreateDrawableState(int extraSpace) {
if ((mGroupFlags & FLAG_ADD_STATES_FROM_CHILDREN) == 0) {
return super.onCreateDrawableState(extraSpace);