summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-05-21 23:37:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-21 23:40:07 +0000
commita22aa8806b571b7cf7aa3f1aaa9918988a2ccc31 (patch)
treea4c52b110af82e219ad05245de6a7faa3c9ed548 /graphics
parent7ec5b2e5a3da9c69df087311f4e480b45bfaf8c8 (diff)
parent53a3ed7c46c12c2e578d1b1df8b039c6db690eaa (diff)
downloadframeworks_base-a22aa8806b571b7cf7aa3f1aaa9918988a2ccc31.zip
frameworks_base-a22aa8806b571b7cf7aa3f1aaa9918988a2ccc31.tar.gz
frameworks_base-a22aa8806b571b7cf7aa3f1aaa9918988a2ccc31.tar.bz2
Merge "Clean up hotspot bounds API"
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/Drawable.java2
-rw-r--r--graphics/java/android/graphics/drawable/DrawableContainer.java7
-rw-r--r--graphics/java/android/graphics/drawable/InsetDrawable.java5
-rw-r--r--graphics/java/android/graphics/drawable/LayerDrawable.java9
-rw-r--r--graphics/java/android/graphics/drawable/RippleDrawable.java3
5 files changed, 22 insertions, 4 deletions
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java
index 3ef1d68..d6fb9e0 100644
--- a/graphics/java/android/graphics/drawable/Drawable.java
+++ b/graphics/java/android/graphics/drawable/Drawable.java
@@ -495,7 +495,7 @@ public abstract class Drawable {
/**
* Sets the bounds to which the hotspot is constrained, if they should be
* different from the drawable bounds.
- *
+ *
* @param left
* @param top
* @param right
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index ec5c6c6..04373d4 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -245,6 +245,13 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
}
@Override
+ public void setHotspotBounds(int left, int top, int right, int bottom) {
+ if (mCurrDrawable != null) {
+ mCurrDrawable.setHotspotBounds(left, top, right, bottom);
+ }
+ }
+
+ @Override
protected boolean onStateChange(int[] state) {
if (mLastDrawable != null) {
return mLastDrawable.setState(state);
diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java
index 3749339..2fa5929 100644
--- a/graphics/java/android/graphics/drawable/InsetDrawable.java
+++ b/graphics/java/android/graphics/drawable/InsetDrawable.java
@@ -192,6 +192,11 @@ public class InsetDrawable extends Drawable implements Drawable.Callback
}
@Override
+ public void setHotspotBounds(int left, int top, int right, int bottom) {
+ mInsetState.mDrawable.setHotspotBounds(left, top, right, bottom);
+ }
+
+ @Override
public boolean setVisible(boolean visible, boolean restart) {
mInsetState.mDrawable.setVisible(visible, restart);
return super.setVisible(visible, restart);
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java
index f446000..2e47d3a 100644
--- a/graphics/java/android/graphics/drawable/LayerDrawable.java
+++ b/graphics/java/android/graphics/drawable/LayerDrawable.java
@@ -571,6 +571,15 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
}
@Override
+ public void setHotspotBounds(int left, int top, int right, int bottom) {
+ final ChildDrawable[] array = mLayerState.mChildren;
+ final int N = mLayerState.mNum;
+ for (int i = 0; i < N; i++) {
+ array[i].mDrawable.setHotspotBounds(left, top, right, bottom);
+ }
+ }
+
+ @Override
public boolean setVisible(boolean visible, boolean restart) {
final boolean changed = super.setVisible(visible, restart);
final ChildDrawable[] array = mLayerState.mChildren;
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java
index 6776e66..add3d84 100644
--- a/graphics/java/android/graphics/drawable/RippleDrawable.java
+++ b/graphics/java/android/graphics/drawable/RippleDrawable.java
@@ -460,9 +460,6 @@ public class RippleDrawable extends LayerDrawable {
invalidateSelf();
}
- /**
- * @hide
- */
@Override
public void setHotspotBounds(int left, int top, int right, int bottom) {
mOverrideBounds = true;