當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。