@Test public void testUnscheduleDrawable() { simpleMultiCallback.addView(view); drawable.setCallback(simpleMultiCallback); drawable.unscheduleSelf(action); verify(view).unscheduleDrawable(drawable, action); }
@Override public void unscheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.unscheduleDrawable(who, what); } else { mCallbacks.remove(reference); } } }
MultiCallback implements Callback { @Override public void unscheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.unscheduleDrawable(who, what); } else { mCallbacks.remove(reference); } } } }
MultiCallback implements Callback { @Override public void unscheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.unscheduleDrawable(who, what); } else { mCallbacks.remove(reference); } } } MultiCallback();  MultiCallback(final boolean useViewInvalidate); }
MultiCallback implements Callback { @Override public void unscheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.unscheduleDrawable(who, what); } else { mCallbacks.remove(reference); } } } MultiCallback();  MultiCallback(final boolean useViewInvalidate); @Override void invalidateDrawable(@NonNull final Drawable who); @Override void scheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what, final long when); @Override void unscheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what); void addView(final Callback callback); void removeView(final Callback callback); }
MultiCallback implements Callback { @Override public void unscheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.unscheduleDrawable(who, what); } else { mCallbacks.remove(reference); } } } MultiCallback();  MultiCallback(final boolean useViewInvalidate); @Override void invalidateDrawable(@NonNull final Drawable who); @Override void scheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what, final long when); @Override void unscheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what); void addView(final Callback callback); void removeView(final Callback callback);  }