当前位置: 首页>>代码示例>>Java>>正文


Java Callback类代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:panpf,项目名称:sketch,代码行数:18,代码来源:MultiCallback.java

示例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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:9,代码来源:MaterialProgressDrawable.java

示例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);
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:31,代码来源:AnimatedVectorDrawableCompat.java

示例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++;
            }
        }
    }
}
 
开发者ID:Qwaz,项目名称:solved-hacking-problem,代码行数:33,代码来源:C0004d.java

示例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);
  }
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:8,代码来源:ChipDrawable.java

示例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);
  }
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:8,代码来源:ChipDrawable.java

示例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);
  }
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:8,代码来源:ChipDrawable.java

示例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);
}
 
开发者ID:netguru,项目名称:inbbbox-android,代码行数:9,代码来源:AnimationDrawableCallback.java

示例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);
    }
}
 
开发者ID:netguru,项目名称:inbbbox-android,代码行数:8,代码来源:AnimationDrawableCallback.java

示例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);
    }
}
 
开发者ID:netguru,项目名称:inbbbox-android,代码行数:8,代码来源:AnimationDrawableCallback.java

示例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);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:10,代码来源:MaterialProgressDrawable.java

示例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;
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:16,代码来源:EmojiProvider.java

示例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);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:dq.java

示例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);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:dq.java

示例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);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:10,代码来源:dq.java


注:本文中的android.graphics.drawable.Drawable.Callback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。