Esempio n. 1
0
 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();
 }
Esempio n. 2
0
  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()));
  }
Esempio n. 3
0
 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();
 }
Esempio n. 5
0
 @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());
 }
Esempio n. 6
0
 public static void clearCache(Context context) {
   Glide.get(context).clearMemory(); // 这个必须在主线程中运行
   Glide.get(context).clearDiskCache();
 }
 public CropSquareTransformation(Context context) {
   this(Glide.get(context).getBitmapPool());
 }