本文整理匯總了Java中android.graphics.drawable.Drawable.Callback方法的典型用法代碼示例。如果您正苦於以下問題:Java Drawable.Callback方法的具體用法?Java Drawable.Callback怎麽用?Java Drawable.Callback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.graphics.drawable.Drawable
的用法示例。
在下文中一共展示了Drawable.Callback方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ImageAssetBitmapManager
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
ImageAssetBitmapManager(Drawable.Callback callback, String imagesFolder,
ImageAssetDelegate assetDelegate, Map<String, LottieImageAsset> imageAssets) {
assertNotNull(callback);
this.imagesFolder = imagesFolder;
if (!TextUtils.isEmpty(imagesFolder) &&
this.imagesFolder.charAt(this.imagesFolder.length() - 1) != '/') {
this.imagesFolder += '/';
}
if (!(callback instanceof View)) {
Log.w(L.TAG, "LottieDrawable must be inside of a view for images to work.");
this.imageAssets = new HashMap<>();
context = null;
return;
}
context = ((View) callback).getContext();
this.imageAssets = imageAssets;
setAssetDelegate(assetDelegate);
}
示例2: setCallbacks
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
/**
* Sets callback to the drawable.
* @param drawable drawable to set callbacks to
* @param callback standard Android Drawable.Callback
* @param transformCallback TransformCallback used by TransformAwareDrawables
*/
public static void setCallbacks(
Drawable drawable,
@Nullable Drawable.Callback callback,
@Nullable TransformCallback transformCallback) {
if (drawable != null) {
drawable.setCallback(callback);
if (drawable instanceof TransformAwareDrawable) {
((TransformAwareDrawable) drawable).setTransformCallback(transformCallback);
}
}
}
示例3: testSetCurrent
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@Test
public void testSetCurrent() {
Drawable.Callback callback = mock(Drawable.Callback.class);
mSettableDrawable.setCallback(callback);
mSettableDrawable.setDrawable(mUnderlyingDrawable1);
verify(mUnderlyingDrawable0).setCallback(null);
verify(mUnderlyingDrawable1).setCallback(isNotNull(Drawable.Callback.class));
verify(callback).invalidateDrawable(mSettableDrawable);
}
示例4: setCallback
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
void setCallback(Drawable.Callback callback) {
this.mCallback = callback;
}
示例5: verifyCallback
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private void verifyCallback(Drawable parent, Drawable child) {
Drawable.Callback callback = mock(Drawable.Callback.class);
parent.setCallback(callback);
child.invalidateSelf();
verify(callback).invalidateDrawable(any(Drawable.class));
}
示例6: setCallback
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
void setCallback(Drawable.Callback paramCallback);
示例7: setCallback
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public void setCallback(Drawable.Callback paramCallback);