android.graphics.drawable.Drawable.Callback Java Examples
The following examples show how to use
android.graphics.drawable.Drawable.Callback.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultiCallback.java From sketch with Apache License 2.0 | 6 votes |
@Override public void invalidateDrawable(@NonNull final Drawable who) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback callback = reference.get(); if (callback != null) { if (mUseViewInvalidate && callback instanceof View) { ((View) callback).invalidate(); } else { callback.invalidateDrawable(who); } } else { // Always remove null references to reduce list size mCallbacks.remove(reference); } } }
Example #2
Source File: MaterialProgressDrawable.java From letv with Apache License 2.0 | 5 votes |
public Ring(Callback callback) { this.mCallback = callback; this.mPaint.setStrokeCap(Cap.SQUARE); this.mPaint.setAntiAlias(true); this.mPaint.setStyle(Style.STROKE); this.mArrowPaint.setStyle(Style.FILL); this.mArrowPaint.setAntiAlias(true); }
Example #3
Source File: ChipDrawable.java From material-components-android with Apache License 2.0 | 5 votes |
@Override public void invalidateDrawable(@NonNull Drawable who) { Callback callback = getCallback(); if (callback != null) { callback.invalidateDrawable(this); } }
Example #4
Source File: ChipDrawable.java From material-components-android with Apache License 2.0 | 5 votes |
@Override public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) { Callback callback = getCallback(); if (callback != null) { callback.scheduleDrawable(this, what, when); } }
Example #5
Source File: ChipDrawable.java From material-components-android with Apache License 2.0 | 5 votes |
@Override public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) { Callback callback = getCallback(); if (callback != null) { callback.unscheduleDrawable(this, what); } }
Example #6
Source File: MultiCallback.java From sketch with Apache License 2.0 | 5 votes |
@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 { // Always remove null references to reduce Set size mCallbacks.remove(reference); } } }
Example #7
Source File: MultiCallback.java From sketch with Apache License 2.0 | 5 votes |
@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 { // Always remove null references to reduce list size mCallbacks.remove(reference); } } }
Example #8
Source File: MultiCallback.java From sketch with Apache License 2.0 | 5 votes |
/** * Associates given {@link Callback}. If callback has been already added, nothing happens. * * @param callback Callback to be associated */ public void addView(final Callback callback) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback item = reference.get(); if (item == null) { // Always remove null references to reduce list size mCallbacks.remove(reference); } } mCallbacks.addIfAbsent(new CallbackWeakReference(callback)); }
Example #9
Source File: MultiCallback.java From sketch with Apache License 2.0 | 5 votes |
/** * Disassociates given {@link Callback}. If callback is not associated, nothing happens. * * @param callback Callback to be disassociated */ public void removeView(final Callback callback) { for (int i = 0; i < mCallbacks.size(); i++) { final CallbackWeakReference reference = mCallbacks.get(i); final Callback item = reference.get(); if (item == null || item == callback) { // Always remove null references to reduce list size mCallbacks.remove(reference); } } }
Example #10
Source File: AnimatingImageSpan.java From mollyim-android with GNU General Public License v3.0 | 4 votes |
public AnimatingImageSpan(Drawable drawable, Callback callback) { super(drawable, ALIGN_BOTTOM); drawable.setCallback(callback); }
Example #11
Source File: AnimatingImageSpan.java From bcm-android with GNU General Public License v3.0 | 4 votes |
public AnimatingImageSpan(Drawable drawable, Callback callback) { super(drawable, ALIGN_BOTTOM); drawable.setCallback(callback); }
Example #12
Source File: AnimatingImageSpan.java From deltachat-android with GNU General Public License v3.0 | 4 votes |
public AnimatingImageSpan(Drawable drawable, Callback callback) { super(drawable, ALIGN_BOTTOM); drawable.setCallback(callback); }
Example #13
Source File: AnimatingImageSpan.java From Silence with GNU General Public License v3.0 | 4 votes |
public AnimatingImageSpan(Drawable drawable, Callback callback) { super(drawable, ALIGN_BOTTOM); drawable.setCallback(callback); }
Example #14
Source File: MultiCallback.java From sketch with Apache License 2.0 | 4 votes |
CallbackWeakReference(final Callback r) { super(r); }
Example #15
Source File: MultiCallback.java From sketch with Apache License 2.0 | 4 votes |
@Override public int hashCode() { final Callback callback = get(); return callback != null ? callback.hashCode() : 0; }