本文整理汇总了Java中android.graphics.drawable.Drawable.Callback类的典型用法代码示例。如果您正苦于以下问题:Java Callback类的具体用法?Java Callback怎么用?Java Callback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Callback类属于android.graphics.drawable.Drawable包,在下文中一共展示了Callback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invalidateDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
@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);
}
}
}
示例2: Ring
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
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);
}
示例3: AnimatedVectorDrawableCompatState
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
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);
}
}
}
}
示例4: C0004d
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
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++;
}
}
}
}
示例5: invalidateDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
@Override
public void invalidateDrawable(@NonNull Drawable who) {
Callback callback = getCallback();
if (callback != null) {
callback.invalidateDrawable(this);
}
}
示例6: scheduleDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
@Override
public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
Callback callback = getCallback();
if (callback != null) {
callback.scheduleDrawable(this, what, when);
}
}
示例7: unscheduleDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
@Override
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
Callback callback = getCallback();
if (callback != null) {
callback.unscheduleDrawable(this, what);
}
}
示例8: invalidateDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
@Override
public void invalidateDrawable(@NonNull Drawable who) {
final Callback callback = callbackWeakReference.get();
if (callback != null) {
callback.invalidateDrawable(who);
}
checkCanFinishAnimation(who);
}
示例9: scheduleDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
@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);
}
}
示例10: unscheduleDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
@Override
public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
final Callback callback = callbackWeakReference.get();
if (callback != null) {
callback.unscheduleDrawable(who, what);
}
}
示例11: Ring
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
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);
}
示例12: emojify
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
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;
}
示例13: invalidateDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
public final void invalidateDrawable(Drawable paramDrawable)
{
if (fg.cD())
{
Drawable.Callback localCallback = getCallback();
if (localCallback != null)
localCallback.invalidateDrawable(this);
}
}
示例14: scheduleDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
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);
}
}
示例15: unscheduleDrawable
import android.graphics.drawable.Drawable.Callback; //导入依赖的package包/类
public final void unscheduleDrawable(Drawable paramDrawable, Runnable paramRunnable)
{
if (fg.cD())
{
Drawable.Callback localCallback = getCallback();
if (localCallback != null)
localCallback.unscheduleDrawable(this, paramRunnable);
}
}