本文整理匯總了Java中com.bilibili.boxing.loader.IBoxingCallback類的典型用法代碼示例。如果您正苦於以下問題:Java IBoxingCallback類的具體用法?Java IBoxingCallback怎麽用?Java IBoxingCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IBoxingCallback類屬於com.bilibili.boxing.loader包,在下文中一共展示了IBoxingCallback類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: displayRaw
import com.bilibili.boxing.loader.IBoxingCallback; //導入依賴的package包/類
@Override
public void displayRaw(@NonNull ImageView img, @NonNull String absPath, int width, int height, final IBoxingCallback callback) {
String path = "file://" + absPath;
RequestCreator creator = Picasso.with(img.getContext())
.load(path);
if (width > 0 && height > 0) {
creator.transform(new BitmapTransform(width, height));
}
creator.into(img, new Callback() {
@Override
public void onSuccess() {
if (callback != null) {
callback.onSuccess();
}
}
@Override
public void onError() {
if (callback != null) {
callback.onFail(null);
}
}
});
}
示例2: displayRaw
import com.bilibili.boxing.loader.IBoxingCallback; //導入依賴的package包/類
@Override
public void displayRaw(@NonNull ImageView img, @NonNull String absPath, int width, int height, IBoxingCallback callback) {
absPath = "file://" + absPath;
ImageRequestBuilder requestBuilder = ImageRequestBuilder.newBuilderWithSource(Uri.parse(absPath));
if (width > 0 && height > 0) {
requestBuilder.setResizeOptions(new ResizeOptions(width, height));
}
ImageRequest request = requestBuilder.build();
loadImage(request, img, callback);
}
示例3: displayRaw
import com.bilibili.boxing.loader.IBoxingCallback; //導入依賴的package包/類
public void displayRaw(@NonNull ImageView img, @NonNull String path, int width, int height, IBoxingCallback callback) {
if (ensureLoader()) {
throw new IllegalStateException("init method should be called first");
}
mLoader.displayRaw(img, path, width, height, callback);
}
示例4: loadRawImage
import com.bilibili.boxing.loader.IBoxingCallback; //導入依賴的package包/類
public final void loadRawImage(@NonNull ImageView img, @NonNull String path, int width, int height, IBoxingCallback callback) {
BoxingMediaLoader.getInstance().displayRaw(img, path, width, height, callback);
}