Android 让毕加索预取即将到来的图像

Android 让毕加索预取即将到来的图像,android,gridview,picasso,Android,Gridview,Picasso,我正在使用毕加索的GridView,通过网络加载200幅图像。现在看来,毕加索在屏幕上看到图像之前,不会通过网络触发图像加载 有没有办法让毕加索预先获取列表中接下来的N幅图像,这样体验会更好?我正在使用适配器将图像放入Gridview 我使用毕加索成功地将图像预取到缓存中,如下所示: if (BuildConfig.DEBUG) { Picasso.with(getApplicationContext()).setIndicatorsEnabled(true); Picass

我正在使用毕加索的GridView,通过网络加载200幅图像。现在看来,毕加索在屏幕上看到图像之前,不会通过网络触发图像加载


有没有办法让毕加索预先获取列表中接下来的N幅图像,这样体验会更好?我正在使用适配器将图像放入Gridview

我使用毕加索成功地将图像预取到缓存中,如下所示:

if (BuildConfig.DEBUG) {
     Picasso.with(getApplicationContext()).setIndicatorsEnabled(true);
     Picasso.with(getApplicationContext()).setLoggingEnabled(true);
}
for (Article article : articleList) {
     ArrayList<String> images = article.getImages();
     for (String url : images) {
          if (!TextUtils.isEmpty(url)) {
               Picasso.with(getApplicationContext())
                    .load(url)
                    .resizeDimen(R.dimen.article_image_preview_width, R.dimen.article_image_preview_height)
                    .centerCrop()
                    .fetch();
          }
     }
}
if(BuildConfig.DEBUG){
Picasso.with(getApplicationContext()).setIndicatorEnabled(true);
Picasso.with(getApplicationContext()).setLoggingEnabled(true);
}
用于(文章:文章列表){
ArrayList images=article.getImages();
用于(字符串url:图像){
如果(!TextUtils.isEmpty(url)){
Picasso.with(getApplicationContext())
.load(url)
.resizeDimen(R.dimen.文章\图像\预览\宽度,R.dimen.文章\图像\预览\高度)
.centerCrop()
.fetch();
}
}
}

我想你应该试试AndroidQuery而不是毕加索。@Dabeeenster你实现了比尔·莫特的正确答案了吗。请分享谢谢分享。你能解释一下这篇文章是什么吗?你能分享更多的代码吗?假设这篇文章只是一些POJO,其中包含一个字符串数组列表,这些字符串是图像URL。OK。此代码将只缓存内存/磁盘中的图像。那么如何在我的listview/Gridview中显示缓存的图像呢?@AdamVarhegyi你在和客户玩saw?@AhmedHegazy这是俄罗斯轮盘赌