use of cn.foxconn.matthew.myapp.wanandroid.bean.pojovo.TypeTagVO in project MyApp by MatthewDevelop.
the class ExampleUnitTest method APITest.
@Test
public void APITest() {
String BASE_URL = "http://wanandroid.com/";
OkHttpClient.Builder builder = new OkHttpClient.Builder();
// 添加公共拦截器
builder.addInterceptor(new CustomInterceptor());
Retrofit retrofit = new Retrofit.Builder().client(builder.build()).baseUrl(BASE_URL).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).addConverterFactory(GsonConverterFactory.create()).build();
WanService movieService = retrofit.create(WanService.class);
boolean test = true;
if (test) {
} else {
movieService.getTagData().subscribe(new Observer<ResponseData<List<TypeTagVO>>>() {
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(ResponseData<List<TypeTagVO>> listResponseData) {
System.out.println(listResponseData.toString());
}
});
movieService.getHomeBannerList().subscribe(new Observer<ResponseData<List<BannerBean>>>() {
@Override
public void onError(Throwable e) {
e.printStackTrace();
}
@Override
public void onComplete() {
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(ResponseData<List<BannerBean>> listResponseData) {
System.out.println(listResponseData.toString());
}
});
movieService.getHomeArticleList(5).subscribe(new Observer<ResponseData<ArticleListVO>>() {
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(ResponseData<ArticleListVO> articleListVOResponseData) {
System.out.println(articleListVOResponseData.toString());
}
});
}
}
use of cn.foxconn.matthew.myapp.wanandroid.bean.pojovo.TypeTagVO in project MyApp by MatthewDevelop.
the class TypePresenter method setTabUi.
/**
* 设置tab
*/
public void setTabUi() {
TabLayout tabLayout = mTypeView.getTabLayout();
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
for (TypeTagVO bean : mDatas) {
tabLayout.addTab(tabLayout.newTab().setText(bean.getName()));
}
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
setTagUi(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
if (llTag != null && llTag.getVisibility() == View.VISIBLE) {
llTag.setVisibility(View.GONE);
} else {
setTagUi(tab.getPosition());
}
}
});
}
Aggregations