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