本文整理匯總了Java中android.database.Observable類的典型用法代碼示例。如果您正苦於以下問題:Java Observable類的具體用法?Java Observable怎麽用?Java Observable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Observable類屬於android.database包,在下文中一共展示了Observable類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fixAdapterForTesting
import android.database.Observable; //導入依賴的package包/類
/**
* Fixes internal dependencies to android.database.Observable so that a RecyclerView.Adapter can be tested using regular unit tests while
* observing changes to the data setIsTypingRepository.
*/
public static RecyclerView.AdapterDataObserver fixAdapterForTesting(RecyclerView.Adapter adapter) throws NoSuchFieldException, IllegalAccessException {
// Observables are not mocked by default so we need to hook the adapter up to an observer so we can track changes
Field observableField = RecyclerView.Adapter.class.getDeclaredField("mObservable");
observableField.setAccessible(true);
Object observable = observableField.get(adapter);
Field observersField = Observable.class.getDeclaredField("mObservers");
observersField.setAccessible(true);
final ArrayList<Object> observers = new ArrayList<>();
RecyclerView.AdapterDataObserver dataObserver = mock(RecyclerView.AdapterDataObserver.class);
observers.add(dataObserver);
observersField.set(observable, observers);
return dataObserver;
}
示例2: Obget
import android.database.Observable; //導入依賴的package包/類
@GET()
Observable<String> Obget(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
示例3: Obpost
import android.database.Observable; //導入依賴的package包/類
@FormUrlEncoded
@POST()
Observable<String> Obpost(@HeaderMap Map<String, String> headers, @Url String url, @FieldMap Map<String, String> params);
示例4: Obdownload
import android.database.Observable; //導入依賴的package包/類
@Streaming
@GET()
Observable<ResponseBody> Obdownload(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
示例5: capture
import android.database.Observable; //導入依賴的package包/類
@Headers("Authorization :" + AUTHORIZATION)
@POST(CAPTURE)
Observable<CaptureItem> capture(@Body JSONObject payload);
示例6: getEnroll
import android.database.Observable; //導入依賴的package包/類
@Headers("Authorization :" + AUTHORIZATION)
@GET(GET_ENROLL)
Observable<List<EnrollItem>> getEnroll(@Query("item_pos") String item_pos);
示例7: getCapture
import android.database.Observable; //導入依賴的package包/類
@Headers("Authorization :" + AUTHORIZATION)
@GET(GET_CAPTURE)
Observable<List<CaptureItem>> getCapture(@Query("item_pos") String item_pos);
示例8: fetchNewestData
import android.database.Observable; //導入依賴的package包/類
@GET("index.php/3/Wallpaper/picLatest/start/{start}/limit/{limit}/")
Observable<NewestData> fetchNewestData(@Path("start") int start,@Path("limit") int limit);
示例9: getWeatherLive
import android.database.Observable; //導入依賴的package包/類
/**
* 獲取指定城市的實時天氣
* <p>
* API地址:http://service.envicloud.cn:8082/v2/weatherlive/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/101020100
*
* @param cityId 城市id
* @return Observable
*/
@GET("/v2/weatherlive/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/{cityId}")
Observable<EnvironmentCloudWeatherLive> getWeatherLive(@Path("cityId") String cityId);
示例10: getWeatherForecast
import android.database.Observable; //導入依賴的package包/類
/**
* 獲取指定城市7日天氣預報
* <p>
* API地址:http://service.envicloud.cn:8082/v2/weatherforecast/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/101020100
*
* @param cityId 城市id
* @return Observable
*/
@GET("/v2/weatherforecast/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/{cityId}")
Observable<EnvironmentCloudForecast> getWeatherForecast(@Path("cityId") String cityId);
示例11: getAirLive
import android.database.Observable; //導入依賴的package包/類
/**
* 獲取指定城市的實時空氣質量
* <p>
* API地址:http://service.envicloud.cn:8082/v2/cityairlive/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/101020100
*
* @param cityId 城市id
* @return Observable
*/
@GET("/v2/cityairlive/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/{cityId}")
Observable<EnvironmentCloudCityAirLive> getAirLive(@Path("cityId") String cityId);
示例12: getAirForecast
import android.database.Observable; //導入依賴的package包/類
/**
* 獲取指定城市的五日空氣質量預報
* <p>
* API地址:http://service.envicloud.cn:8082/v2/cityairforecast/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/101020100
*
* @param cityId 城市id
* @return Observable
*/
@GET("/v2/cityairforecast/YMFYB256AGFUZZE0ODQ3MZM1MZE2NTU=/{cityId}")
Observable<EnvironmentCloudCityAirLive> getAirForecast(@Path("cityId") String cityId);
示例13: getNewsList
import android.database.Observable; //導入依賴的package包/類
/**
* 獲取新聞列表
* @param cacheControl
* @param type
* @param key
* @return
*/
@GET("toutiao/index")
Observable<Result<ResultBean<ArrayList<NewsBean>>>> getNewsList(
@Header("Cache-Control") String cacheControl,
@Query("type") String type,
@Query("key") String key);
示例14: getPageAt
import android.database.Observable; //導入依賴的package包/類
public abstract Observable<Data<T>> getPageAt(int page);