Merge "Add consistent @NonNull annotations for drawable callbacks" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
79936ddda4
@@ -715,17 +715,17 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable2 {
|
||||
|
||||
private final Callback mCallback = new Callback() {
|
||||
@Override
|
||||
public void invalidateDrawable(Drawable who) {
|
||||
public void invalidateDrawable(@NonNull Drawable who) {
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleDrawable(Drawable who, Runnable what, long when) {
|
||||
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
|
||||
scheduleSelf(what, when);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unscheduleDrawable(Drawable who, Runnable what) {
|
||||
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
|
||||
unscheduleSelf(what);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -308,7 +308,7 @@ public abstract class Drawable {
|
||||
* to supply your implementation of the interface to the drawable; it uses
|
||||
* this interface to schedule and execute animation changes.
|
||||
*/
|
||||
public static interface Callback {
|
||||
public interface Callback {
|
||||
/**
|
||||
* Called when the drawable needs to be redrawn. A view at this point
|
||||
* should invalidate itself (or at least the part of itself where the
|
||||
@@ -316,7 +316,7 @@ public abstract class Drawable {
|
||||
*
|
||||
* @param who The drawable that is requesting the update.
|
||||
*/
|
||||
public void invalidateDrawable(Drawable who);
|
||||
void invalidateDrawable(@NonNull Drawable who);
|
||||
|
||||
/**
|
||||
* A Drawable can call this to schedule the next frame of its
|
||||
@@ -330,7 +330,7 @@ public abstract class Drawable {
|
||||
* @param when The time (in milliseconds) to run. The timebase is
|
||||
* {@link android.os.SystemClock#uptimeMillis}
|
||||
*/
|
||||
public void scheduleDrawable(Drawable who, Runnable what, long when);
|
||||
void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when);
|
||||
|
||||
/**
|
||||
* A Drawable can call this to unschedule an action previously
|
||||
@@ -342,7 +342,7 @@ public abstract class Drawable {
|
||||
* @param who The drawable being unscheduled.
|
||||
* @param what The action being unscheduled.
|
||||
*/
|
||||
public void unscheduleDrawable(Drawable who, Runnable what);
|
||||
void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -373,21 +373,21 @@ public class DrawableContainer extends Drawable implements Drawable.Callback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateDrawable(Drawable who) {
|
||||
public void invalidateDrawable(@NonNull Drawable who) {
|
||||
if (who == mCurrDrawable && getCallback() != null) {
|
||||
getCallback().invalidateDrawable(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleDrawable(Drawable who, Runnable what, long when) {
|
||||
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
|
||||
if (who == mCurrDrawable && getCallback() != null) {
|
||||
getCallback().scheduleDrawable(this, what, when);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unscheduleDrawable(Drawable who, Runnable what) {
|
||||
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
|
||||
if (who == mCurrDrawable && getCallback() != null) {
|
||||
getCallback().unscheduleDrawable(this, what);
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateDrawable(Drawable who) {
|
||||
public void invalidateDrawable(@NonNull Drawable who) {
|
||||
final Callback callback = getCallback();
|
||||
if (callback != null) {
|
||||
callback.invalidateDrawable(this);
|
||||
@@ -206,7 +206,7 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleDrawable(Drawable who, Runnable what, long when) {
|
||||
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
|
||||
final Callback callback = getCallback();
|
||||
if (callback != null) {
|
||||
callback.scheduleDrawable(this, what, when);
|
||||
@@ -214,7 +214,7 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unscheduleDrawable(Drawable who, Runnable what) {
|
||||
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
|
||||
final Callback callback = getCallback();
|
||||
if (callback != null) {
|
||||
callback.unscheduleDrawable(this, what);
|
||||
|
||||
@@ -944,17 +944,17 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateDrawable(Drawable who) {
|
||||
public void invalidateDrawable(@NonNull Drawable who) {
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleDrawable(Drawable who, Runnable what, long when) {
|
||||
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
|
||||
scheduleSelf(what, when);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unscheduleDrawable(Drawable who, Runnable what) {
|
||||
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
|
||||
unscheduleSelf(what);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user