private void refreshAction() { Glide.get(getContext()).clearMemory(); preferences.removeCache(getDateFromArguments()); if (this.loadTask == null || this.loadTask.getStatus() != Status.PENDING) { this.loadTask = new GetStripUrl(getStripURIlListener, preferences, getDateFromArguments(), progress); } this.loadTask.execute(); }
public PostAdapterDelegate(Activity activity, int viewType) { super(viewType); App.getAppComponent(activity).inject(this); mLayoutInflater = activity.getLayoutInflater(); // loading avatars is prior to images in replies mAvatarRequestBuilder = Glide.with(activity) .from(String.class) .error(R.drawable.ic_avatar_placeholder) .priority(Priority.HIGH) .transform(new CenterCrop(Glide.get(activity).getBitmapPool())); }
public GifFrameManager( Context context, GifDecoder decoder, Transformation<Bitmap> transformation, int targetWidth, int targetHeight) { this( context, Glide.get(context).getBitmapPool(), decoder, new Handler(Looper.getMainLooper()), transformation, targetWidth, targetHeight); }
@Override public void onActivityDestroyed(Activity activity) { Glide.get(activity).clearMemory(); }
@Override protected void setup(Context context, BaasBox box, Options.Empty empty) { Glide glide = Glide.get(context); glide.register(BaasFile.class, InputStream.class, new BaasFileModelLoader.Factory()); glide.register(BaasAssetId.class, InputStream.class, new BaasAssetModelLoader.Factory()); }
public static void clearCache(Context context) { Glide.get(context).clearMemory(); // 这个必须在主线程中运行 Glide.get(context).clearDiskCache(); }
public CropSquareTransformation(Context context) { this(Glide.get(context).getBitmapPool()); }