當前位置: 首頁>>代碼示例>>Java>>正文


Java Drawable.Callback方法代碼示例

本文整理匯總了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);
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:22,代碼來源:ImageAssetBitmapManager.java

示例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);
    }
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:DrawableUtils.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:SettableDrawableTest.java

示例4: setCallback

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
void setCallback(Drawable.Callback callback) {
    this.mCallback = callback;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:LoadingRenderer.java

示例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));
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:GenericDraweeHierarchyTest.java

示例6: setCallback

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
void setCallback(Drawable.Callback paramCallback); 
開發者ID:junchenChow,項目名稱:exciting-app,代碼行數:2,代碼來源:FeatherDrawable.java

示例7: setCallback

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public void setCallback(Drawable.Callback paramCallback); 
開發者ID:Sherchen,項目名稱:AnimationsDemo,代碼行數:2,代碼來源:FeatherDrawable.java


注:本文中的android.graphics.drawable.Drawable.Callback方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。