Java 类android.graphics.drawable.Drawable.Callback 实例源码

项目:sketch    文件:MultiCallback.java   
@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);
        }
    }
}
项目:letv    文件:MaterialProgressDrawable.java   
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);
}
项目:boohee_v5.6    文件:AnimatedVectorDrawableCompat.java   
public AnimatedVectorDrawableCompatState(Context context, AnimatedVectorDrawableCompatState copy, Callback owner, Resources res) {
    if (copy != null) {
        this.mChangingConfigurations = copy.mChangingConfigurations;
        if (copy.mVectorDrawable != null) {
            ConstantState cs = copy.mVectorDrawable.getConstantState();
            if (res != null) {
                this.mVectorDrawable = (VectorDrawableCompat) cs.newDrawable(res);
            } else {
                this.mVectorDrawable = (VectorDrawableCompat) cs.newDrawable();
            }
            this.mVectorDrawable = (VectorDrawableCompat) this.mVectorDrawable.mutate();
            this.mVectorDrawable.setCallback(owner);
            this.mVectorDrawable.setBounds(copy.mVectorDrawable.getBounds());
            this.mVectorDrawable.setAllowCaching(false);
        }
        if (copy.mAnimators != null) {
            int numAnimators = copy.mAnimators.size();
            this.mAnimators = new ArrayList(numAnimators);
            this.mTargetNameMap = new ArrayMap(numAnimators);
            for (int i = 0; i < numAnimators; i++) {
                Animator anim = (Animator) copy.mAnimators.get(i);
                Animator animClone = anim.clone();
                String targetName = (String) copy.mTargetNameMap.get(anim);
                animClone.setTarget(this.mVectorDrawable.getTargetByName(targetName));
                this.mAnimators.add(animClone);
                this.mTargetNameMap.put(animClone, targetName);
            }
        }
    }
}
项目:boohee_v5.6    文件:MaterialProgressDrawable.java   
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);
}
项目:solved-hacking-problem    文件:C0004d.java   
public C0004d(Context context, C0004d c0004d, Callback callback, Resources resources) {
    int i = 0;
    if (c0004d != null) {
        this.f12a = c0004d.f12a;
        if (c0004d.f13b != null) {
            ConstantState constantState = c0004d.f13b.getConstantState();
            if (resources != null) {
                this.f13b = (C0011l) constantState.newDrawable(resources);
            } else {
                this.f13b = (C0011l) constantState.newDrawable();
            }
            this.f13b = (C0011l) this.f13b.mutate();
            this.f13b.setCallback(callback);
            this.f13b.setBounds(c0004d.f13b.getBounds());
            this.f13b.m34a(false);
        }
        if (c0004d.f14c != null) {
            int size = c0004d.f14c.size();
            this.f14c = new ArrayList(size);
            this.f15d = new C0107a(size);
            while (i < size) {
                Animator animator = (Animator) c0004d.f14c.get(i);
                Animator clone = animator.clone();
                String str = (String) c0004d.f15d.get(animator);
                clone.setTarget(this.f13b.m33a(str));
                this.f14c.add(clone);
                this.f15d.put(clone, str);
                i++;
            }
        }
    }
}
项目:solved-hacking-problem    文件:C0004d.java   
public C0004d(Context context, C0004d c0004d, Callback callback, Resources resources) {
    int i = 0;
    if (c0004d != null) {
        this.f12a = c0004d.f12a;
        if (c0004d.f13b != null) {
            ConstantState constantState = c0004d.f13b.getConstantState();
            if (resources != null) {
                this.f13b = (C0011l) constantState.newDrawable(resources);
            } else {
                this.f13b = (C0011l) constantState.newDrawable();
            }
            this.f13b = (C0011l) this.f13b.mutate();
            this.f13b.setCallback(callback);
            this.f13b.setBounds(c0004d.f13b.getBounds());
            this.f13b.m34a(false);
        }
        if (c0004d.f14c != null) {
            int size = c0004d.f14c.size();
            this.f14c = new ArrayList(size);
            this.f15d = new C0107a(size);
            while (i < size) {
                Animator animator = (Animator) c0004d.f14c.get(i);
                Animator clone = animator.clone();
                String str = (String) c0004d.f15d.get(animator);
                clone.setTarget(this.f13b.m33a(str));
                this.f14c.add(clone);
                this.f15d.put(clone, str);
                i++;
            }
        }
    }
}
项目:material-components-android    文件:ChipDrawable.java   
@Override
public void invalidateDrawable(@NonNull Drawable who) {
  Callback callback = getCallback();
  if (callback != null) {
    callback.invalidateDrawable(this);
  }
}
项目:material-components-android    文件:ChipDrawable.java   
@Override
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
  Callback callback = getCallback();
  if (callback != null) {
    callback.scheduleDrawable(this, what, when);
  }
}
项目:material-components-android    文件:ChipDrawable.java   
@Override
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
  Callback callback = getCallback();
  if (callback != null) {
    callback.unscheduleDrawable(this, what);
  }
}
项目:inbbbox-android    文件:AnimationDrawableCallback.java   
@Override
public void invalidateDrawable(@NonNull Drawable who) {
    final Callback callback = callbackWeakReference.get();
    if (callback != null) {
        callback.invalidateDrawable(who);
    }
    checkCanFinishAnimation(who);
}
项目:inbbbox-android    文件:AnimationDrawableCallback.java   
@Override
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
    final Callback callback = callbackWeakReference.get();
    if (callback != null) {
        callback.scheduleDrawable(who, what, when);
    }
}
项目:inbbbox-android    文件:AnimationDrawableCallback.java   
@Override
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
    final Callback callback = callbackWeakReference.get();
    if (callback != null) {
        callback.unscheduleDrawable(who, what);
    }
}
项目:FMTech    文件:MaterialProgressDrawable.java   
public Ring(Drawable.Callback paramCallback)
{
  this.mCallback = paramCallback;
  this.mPaint.setStrokeCap(Paint.Cap.SQUARE);
  this.mPaint.setAntiAlias(true);
  this.mPaint.setStyle(Paint.Style.STROKE);
  this.mArrowPaint.setStyle(Paint.Style.FILL);
  this.mArrowPaint.setAntiAlias(true);
}
项目:TextSecureSMP    文件:EmojiProvider.java   
public Spannable emojify(CharSequence text, Callback callback) {
  Matcher                matches = EMOJI_RANGE.matcher(text);
  SpannableStringBuilder builder = new SpannableStringBuilder(text);

  while (matches.find()) {
    int codePoint = matches.group().codePointAt(0);
    Drawable drawable = getEmojiDrawable(codePoint, EMOJI_SMALL);
    if (drawable != null) {
      builder.setSpan(new InvalidatingDrawableSpan(drawable, callback), matches.start(), matches.end(),
                      Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    }
  }

  return builder;
}
项目:QuizUpWinner    文件:dq.java   
public final void invalidateDrawable(Drawable paramDrawable)
{
  if (fg.cD())
  {
    Drawable.Callback localCallback = getCallback();
    if (localCallback != null)
      localCallback.invalidateDrawable(this);
  }
}
项目:QuizUpWinner    文件:dq.java   
public final void scheduleDrawable(Drawable paramDrawable, Runnable paramRunnable, long paramLong)
{
  if (fg.cD())
  {
    Drawable.Callback localCallback = getCallback();
    if (localCallback != null)
      localCallback.scheduleDrawable(this, paramRunnable, paramLong);
  }
}
项目:QuizUpWinner    文件:dq.java   
public final void unscheduleDrawable(Drawable paramDrawable, Runnable paramRunnable)
{
  if (fg.cD())
  {
    Drawable.Callback localCallback = getCallback();
    if (localCallback != null)
      localCallback.unscheduleDrawable(this, paramRunnable);
  }
}
项目:sketch    文件:MultiCallback.java   
@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);
        }
    }
}
项目:sketch    文件:MultiCallback.java   
@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);
        }
    }
}
项目:sketch    文件:MultiCallback.java   
/**
 * 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));
}
项目:sketch    文件:MultiCallback.java   
/**
 * 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);
        }
    }
}
项目:PeSanKita-android    文件:AnimatingImageSpan.java   
public AnimatingImageSpan(Drawable drawable, Callback callback) {
  super(drawable, ALIGN_BOTTOM);
  drawable.setCallback(callback);
}
项目:Nird2    文件:AnimatingImageSpan.java   
AnimatingImageSpan(Drawable drawable, Callback callback) {
    super(drawable, ALIGN_BOTTOM);
    drawable.setCallback(callback);
}
项目:Nird2    文件:AnimatingImageSpan.java   
AnimatingImageSpan(Drawable drawable, Callback callback) {
    super(drawable, ALIGN_BOTTOM);
    drawable.setCallback(callback);
}
项目:Cable-Android    文件:AnimatingImageSpan.java   
public AnimatingImageSpan(Drawable drawable, Callback callback) {
  super(drawable, ALIGN_BOTTOM);
  drawable.setCallback(callback);
}
项目:inbbbox-android    文件:AnimationDrawableCallback.java   
public AnimationDrawableCallback(AnimationDrawable animationDrawable, Callback callback) {
    lastFrameWeakReference = new WeakReference<>(
            animationDrawable.getFrame(animationDrawable.getNumberOfFrames() - 1));
    callbackWeakReference = new WeakReference<>(callback);
}
项目:TextSecureSMP    文件:InvalidatingDrawableSpan.java   
public InvalidatingDrawableSpan(Drawable drawable, Callback callback) {
  super(drawable, ALIGN_BOTTOM);
  drawable.setCallback(callback);
}
项目:Silence    文件:AnimatingImageSpan.java   
public AnimatingImageSpan(Drawable drawable, Callback callback) {
  super(drawable, ALIGN_BOTTOM);
  drawable.setCallback(callback);
}
项目:sketch    文件:MultiCallback.java   
CallbackWeakReference(final Callback r) {
    super(r);
}
项目:sketch    文件:MultiCallback.java   
@Override
public int hashCode() {
    final Callback callback = get();
    return callback != null ? callback.hashCode() : 0;
}
项目:flying-photo-booth    文件:CaptureFragment.java   
/**
 * Constructor.
 *
 * @param animationDrawable the {@link AnimationDrawable}.
 * @param callback          the client's {@link Callback} implementation. This is usually the {@link View} the has the
 *                          {@link AnimationDrawable} as background.
 */
public TakePictureAnimationDrawableCallback(AnimationDrawable animationDrawable, Callback callback) {
    super(animationDrawable, callback);
}
项目:flying-photo-booth    文件:AnimationDrawableCallback.java   
/**
 * Constructor.
 *
 * @param animationDrawable the {@link AnimationDrawable}.
 * @param callback          the client's {@link Callback} implementation. This is usually the {@link View} the has the
 *                          {@link AnimationDrawable} as background.
 */
public AnimationDrawableCallback(AnimationDrawable animationDrawable, Callback callback) {
    mTotalFrames = animationDrawable.getNumberOfFrames();
    mLastFrame = animationDrawable.getFrame(mTotalFrames - 1);
    mWrappedCallback = callback;
}