summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-04-08 16:37:19 -0700
committerAlan Viverette <alanv@google.com>2014-04-08 16:37:19 -0700
commit860126b78aa4d6e8db5208c7f96764a8556cf95f (patch)
tree0c8dda2b9bb8cd2ae647d0abee21316cb8c6759d /graphics/java
parent9e0ca634e2201c2f633f2e82b8c86fc689669e0b (diff)
downloadframeworks_base-860126b78aa4d6e8db5208c7f96764a8556cf95f.zip
frameworks_base-860126b78aa4d6e8db5208c7f96764a8556cf95f.tar.gz
frameworks_base-860126b78aa4d6e8db5208c7f96764a8556cf95f.tar.bz2
Make Drawable hotspot APIs public
Change-Id: I8377ed735f73f7083636947aa08a5427f1dc3bf6
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/drawable/Drawable.java27
-rw-r--r--graphics/java/android/graphics/drawable/DrawableWrapper.java12
-rw-r--r--graphics/java/android/graphics/drawable/InsetDrawable.java12
-rw-r--r--graphics/java/android/graphics/drawable/LayerDrawable.java12
-rw-r--r--graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java15
-rw-r--r--graphics/java/android/graphics/drawable/VectorDrawable.java4
6 files changed, 13 insertions, 69 deletions
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java
index 1760458..077db7a 100644
--- a/graphics/java/android/graphics/drawable/Drawable.java
+++ b/graphics/java/android/graphics/drawable/Drawable.java
@@ -485,14 +485,13 @@ public abstract class Drawable {
/**
* Indicates whether the drawable supports hotspots. Hotspots are uniquely
- * identifiable coordinates the may be added, updated and removed within the
+ * identifiable coordinates the may be added, updated and removed within a
* drawable.
*
* @return true if hotspots are supported
* @see #setHotspot(int, float, float)
* @see #removeHotspot(int)
* @see #clearHotspots()
- * @hide until hotspot APIs are finalized
*/
public boolean supportsHotspots() {
return false;
@@ -500,33 +499,33 @@ public abstract class Drawable {
/**
* Specifies a hotspot's location within the drawable.
+ * <p>
+ * The specified key should be an id declared in the resources of the
+ * application to ensure it is unique (see the <a
+ * href={@docRoot}guide/topics/resources/more-resources.html#Id">ID resource type</a>).
*
- * @param id unique identifier for the hotspot
- * @param x x-coordinate
- * @param y y-coordinate
- * @hide until hotspot APIs are finalized
+ * @param key The key identifying the hotspot
+ * @param x The X coordinate of the center of the hotspot
+ * @param y The Y coordinate of the center of the hotspot
*/
- public void setHotspot(int id, float x, float y) {}
+ public void setHotspot(int key, float x, float y) {}
/**
- * Removes the specified hotspot from the drawable.
+ * Removes the hotspot with the specified key from the drawable.
*
- * @param id unique identifier for the hotspot
- * @hide until hotspot APIs are finalized
+ * @param key The key identifying the hotspot
*/
- public void removeHotspot(int id) {}
+ public void removeHotspot(int key) {}
/**
* Removes all hotspots from the drawable.
- *
- * @hide until hotspot APIs are finalized
*/
public void clearHotspots() {}
/**
* Whether this drawable requests projection.
*
- * @hide
+ * @hide until we finalize these APIs
*/
public boolean isProjected() {
return false;
diff --git a/graphics/java/android/graphics/drawable/DrawableWrapper.java b/graphics/java/android/graphics/drawable/DrawableWrapper.java
index 2eb7b90..6ab33f8 100644
--- a/graphics/java/android/graphics/drawable/DrawableWrapper.java
+++ b/graphics/java/android/graphics/drawable/DrawableWrapper.java
@@ -118,33 +118,21 @@ public class DrawableWrapper extends Drawable implements Drawable.Callback {
return mWrappedDrawable.getDirtyBounds();
}
- /**
- * @hide
- */
@Override
public boolean supportsHotspots() {
return mWrappedDrawable.supportsHotspots();
}
- /**
- * @hide
- */
@Override
public void setHotspot(int id, float x, float y) {
mWrappedDrawable.setHotspot(id, x, y);
}
- /**
- * @hide
- */
@Override
public void removeHotspot(int id) {
mWrappedDrawable.removeHotspot(id);
}
- /**
- * @hide
- */
@Override
public void clearHotspots() {
mWrappedDrawable.clearHotspots();
diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java
index 59a0c93..9384caf 100644
--- a/graphics/java/android/graphics/drawable/InsetDrawable.java
+++ b/graphics/java/android/graphics/drawable/InsetDrawable.java
@@ -183,33 +183,21 @@ public class InsetDrawable extends Drawable implements Drawable.Callback
}
}
- /**
- * @hide
- */
@Override
public boolean supportsHotspots() {
return mInsetState.mDrawable.supportsHotspots();
}
- /**
- * @hide
- */
@Override
public void setHotspot(int id, float x, float y) {
mInsetState.mDrawable.setHotspot(id, x, y);
}
- /**
- * @hide
- */
@Override
public void removeHotspot(int id) {
mInsetState.mDrawable.removeHotspot(id);
}
- /**
- * @hide
- */
@Override
public void clearHotspots() {
mInsetState.mDrawable.clearHotspots();
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java
index 52352c4..b366987 100644
--- a/graphics/java/android/graphics/drawable/LayerDrawable.java
+++ b/graphics/java/android/graphics/drawable/LayerDrawable.java
@@ -548,9 +548,6 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
}
}
- /**
- * @hide
- */
@Override
public boolean supportsHotspots() {
final ChildDrawable[] array = mLayerState.mChildren;
@@ -564,9 +561,6 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
return false;
}
- /**
- * @hide
- */
@Override
public void setHotspot(int id, float x, float y) {
final ChildDrawable[] array = mLayerState.mChildren;
@@ -576,9 +570,6 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
}
}
- /**
- * @hide
- */
@Override
public void removeHotspot(int id) {
final ChildDrawable[] array = mLayerState.mChildren;
@@ -588,9 +579,6 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
}
}
- /**
- * @hide
- */
@Override
public void clearHotspots() {
final ChildDrawable[] array = mLayerState.mChildren;
diff --git a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java b/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java
index 1641511..3323a25 100644
--- a/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java
+++ b/graphics/java/android/graphics/drawable/TouchFeedbackDrawable.java
@@ -217,20 +217,11 @@ public class TouchFeedbackDrawable extends LayerDrawable {
return super.canApplyTheme() || mState != null && mState.mTouchThemeAttrs != null;
}
- /**
- * @hide until hotspot APIs are finalized
- */
@Override
public boolean supportsHotspots() {
return true;
}
- /**
- * TODO: Maybe we should set hotspots for state/id combinations? So touch
- * would be state_pressed and the pointer ID.
- *
- * @hide until hotspot APIs are finalized
- */
@Override
public void setHotspot(int id, float x, float y) {
if (mTouchedRipples == null) {
@@ -261,9 +252,6 @@ public class TouchFeedbackDrawable extends LayerDrawable {
scheduleAnimation();
}
- /**
- * @hide until hotspot APIs are finalized
- */
@Override
public void removeHotspot(int id) {
if (mTouchedRipples == null) {
@@ -279,9 +267,6 @@ public class TouchFeedbackDrawable extends LayerDrawable {
}
}
- /**
- * @hide until hotspot APIs are finalized
- */
@Override
public void clearHotspots() {
if (mTouchedRipples == null) {
diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java
index c505c0b..4b030c1 100644
--- a/graphics/java/android/graphics/drawable/VectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/VectorDrawable.java
@@ -322,10 +322,6 @@ public class VectorDrawable extends Drawable {
}
}
- /**
- * Not implemented yet
- * @hide
- */
@Override
public void setColorFilter(ColorFilter colorFilter) {
// TODO: support color filter