本文整理汇总了Java中com.bumptech.glide.integration.okhttp.OkHttpUrlLoader类的典型用法代码示例。如果您正苦于以下问题:Java OkHttpUrlLoader类的具体用法?Java OkHttpUrlLoader怎么用?Java OkHttpUrlLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OkHttpUrlLoader类属于com.bumptech.glide.integration.okhttp包,在下文中一共展示了OkHttpUrlLoader类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; //导入依赖的package包/类
public static void init(final Context context) {
OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.setReadTimeout(30, TimeUnit.SECONDS);
okHttpClient.setConnectTimeout(30, TimeUnit.SECONDS);
// okHttpClient.setProtocols(Arrays.asList(Protocol.HTTP_1_1));
GlideBuilder glideBuilder = new GlideBuilder(context)
.setDiskCache(new DiskCache.Factory() {
@Override
public DiskCache build() {
// Careful: the external cache directory doesn't enforce permissions
File cacheLocation = new File(context.getExternalCacheDir(), AppConfig.CACHE_IMAGE_DIR);
cacheLocation.mkdirs();
return DiskLruCacheWrapper.get(cacheLocation, 100 * 1024 * 1024);
}
});
if (!Glide.isSetup()) {
Glide.setup(glideBuilder);
}
Glide.get(context).register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(okHttpClient));
}
开发者ID:BigAppOS,项目名称:BigApp_Discuz_Android,代码行数:23,代码来源:GlideUtils.java
示例2: onCreate
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Glide.get(this).register(GlideUrl.class, InputStream.class,
new OkHttpUrlLoader.Factory(new OkHttpClient()));
mHandler = new Handler();
imageLoader = new ImageLoader(this);
ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}
mLUtils = LUtils.getInstance(this);
mThemedStatusBarColor = getResources().getColor(R.color.theme_primary_dark);
mNormalStatusBarColor = mThemedStatusBarColor;
SyncUtils.createSyncAccount(this);
getLoaderManager().restartLoader(0, buildLoaderArgs(), new AccountLoader());
}
开发者ID:taoliuh,项目名称:v2ex,代码行数:22,代码来源:BaseActivity.java
示例3: onCreate
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; //导入依赖的package包/类
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
mContext = this;
client = new OkHttpClient();
Glide.get(this).register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client) );
PushService.setDefaultPushCallback(this, MainActivity.class);
}
开发者ID:linggom,项目名称:Jahamanga,代码行数:10,代码来源:GlobalApplication.java
示例4: setupGlide
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; //导入依赖的package包/类
protected void setupGlide() {
Glide.get(mApp).register(GlideUrl.class, InputStream.class,
new OkHttpUrlLoader.Factory(mOkHttpClient));
}
开发者ID:yshrsmz,项目名称:photosearcher,代码行数:5,代码来源:AppLifecycleCallbacks.java
示例5: registerComponents
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide) {
if (BuildConfig.DEBUG) {
OkHttpClient client = new OkHttpClient();
client.networkInterceptors().add(new StethoInterceptor());
OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(client);
glide.register(GlideUrl.class, InputStream.class, factory);
}
}
开发者ID:LoopTeam,项目名称:LoopSeries-Mobile,代码行数:10,代码来源:LoopAnimeGlideModule.java
示例6: registerComponents
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide) {
// Use OkHttp to fetch images.
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(new OkHttpClient()));
}
开发者ID:foursquare,项目名称:placepicker-sdk-sample,代码行数:6,代码来源:SampleGlideModule.java
示例7: registerComponents
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader; //导入依赖的package包/类
@Override
public void registerComponents(Context context, Glide glide) {
glide.register(GlideUrl.class, InputStream.class,
new OkHttpUrlLoader.Factory(InstaApplication.from(context).getHttpClient()));
}
开发者ID:oxoooo,项目名称:Moments,代码行数:6,代码来源:OkHttpGlideModule.java
注:本文中的com.bumptech.glide.integration.okhttp.OkHttpUrlLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论