本文整理汇总了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);
}
示例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();
}
示例3: rxNetWorkAdapterFactory
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
private void rxNetWorkAdapterFactory() {
mAdapterFactory = RxJava2CallAdapterFactory.create();
}
示例4: provideRxJava2CallAdapterFactory
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Provides
@Singleton
RxJava2CallAdapterFactory provideRxJava2CallAdapterFactory() {
return RxJava2CallAdapterFactory.create();
}
示例5: provideRxJava2CallFactory
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Singleton
@Provides
CallAdapter.Factory provideRxJava2CallFactory() {
return RxJava2CallAdapterFactory.create();
}
示例6: provideRxJavaAdapterFactory
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Provides
@Singleton
CallAdapter.Factory provideRxJavaAdapterFactory() {
return RxJava2CallAdapterFactory.create();
}
示例7: provideRxJavaAdapterFactory
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; //导入方法依赖的package包/类
@Provides
@Singleton
CallAdapter.Factory provideRxJavaAdapterFactory() {
return RxJava2CallAdapterFactory.create();
}