diff options
| author | Alan Viverette <alanv@google.com> | 2014-04-08 23:38:22 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-08 23:38:23 +0000 |
| commit | 2989c2cb5c649a0035db18f5f7f25ae5c34d2721 (patch) | |
| tree | b8de1b23bc2c3171b97c4600e15f4c2751f0f817 | |
| parent | 733217e6768757c50e1ac38644c2ecdbe522e8f5 (diff) | |
| parent | 860126b78aa4d6e8db5208c7f96764a8556cf95f (diff) | |
| download | frameworks_base-2989c2cb5c649a0035db18f5f7f25ae5c34d2721.zip frameworks_base-2989c2cb5c649a0035db18f5f7f25ae5c34d2721.tar.gz frameworks_base-2989c2cb5c649a0035db18f5f7f25ae5c34d2721.tar.bz2 | |
Merge "Make Drawable hotspot APIs public"
7 files changed, 17 insertions, 69 deletions
diff --git a/api/current.txt b/api/current.txt index de8cf53..0029973 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10662,6 +10662,7 @@ package android.graphics.drawable { method public void applyTheme(android.content.res.Resources.Theme); method public boolean canApplyTheme(); method public void clearColorFilter(); + method public void clearHotspots(); method public final void copyBounds(android.graphics.Rect); method public final android.graphics.Rect copyBounds(); method public static android.graphics.drawable.Drawable createFromPath(java.lang.String); @@ -10704,6 +10705,7 @@ package android.graphics.drawable { method protected void onBoundsChange(android.graphics.Rect); method protected boolean onLevelChange(int); method protected boolean onStateChange(int[]); + method public void removeHotspot(int); method public static int resolveOpacity(int, int); method public void scheduleSelf(java.lang.Runnable, long); method public abstract void setAlpha(int); @@ -10716,9 +10718,11 @@ package android.graphics.drawable { method public void setColorFilter(int, android.graphics.PorterDuff.Mode); method public void setDither(boolean); method public void setFilterBitmap(boolean); + method public void setHotspot(int, float, float); method public final boolean setLevel(int); method public boolean setState(int[]); method public boolean setVisible(boolean, boolean); + method public boolean supportsHotspots(); method public void unscheduleSelf(java.lang.Runnable); } 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 |
