@Test public void testScheduleDrawable() { simpleMultiCallback.addView(view); drawable.setCallback(simpleMultiCallback); drawable.scheduleSelf(action, 0); verify(view).scheduleDrawable(drawable, action, 0); }
@Override public void scheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what, final long when) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.scheduleDrawable(who, what, when); } else { mCallbacks.remove(reference); } } }
MultiCallback implements Callback { @Override public void scheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what, final long when) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.scheduleDrawable(who, what, when); } else { mCallbacks.remove(reference); } } } }
MultiCallback implements Callback { @Override public void scheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what, final long when) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.scheduleDrawable(who, what, when); } else { mCallbacks.remove(reference); } } } MultiCallback();  MultiCallback(final boolean useViewInvalidate); }
MultiCallback implements Callback { @Override public void scheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what, final long when) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.scheduleDrawable(who, what, when); } 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 scheduleDrawable(@NonNull final Drawable who, @NonNull final Runnable what, final long when) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { callback.scheduleDrawable(who, what, when); } 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);  }