当前位置: 首页>>代码示例>>Java>>正文


Java RequestCreator.networkPolicy方法代码示例

本文整理汇总了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);
}
 
开发者ID:ChaosLeong,项目名称:FxcnBeta,代码行数:17,代码来源:DetailsFragment.java

示例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;
}
 
开发者ID:erickok,项目名称:ratebeer,代码行数:8,代码来源:Images.java

示例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;
}
 
开发者ID:erickok,项目名称:ratebeer,代码行数:8,代码来源:Images.java

示例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;
}
 
开发者ID:erickok,项目名称:ratebeer,代码行数:8,代码来源:Images.java


注:本文中的com.squareup.picasso.RequestCreator.networkPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。