本文整理汇总了Java中com.bumptech.glide.request.FutureTarget.get方法的典型用法代码示例。如果您正苦于以下问题:Java FutureTarget.get方法的具体用法?Java FutureTarget.get怎么用?Java FutureTarget.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bumptech.glide.request.FutureTarget
的用法示例。
在下文中一共展示了FutureTarget.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.bumptech.glide.request.FutureTarget; //导入方法依赖的package包/类
public void run() {
for (int n = 0; n < original_list.size(); n++) {
//WORKAROUND TO PRE-CACHE ICONS
try {
FutureTarget<GlideDrawable> future = Glide
.with(context)
.load("http://onepiece-treasurecruise.com/wp-content/uploads/f" + convertID(n + 1) + ".png")
.dontTransform()
.override(thumbnail_width, thumbnail_height)
.diskCacheStrategy(DiskCacheStrategy.RESULT)
.into(thumbnail_width, thumbnail_height);
GlideDrawable cacheFile = future.get();
} catch (Exception e) {
Log.e("ERR", "Pic not found");
}
}
}
示例2: getImagePath
import com.bumptech.glide.request.FutureTarget; //导入方法依赖的package包/类
/**
* Glide 获得图片缓存路径
*/
private String getImagePath(String imgUrl) {
String path = null;
FutureTarget<File> future = Glide.with(ViewBigImageActivity.this)
.load(imgUrl)
.downloadOnly(500, 500);
try {
File cacheFile = future.get();
path = cacheFile.getAbsolutePath();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
return path;
}
示例3: getImagePath
import com.bumptech.glide.request.FutureTarget; //导入方法依赖的package包/类
/**
* Glide 获得图片缓存路径
*/
public static String getImagePath(String imgUrl) {
String path = null;
FutureTarget<File> future = Glide.with(VideoApplication.getInstance())
.load(imgUrl)
.downloadOnly(500, 500);
try {
File cacheFile = future.get();
path = cacheFile.getAbsolutePath();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
return path;
}
示例4: getAvatarFile
import com.bumptech.glide.request.FutureTarget; //导入方法依赖的package包/类
public static File getAvatarFile(Context ctx, String avatarUrl) {
File f = null;
try {
FutureTarget<File> future = Glide.with(ctx)
.load(avatarUrl)
.downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL);
f = future.get();
Glide.clear(future);
} catch (Exception e) {
Logger.e(e);
}
return f;
}