Merge "Make Drawable hotspot APIs public"
This commit is contained in:
committed by
Android (Google) Code Review
commit
2989c2cb5c
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -322,10 +322,6 @@ public class VectorDrawable extends Drawable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Not implemented yet
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
// TODO: support color filter
|
||||
|
||||
Reference in New Issue
Block a user