本文整理汇总了Java中com.squareup.picasso.RequestCreator.networkPolicy方法的典型用法代码示例。如果您正苦于以下问题:Java RequestCreator.networkPolicy方法的具体用法?Java RequestCreator.networkPolicy怎么用?Java RequestCreator.networkPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.squareup.picasso.RequestCreator
的用法示例。
在下文中一共展示了RequestCreator.networkPolicy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addImageToContent
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
@Override
public void addImageToContent(String link) {
final ImageView view = (ImageView) getActivity().getLayoutInflater().inflate(R.layout.article_content_img_item, mContentLayout, false);
mContentLayout.addView(view);
view.setTag(link);
final ImageListener l = new ImageListener(view, link);
view.setOnClickListener(l);
RequestCreator r = Picasso.with(getActivity()).load(link).placeholder(R.drawable.default_content_image_loading);
if (PreferenceHelper.getInstance().inSafeDataMode()) {
l.setLoadCacheForFirst(true);
r.networkPolicy(NetworkPolicy.OFFLINE);
}
r.into(view, l);
}
示例2: loadBeer
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
public RequestCreator loadBeer(long beerId, boolean highResolution) {
RequestCreator request =
Picasso.with(context).load(highResolution ? ImageUrls.getBeerPhotoHighResUrl(beerId) : ImageUrls.getBeerPhotoUrl(beerId));
if (Session.get().inDataSaverMode() && ConnectivityHelper.current(context) != ConnectivityHelper.ConnectivityType.Wifi)
request.networkPolicy(NetworkPolicy.OFFLINE);
return request;
}
示例3: loadBrewery
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
public RequestCreator loadBrewery(long breweryId, boolean highResolution) {
RequestCreator request = Picasso.with(context).load(highResolution ? ImageUrls.getBreweryPhotoHighResUrl(breweryId) : ImageUrls
.getBreweryPhotoUrl(breweryId));
if (Session.get().inDataSaverMode() && ConnectivityHelper.current(context) != ConnectivityHelper.ConnectivityType.Wifi)
request.networkPolicy(NetworkPolicy.OFFLINE);
return request;
}
示例4: loadUser
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
public RequestCreator loadUser(String username, boolean highResolution) {
RequestCreator request =
Picasso.with(context).load(highResolution ? ImageUrls.getUserPhotoHighResUrl(username) : ImageUrls.getUserPhotoUrl(username));
if (Session.get().inDataSaverMode() && ConnectivityHelper.current(context) != ConnectivityHelper.ConnectivityType.Wifi)
request.networkPolicy(NetworkPolicy.OFFLINE);
return request;
}