22
33import android .content .Context ;
44import android .graphics .drawable .Drawable ;
5+ import android .net .Uri ;
56import android .util .Log ;
67import android .view .LayoutInflater ;
78import android .view .View ;
@@ -58,12 +59,12 @@ public Object instantiateItem(@NonNull ViewGroup container, int position) {
5859 Group downloadIconGroup =view .findViewById (R .id .item_downloadable_image_group );
5960 final SmartProgressImageView progressImageView =view .findViewById (R .id .item_downloadable_image_loadingView );
6061 progressImageView .setProgressNormalColor (progressColor );
61- final File downloadedImage =getDownloadedImage (getContext (),position );
62+ final Uri downloadedImageUri =getDownloadedImage (getContext (),position );
6263
63- if (downloadedImage !=null ){
64+ if (downloadedImageUri !=null ){
6465 downloadIconGroup .setVisibility (View .GONE );
6566
66- Glide .with (touchImageView ).load (downloadedImage . getPath () )
67+ Glide .with (touchImageView ).load (downloadedImageUri )
6768 .into (touchImageView );
6869
6970
@@ -149,13 +150,13 @@ public boolean onLongClick(View view) {
149150 return view ;
150151 }
151152
152- public final void downloadCompleted (int position ,File downloadedImage ){
153+ public final void downloadCompleted (int position ,Uri downloadedImageUri ){
153154 View view =parentPager .findViewWithTag (position );
154155 if (view !=null ){
155156 TouchImageView touchImageView =view .findViewById (R .id .item_downloadable_image_imgImage );
156157 Group downloadIconGroup =view .findViewById (R .id .item_downloadable_image_group );
157158 downloadIconGroup .setVisibility (View .GONE );
158- Glide .with (getContext ()).load (downloadedImage ).into (touchImageView );
159+ Glide .with (getContext ()).load (downloadedImageUri ).into (touchImageView );
159160 }
160161 }
161162 public final void downloadCompleted (int position ){
@@ -181,7 +182,7 @@ protected void cancelDownload(Context context, int pos){
181182 mIsDownloading [pos ]=false ;
182183 }
183184 @ Nullable
184- protected abstract File getDownloadedImage (Context context , int position );
185+ protected abstract Uri getDownloadedImage (Context context , int position );
185186
186187 @ Override
187188 public void destroyItem (@ NonNull ViewGroup container , int position , @ NonNull Object object ) {
0 commit comments