Java 类io.realm.rx.RealmObservableFactory 实例源码

项目:GitHub    文件:RealmConfigurationTests.java   
@Test
public void hashCode_withDifferentRxObservableFactory() {
    RealmConfiguration config1 = new RealmConfiguration.Builder(context)
            .directory(configFactory.getRoot())
            .rxFactory(new RealmObservableFactory())
            .build();
    RealmConfiguration config2 = new RealmConfiguration.Builder(context)
            .directory(configFactory.getRoot())
            .rxFactory(new RealmObservableFactory() {
                @Override
                public int hashCode() {
                    return super.hashCode() + 1;
                }
            })
            .build();

    assertNotEquals(config1.hashCode(), config2.hashCode());
}
项目:AndroidSchool    文件:AppDelegate.java   
@Override
public void onCreate() {
    super.onCreate();
    sContext = this;

    Hawk.init(this)
            .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
            .setStorage(HawkBuilder.newSharedPrefStorage(this))
            .setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE)
            .build();

    RealmConfiguration configuration = new RealmConfiguration.Builder(this)
            .rxFactory(new RealmObservableFactory())
            .build();
    Realm.setDefaultConfiguration(configuration);

    ApiFactory.recreate();
    RepositoryProvider.init();
}
项目:AndroidSchool    文件:AppDelegate.java   
@Override
public void onCreate() {
    super.onCreate();
    sContext = this;

    Hawk.init(this)
            .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
            .setStorage(HawkBuilder.newSharedPrefStorage(this))
            .setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE)
            .build();

    RealmConfiguration configuration = new RealmConfiguration.Builder(this)
            .rxFactory(new RealmObservableFactory())
            .build();
    Realm.setDefaultConfiguration(configuration);

    ApiFactory.recreate();
    RepositoryProvider.init();
}
项目:AndroidSchool    文件:AppDelegate.java   
@Override
public void onCreate() {
    super.onCreate();
    sContext = this;

    Hawk.init(this)
            .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
            .setStorage(HawkBuilder.newSharedPrefStorage(this))
            .setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE)
            .build();

    RealmConfiguration configuration = new RealmConfiguration.Builder(this)
            .rxFactory(new RealmObservableFactory())
            .build();
    Realm.setDefaultConfiguration(configuration);

    ApiFactory.recreate();
    RepositoryProvider.init();
}
项目:AndroidSchool    文件:AppDelegate.java   
@Override
public void onCreate() {
    super.onCreate();

    Hawk.init(this)
            .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
            .setStorage(HawkBuilder.newSharedPrefStorage(this))
            .setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE)
            .build();

    RealmConfiguration configuration = new RealmConfiguration.Builder(this)
            .rxFactory(new RealmObservableFactory())
            .build();
    Realm.setDefaultConfiguration(configuration);

    sAppComponent = DaggerAppComponent.builder()
            .dataModule(new DataModule())
            .build();
}
项目:AndroidSchool    文件:AppDelegate.java   
@Override
public void onCreate() {
    super.onCreate();
    sContext = this;

    Hawk.init(this)
            .setEncryptionMethod(HawkBuilder.EncryptionMethod.MEDIUM)
            .setStorage(HawkBuilder.newSharedPrefStorage(this))
            .setLogLevel(BuildConfig.DEBUG ? LogLevel.FULL : LogLevel.NONE)
            .build();

    RealmConfiguration configuration = new RealmConfiguration.Builder(this)
            .rxFactory(new RealmObservableFactory())
            .build();
    Realm.setDefaultConfiguration(configuration);

    ApiFactory.recreate();
    RepositoryProvider.init();
}
项目:androidgithub    文件:DBManager.java   
public static void initDefaultRealm(@NonNull String dbSuffix, int version, RealmMigration realmMigration) {
        Realm.removeDefaultConfiguration();
        RealmConfiguration.Builder builder = new RealmConfiguration.Builder()
                .name("db_realm_" + dbSuffix)
                .schemaVersion(version)
                .rxFactory(new RealmObservableFactory());
//                .deleteRealmIfMigrationNeeded();
        if (realmMigration != null)
            builder.migration(realmMigration);

        RealmConfiguration realmConfiguration = builder.build();
        Realm.setDefaultConfiguration(realmConfiguration);
    }
项目:talk-android    文件:RealmConfig.java   
public static RealmConfiguration getTalkRealm() {
    if (realmConfiguration == null) {
        realmConfiguration = new RealmConfiguration.Builder(MainApp.CONTEXT)
                .name(TALK_REALM)
                .schemaVersion(SCHEMA_VERSION)
                .migration(new Migration())
                .rxFactory(new RealmObservableFactory())
                .build();
    }
    return realmConfiguration;
}
项目:AndroidSchool    文件:MoviesApp.java   
@Override
public void onCreate() {
    super.onCreate();
    sInstance = this;

    Picasso picasso = new Picasso.Builder(this)
            .downloader(new OkHttp3Downloader(this))
            .build();
    Picasso.setSingletonInstance(picasso);

    RealmConfiguration configuration = new RealmConfiguration.Builder(this)
            .rxFactory(new RealmObservableFactory())
            .build();
    Realm.setDefaultConfiguration(configuration);
}
项目:AndroidSchool    文件:MoviesApp.java   
@Override
public void onCreate() {
    super.onCreate();
    sInstance = this;

    Picasso picasso = new Picasso.Builder(this)
            .downloader(new OkHttp3Downloader(this))
            .build();
    Picasso.setSingletonInstance(picasso);

    RealmConfiguration configuration = new RealmConfiguration.Builder(this)
            .rxFactory(new RealmObservableFactory())
            .build();
    Realm.setDefaultConfiguration(configuration);
}
项目:UseCases    文件:GenericApplication.java   
private void initializeRealm() {
    Realm.init(this);
    Realm.setDefaultConfiguration(new RealmConfiguration.Builder()
            .name("app.realm")
            .modules(Realm.getDefaultModule(), new LibraryModule())
            .rxFactory(new RealmObservableFactory())
            .deleteRealmIfMigrationNeeded()
            .build());
}
项目:RxRedux    文件:RxReduxApplication.java   
private void initializeRealm() {
    Realm.init(this);
    Realm.setDefaultConfiguration(new RealmConfiguration.Builder().name("app.realm")
            .modules(Realm.getDefaultModule(), new LibraryModule()).rxFactory(new RealmObservableFactory())
            .deleteRealmIfMigrationNeeded().build());
}