本文整理汇总了Java中io.victoralbertos.jolyglot.GsonSpeaker类的典型用法代码示例。如果您正苦于以下问题:Java GsonSpeaker类的具体用法?Java GsonSpeaker怎么用?Java GsonSpeaker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GsonSpeaker类属于io.victoralbertos.jolyglot包,在下文中一共展示了GsonSpeaker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
@Override
public void onCreate()
{
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this))
{
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
setupGraph();
Iconify.with(new FontAwesomeModule());
if (!BuildConfig.DEBUG)
Bugsnag.init(this);
else
LeakCanary.install(this);
// Empty string while RxSocialConnect's disk cache is not working
RxSocialConnect.register(this, "")
.using(new GsonSpeaker());
NavigationDrawerBuilder.initialiseMaterialDrawerImageLoader();
}
示例2: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供 {@link RxCache}
*
* @param cacheDirectory RxCache缓存路径
* @return
*/
@Singleton
@Provides
RxCache provideRxCache(Application application, @Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
RxCache.Builder builder = new RxCache.Builder();
if (configuration != null)
configuration.configRxCache(application, builder);
return builder
.persistence(cacheDirectory, new GsonSpeaker());
}
示例3: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供RXCache客户端
*
* @param cacheDirectory RxCache缓存路径
* @return
*/
@Singleton
@Provides
RxCache provideRxCache(@Named("RxCacheDirectory") File cacheDirectory) {
return new RxCache
.Builder()
.persistence(cacheDirectory, new GsonSpeaker());
}
示例4: DiscogsInteractor
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
public DiscogsInteractor(Context context, Retrofit retrofit, MySchedulerProvider mySchedulerProvider, DiscogsScraper discogsScraper, SharedPrefsManager sharedPrefsManager)
{
this.mySchedulerProvider = mySchedulerProvider;
discogsService = retrofit.create(DiscogsService.class);
this.discogsScraper = discogsScraper;
cacheProviders = new RxCache.Builder()
.setMaxMBPersistenceCache(5)
.persistence(context.getFilesDir(), new GsonSpeaker())
.using(CacheProviders.class);
this.sharedPrefsManager = sharedPrefsManager;
}
示例5: AppModule
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
public AppModule(Application context)
{
applicationContext = context;
cacheProviders = new RxCache.Builder()
.setMaxMBPersistenceCache(5)
.persistence(context.getFilesDir(), new GsonSpeaker())
.using(CacheProviders.class);
}
示例6: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供RXCache客户端
*
* @param cacheDir 缓存路径
* @return
*/
@Singleton
@Provides
RxCache provideRxCache(File cacheDir) {
return new RxCache
.Builder()
.persistence(cacheDir, new GsonSpeaker());
}
示例7: Repertories
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
public Repertories(File cacheDir) {
// create apis
cacheApi = new RxCache.Builder()
.useExpiredDataIfLoaderNotAvailable(true)
.persistence(cacheDir, new GsonSpeaker())
.using(CacheApi.class);
remoteApi = new Retrofit.Builder()
.baseUrl(URL_BASE)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.client(UnsafeOkHttpUtils.getClient())
.build()
.create(RemoteApi.class);
// add types
Context context = BaseApplication.getContext();
types.add(context.getString(R.string.type_other));
types.add(context.getString(R.string.type_web));
types.add(context.getString(R.string.type_we_chat));
types.add(context.getString(R.string.type_html5));
types.add(context.getString(R.string.type_app));
types.add(context.getString(R.string.type_intelligent_hardware));
types.add(context.getString(R.string.type_desktop_app));
types.add(context.getString(R.string.type_big_data));
types.add(context.getString(R.string.type_system));
types.add(context.getString(R.string.type_sdk_api));
types.add(context.getString(R.string.type_art));
}
示例8: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供RXCache客户端
*
* @param cacheDirectory RxCache缓存路径
* @return
*/
@Singleton
@Provides
RxCache provideRxCache(Application application, @Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
RxCache.Builder builder = new RxCache.Builder();
if (configuration != null)
configuration.configRxCache(application, builder);
return builder
.persistence(cacheDirectory, new GsonSpeaker());
}
示例9: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供 {@link RxCache}
*
* @param cacheDirectory RxCache缓存路径
* @return
*/
@Singleton
@Provides
RxCache provideRxCache(Application application, @Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
RxCache.Builder builder = new RxCache.Builder();
RxCache rxCache = null;
if (configuration != null) {
rxCache = configuration.configRxCache(application, builder);
}
if (rxCache != null) return rxCache;
return builder
.persistence(cacheDirectory, new GsonSpeaker());
}
示例10: getUserCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
public synchronized static UserCacheProviders getUserCache() {
if (userCacheProviders == null) {
userCacheProviders = new RxCache.Builder()
.persistence(BaseApplication.getApplication().getExternalCacheDir(), new GsonSpeaker())
.using(UserCacheProviders.class);
}
return userCacheProviders;
}
示例11: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* provide {@link RxCache}
*
* @param cacheDirectory RxCache cache path
* @return RxCache
*/
@Singleton
@Provides
RxCache provideRxCache(@Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
RxCache.Builder builder = new RxCache.Builder();
RxCache rxCache = null;
if (configuration != null) {
rxCache = configuration.configRxCache(mApplication, builder);
}
if (rxCache != null) {
return rxCache;
}
return builder.persistence(cacheDirectory, new GsonSpeaker());
}
示例12: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供RXCache客户端
*
* @param cacheDirectory RxCache缓存路径
* @return
*/
@Singleton
@Provides
RxCache provideRxCache(Application application, RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
RxCache.Builder builder = new RxCache.Builder();
configuration.configRxCache(application, builder);
return builder
.persistence(cacheDirectory, new GsonSpeaker());
}
示例13: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供 {@link RxCache}
*
* @param cacheDirectory RxCache 缓存路径
* @return RxCache
*/
@Singleton
@Provides
RxCache provideRxCache(@Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
RxCache.Builder builder = new RxCache.Builder();
RxCache rxCache = null;
if (configuration != null) {
rxCache = configuration.configRxCache(mApplication, builder);
}
if (rxCache != null) {
return rxCache;
}
return builder.persistence(cacheDirectory, new GsonSpeaker());
}
示例14: provideRxCache
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
/**
* 提供RxCache
*
* @param cacheDirectory RxCache缓存路径
* @return
*/
@Singleton
@Provides
RxCache provideRxCache(Application application, @Nullable RxCacheConfiguration configuration, @Named("RxCacheDirectory") File cacheDirectory) {
RxCache.Builder builder = new RxCache.Builder();
if (configuration != null) {
configuration.configRxCache(application, builder);
}
return builder
.persistence(cacheDirectory, new GsonSpeaker());
}
示例15: mockApiForSuccess
import io.victoralbertos.jolyglot.GsonSpeaker; //导入依赖的package包/类
private void mockApiForSuccess() {
NetworkResponse networkResponse = new NetworkResponse();
GithubUsersApi githubUsersApi = new Mockery.Builder<ApiSuccess>()
.mock(ApiSuccess.class)
.build();
ReactiveCache reactiveCache = new ReactiveCache.Builder()
.using(testFolder.getRoot(), new GsonSpeaker());
userRepositoryUT = new UserRepository(githubUsersApi,
networkResponse, reactiveCache);
}