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


Java RxJava2CallAdapterFactory.create方法代码示例

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


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

示例1: setupApiServices

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
private void setupApiServices(String streamingUrl, String recordingUrl) {
	OkHttpClient client = new OkHttpClient();
	GsonConverterFactory gsonConverterFactory = GsonConverterFactory.create();
	RxJava2CallAdapterFactory rxJava2CallAdapterFactory = RxJava2CallAdapterFactory.create();

	Retrofit retrofitRecordings = new Retrofit.Builder()
			.baseUrl(recordingUrl)
			.client(client)
			.addConverterFactory(gsonConverterFactory)
			.addCallAdapterFactory(rxJava2CallAdapterFactory)
			.build();
	mRecordingApiService = retrofitRecordings.create(RecordingService.class);

	Retrofit retrofigStreaming = new Retrofit.Builder()
			.baseUrl(streamingUrl)
			.client(client)
			.addConverterFactory(gsonConverterFactory)
			.addCallAdapterFactory(rxJava2CallAdapterFactory)
			.build();
	mStreamingApiService = retrofigStreaming.create(StreamingService.class);
}
 
开发者ID:NiciDieNase,项目名称:chaosflix,代码行数:22,代码来源:MediaApiService.java

示例2: ChaosflixViewModel

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
public ChaosflixViewModel(Application application){
	super(application);
	Resources res = application.getResources();
	String recordingUrl = res.getString(R.string.api_media_ccc_url);
	String streamingUrl = res.getString(R.string.streaming_media_ccc_url);

	OkHttpClient client = new OkHttpClient();
	GsonConverterFactory gsonConverterFactory = GsonConverterFactory.create();
	RxJava2CallAdapterFactory rxJava2CallAdapterFactory = RxJava2CallAdapterFactory.create();

	Retrofit retrofitRecordings = new Retrofit.Builder()
			.baseUrl(recordingUrl)
			.client(client)
			.addConverterFactory(gsonConverterFactory)
			.addCallAdapterFactory(rxJava2CallAdapterFactory)
			.build();
	recordingApi = retrofitRecordings.create(RecordingService.class);

	Retrofit retrofigStreaming = new Retrofit.Builder()
			.baseUrl(streamingUrl)
			.client(client)
			.addConverterFactory(gsonConverterFactory)
			.addCallAdapterFactory(rxJava2CallAdapterFactory)
			.build();
	streamingApi = retrofigStreaming.create(StreamingService.class);

	database = Room.databaseBuilder(getApplication().getApplicationContext(), ChaosflixDatabase.class, "mediaccc.db").build();
}
 
开发者ID:NiciDieNase,项目名称:chaosflix,代码行数:29,代码来源:ChaosflixViewModel.java

示例3: rxNetWorkAdapterFactory

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
private void rxNetWorkAdapterFactory() {
    mAdapterFactory = RxJava2CallAdapterFactory.create();
}
 
开发者ID:7449,项目名称:RxNetWork,代码行数:4,代码来源:RxNetWork.java

示例4: provideRxJava2CallAdapterFactory

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Provides
@Singleton
RxJava2CallAdapterFactory provideRxJava2CallAdapterFactory() {
    return RxJava2CallAdapterFactory.create();
}
 
开发者ID:vicky7230,项目名称:Paprika,代码行数:6,代码来源:NetworkModule.java

示例5: provideRxJava2CallFactory

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Singleton
@Provides
CallAdapter.Factory provideRxJava2CallFactory() {
    return RxJava2CallAdapterFactory.create();
}
 
开发者ID:sztomek,项目名称:cleanarchitecture-unidirectional,代码行数:6,代码来源:NetworkModule.java

示例6: provideRxJavaAdapterFactory

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Provides
@Singleton
CallAdapter.Factory provideRxJavaAdapterFactory() {
    return RxJava2CallAdapterFactory.create();
}
 
开发者ID:n1rocket,项目名称:eggs-android,代码行数:6,代码来源:ClientModule.java

示例7: provideRxJavaAdapterFactory

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Provides
@Singleton
CallAdapter.Factory provideRxJavaAdapterFactory() {
  return RxJava2CallAdapterFactory.create();
}
 
开发者ID:quangctkm9207,项目名称:mvp-android-arch-component,代码行数:6,代码来源:ApiServiceModule.java


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