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

Commit dfa4646e authored by Alan Viverette's avatar Alan Viverette
Browse files

API Review: Drawable

Renames boolean getters to isZzz(), callback from onChange to onChanged.

Bug: 21342040
Change-Id: I9700d645453354b608fd97a832359211d828b52f
parent bcbe9ba0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -12255,7 +12255,6 @@ package android.graphics.drawable {
    method public android.graphics.drawable.Drawable getCurrent();
    method public android.graphics.Rect getDirtyBounds();
    method public boolean getDither();
    method public boolean getFilterBitmap();
    method public void getHotspotBounds(android.graphics.Rect);
    method public int getIntrinsicHeight();
    method public int getIntrinsicWidth();
@@ -12272,12 +12271,13 @@ package android.graphics.drawable {
    method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void invalidateSelf();
    method public boolean isAutoMirrored();
    method public boolean isFilterBitmap();
    method public boolean isStateful();
    method public final boolean isVisible();
    method public void jumpToCurrentState();
    method public android.graphics.drawable.Drawable mutate();
    method protected void onBoundsChange(android.graphics.Rect);
    method public boolean onLayoutDirectionChange(int);
    method public boolean onLayoutDirectionChanged(int);
    method protected boolean onLevelChange(int);
    method protected boolean onStateChange(int[]);
    method public static int resolveOpacity(int, int);
+2 −2
Original line number Diff line number Diff line
@@ -12562,7 +12562,6 @@ package android.graphics.drawable {
    method public android.graphics.drawable.Drawable getCurrent();
    method public android.graphics.Rect getDirtyBounds();
    method public boolean getDither();
    method public boolean getFilterBitmap();
    method public void getHotspotBounds(android.graphics.Rect);
    method public int getIntrinsicHeight();
    method public int getIntrinsicWidth();
@@ -12579,12 +12578,13 @@ package android.graphics.drawable {
    method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void invalidateSelf();
    method public boolean isAutoMirrored();
    method public boolean isFilterBitmap();
    method public boolean isStateful();
    method public final boolean isVisible();
    method public void jumpToCurrentState();
    method public android.graphics.drawable.Drawable mutate();
    method protected void onBoundsChange(android.graphics.Rect);
    method public boolean onLayoutDirectionChange(int);
    method public boolean onLayoutDirectionChanged(int);
    method protected boolean onLevelChange(int);
    method protected boolean onStateChange(int[]);
    method public static int resolveOpacity(int, int);
+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.graphics.Rect;
import android.util.ArrayMap;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import com.android.internal.R;

@@ -200,7 +201,7 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
    }

    @Override
    public boolean onLayoutDirectionChange(int layoutDirection) {
    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
        return mAnimatedVectorState.mVectorDrawable.setLayoutDirection(layoutDirection);
    }

+4 −4
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ public abstract class Drawable {
    public void setDither(boolean dither) {}

    /**
     * @return whether this drawable dither its colors
     * @return whether this drawable dithers its colors
     * @see #setDither(boolean)
     */
    public boolean getDither() {
@@ -295,7 +295,7 @@ public abstract class Drawable {
     * @return whether this drawable filters its bitmap
     * @see #setFilterBitmap(boolean)
     */
    public boolean getFilterBitmap() {
    public boolean isFilterBitmap() {
        return false;
    }

@@ -444,7 +444,7 @@ public abstract class Drawable {
    public final boolean setLayoutDirection(@View.ResolvedLayoutDir int layoutDirection) {
        if (mLayoutDirection != layoutDirection) {
            mLayoutDirection = layoutDirection;
            return onLayoutDirectionChange(layoutDirection);
            return onLayoutDirectionChanged(layoutDirection);
        }
        return false;
    }
@@ -457,7 +457,7 @@ public abstract class Drawable {
     *         the drawable to change and it needs to be re-drawn
     * @see #setLayoutDirection(int)
     */
    public boolean onLayoutDirectionChange(@View.ResolvedLayoutDir int layoutDirection) {
    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
        return false;
    }

+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.graphics.PorterDuff.Mode;
import android.os.SystemClock;
import android.util.LayoutDirection;
import android.util.SparseArray;
import android.view.View;

import java.util.Collection;

@@ -337,7 +338,7 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
    }

    @Override
    public boolean onLayoutDirectionChange(int layoutDirection) {
    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
        // Let the container handle setting its own layout direction. Otherwise,
        // we're accessing potentially unused states.
        return mDrawableContainerState.setLayoutDirection(layoutDirection, getCurrentIndex());
Loading