Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 860126b7 authored by Alan Viverette's avatar Alan Viverette
Browse files

Make Drawable hotspot APIs public

Change-Id: I8377ed735f73f7083636947aa08a5427f1dc3bf6
parent 9e0ca634
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -10635,6 +10635,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);
@@ -10677,6 +10678,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);
@@ -10689,9 +10691,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);
  }
+13 −14
Original line number Diff line number Diff line
@@ -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;
+0 −12
Original line number Diff line number Diff line
@@ -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();
+0 −12
Original line number Diff line number Diff line
@@ -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();
+0 −12
Original line number Diff line number Diff line
@@ -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;
Loading