Glide加载图片监听

对于有些大点的Gif在低端机上加载可能会需要点时间,所以我们可以加个回调加个弹框会友好点

   showPleaseDialog("加载中...");
                    Glide.with(getApplicationContext())
                            .load(GlobalPath
                                    .RES_IMAGE + template_images_preview[postion - 1])
                            .into(new GlideDrawableImageViewTarget(iv_preview) {

                                @Override
                                public void onResourceReady(GlideDrawable resource, GlideAnimation animation) {
                                    super.onResourceReady(resource, animation);
                                    dismiss();
                                }
                            });

你可能感兴趣的:(Glide加载图片监听)