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

Commit 53a3ed7c authored by Alan Viverette's avatar Alan Viverette
Browse files

Clean up hotspot bounds API

Change-Id: I7daf7e2d360d761f673aa69a0f925b8076ab19c6
parent 17dafdc8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -244,6 +244,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) {
+5 −0
Original line number Diff line number Diff line
@@ -191,6 +191,11 @@ public class InsetDrawable extends Drawable implements Drawable.Callback
        mInsetState.mDrawable.setHotspot(x, y);
    }

    @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);
+9 −0
Original line number Diff line number Diff line
@@ -570,6 +570,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);
+0 −3
Original line number Diff line number Diff line
@@ -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;
+1 −1

File changed.

Contains only whitespace changes.