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


Java Picasso.setSingletonInstance方法代码示例

本文整理汇总了Java中com.squareup.picasso.Picasso.setSingletonInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Picasso.setSingletonInstance方法的具体用法?Java Picasso.setSingletonInstance怎么用?Java Picasso.setSingletonInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.squareup.picasso.Picasso的用法示例。


在下文中一共展示了Picasso.setSingletonInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    if(!FirebaseApp.getApps(this).isEmpty()){
        FirebaseDatabase.getInstance().setPersistenceEnabled(true);
    }

    Picasso.Builder builder = new Picasso.Builder(this);
    builder.downloader(new OkHttp3Downloader(this, Integer.MAX_VALUE));
    Picasso built = builder.build();
    built.setIndicatorsEnabled(false);
    built.setLoggingEnabled(true);
    Picasso.setSingletonInstance(built);
}
 
开发者ID:Socialate,项目名称:furry-sniffle,代码行数:16,代码来源:Socialate.java

示例2: onCreate

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    Picasso picasso = new Picasso.Builder(this)
            .loggingEnabled(BuildConfig.DEBUG)
            .indicatorsEnabled(false)
            .build();
    Picasso.setSingletonInstance(picasso);


    RxBus.getInstance()
            .toObservable()
            .subscribeOn(Schedulers.newThread())
            .subscribe(new Consumer<Object>() {
                @Override
                public void accept(Object o) throws Exception {
                    Log.d("EVENT", "onNewEvent: " + o.getClass().getSimpleName() + " [" + o.toString() + "]");
                }
            });
}
 
开发者ID:dvdciri,项目名称:DeepImagePreview-Project,代码行数:22,代码来源:MenuApplication.java

示例3: onCreate

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    // Initialize Picasso configuration
    Picasso.Builder builder = new Picasso.Builder(this);
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    builder.downloader(new OkHttp3Downloader(OkHttpUtils.getCompatibleClient(preferences)));
    if (BuildConfig.DEBUG) {
        builder.listener((picasso, uri, exception) -> exception.printStackTrace());
    }

    try {
        Picasso.setSingletonInstance(builder.build());
    } catch (IllegalStateException e) {
        throw new RuntimeException(e);
    }

    db = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "tuskyDB")
            .allowMainThreadQueries()
            .addMigrations(AppDatabase.MIGRATION_2_3)
            .addMigrations(AppDatabase.MIGRATION_3_4)
            .build();

    JobManager.create(this).addJobCreator(new NotificationPullJobCreator(this));

    //necessary for Android < APi 21
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
 
开发者ID:Vavassor,项目名称:Tusky,代码行数:29,代码来源:TuskyApplication.java

示例4: onCreate

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    component = DaggerLittleLight_LittleLightComponent.builder()
            .androidModule(new AndroidModule(this))
            .adapterModule(new AdapterModule("https://www.bungie.net"))
            .build();

    Picasso.setSingletonInstance(component.providePicasso());
}
 
开发者ID:jam01,项目名称:LittleLight,代码行数:11,代码来源:LittleLight.java

示例5: onCreate

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Picasso picasso = new Picasso.Builder(this).build();
    Picasso.setSingletonInstance(picasso);
    sSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
}
 
开发者ID:graviton57,项目名称:TVGuide,代码行数:8,代码来源:TvApp.java

示例6: initializePicasso

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
private void initializePicasso() {
    Picasso built = new Picasso.Builder(this).build();
    //built.setIndicatorsEnabled(true);
    built.setLoggingEnabled(true);
    Picasso.setSingletonInstance(built);
}
 
开发者ID:JonathandelaSen,项目名称:TheMovies,代码行数:7,代码来源:MyApplication.java


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