本文整理汇总了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);
}