本文整理汇总了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);