|
@ -19,11 +19,11 @@ import java.util.List; |
|
|
|
|
|
|
|
|
import awais.instagrabber.R; |
|
|
import awais.instagrabber.R; |
|
|
import awais.instagrabber.adapters.FeedAdapterV2; |
|
|
import awais.instagrabber.adapters.FeedAdapterV2; |
|
|
import awais.instagrabber.asyncs.DownloadedCheckerAsyncTask; |
|
|
|
|
|
import awais.instagrabber.databinding.ItemFeedGridBinding; |
|
|
import awais.instagrabber.databinding.ItemFeedGridBinding; |
|
|
import awais.instagrabber.models.PostsLayoutPreferences; |
|
|
import awais.instagrabber.models.PostsLayoutPreferences; |
|
|
import awais.instagrabber.repositories.responses.Media; |
|
|
import awais.instagrabber.repositories.responses.Media; |
|
|
import awais.instagrabber.repositories.responses.User; |
|
|
import awais.instagrabber.repositories.responses.User; |
|
|
|
|
|
import awais.instagrabber.utils.DownloadUtils; |
|
|
import awais.instagrabber.utils.ResponseBodyUtils; |
|
|
import awais.instagrabber.utils.ResponseBodyUtils; |
|
|
import awais.instagrabber.utils.TextUtils; |
|
|
import awais.instagrabber.utils.TextUtils; |
|
|
|
|
|
|
|
@ -102,8 +102,7 @@ public class FeedGridItemViewHolder extends RecyclerView.ViewHolder { |
|
|
binding.typeIcon.setVisibility(View.VISIBLE); |
|
|
binding.typeIcon.setVisibility(View.VISIBLE); |
|
|
binding.typeIcon.setImageResource(typeIconRes); |
|
|
binding.typeIcon.setImageResource(typeIconRes); |
|
|
} |
|
|
} |
|
|
final DownloadedCheckerAsyncTask task = new DownloadedCheckerAsyncTask(result -> { |
|
|
|
|
|
final List<Boolean> checkList = result.get(media.getPk()); |
|
|
|
|
|
|
|
|
final List<Boolean> checkList = DownloadUtils.checkDownloaded(media); |
|
|
if (checkList == null || checkList.isEmpty()) { |
|
|
if (checkList == null || checkList.isEmpty()) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -125,8 +124,6 @@ public class FeedGridItemViewHolder extends RecyclerView.ViewHolder { |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
task.execute(media); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void setThumbImage(final String thumbnailUrl) { |
|
|
private void setThumbImage(final String thumbnailUrl) { |
|
|