本文整理汇总了Java中com.justwayward.reader.bean.BooksByCats类的典型用法代码示例。如果您正苦于以下问题:Java BooksByCats类的具体用法?Java BooksByCats怎么用?Java BooksByCats使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BooksByCats类属于com.justwayward.reader.bean包,在下文中一共展示了BooksByCats类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OnCreateViewHolder
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
@Override
public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
return new BaseViewHolder<BooksByCats.BooksBean>(parent, R.layout.item_sub_category_list) {
@Override
public void setData(BooksByCats.BooksBean item) {
super.setData(item);
if (!SettingManager.getInstance().isNoneCover()) {
holder.setRoundImageUrl(R.id.ivSubCateCover, Constant.IMG_BASE_URL + item.cover,
R.drawable.cover_default);
} else {
holder.setImageResource(R.id.ivSubCateCover, R.drawable.cover_default);
}
holder.setText(R.id.tvSubCateTitle, item.title)
.setText(R.id.tvSubCateAuthor, (item.author == null ? "未知" : item.author) + " | " + (item.majorCate == null ? "未知" : item.majorCate))
.setText(R.id.tvSubCateShort, item.shortIntro)
.setText(R.id.tvSubCateMsg, String.format(mContext.getResources().getString(R.string.category_book_msg),
item.latelyFollower,
TextUtils.isEmpty(item.retentionRatio) ? "0" : item.retentionRatio));
}
};
}
示例2: showCategoryList
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
@Override
public void showCategoryList(BooksByCats data, boolean isRefresh) {
if (isRefresh) {
start = 0;
mAdapter.clear();
}
mAdapter.addAll(data.books);
start += data.books.size();
}
示例3: getRankList
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
@Override
public void getRankList(String id) {
Subscription rxSubscription = bookApi.getRanking(id).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Rankings>() {
@Override
public void onCompleted() {
mView.complete();
}
@Override
public void onError(Throwable e) {
LogUtils.e("getRankList:" + e.toString());
mView.showError();
}
@Override
public void onNext(Rankings ranking) {
List<Rankings.RankingBean.BooksBean> books = ranking.ranking.books;
BooksByCats cats = new BooksByCats();
cats.books = new ArrayList<>();
for (Rankings.RankingBean.BooksBean bean : books) {
cats.books.add(new BooksByCats.BooksBean(bean._id, bean.cover, bean.title, bean.author, bean.cat, bean.shortIntro, bean.latelyFollower, bean.retentionRatio));
}
mView.showRankList(cats);
}
});
addSubscrebe(rxSubscription);
}
示例4: getCategoryList
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
@Override
public void getCategoryList(String gender, final String major, String minor, String type, final int start, int limit) {
String key = StringUtils.creatAcacheKey("category-list", gender, type, major, minor, start, limit);
Observable<BooksByCats> fromNetWork = bookApi.getBooksByCats(gender, type, major, minor, start, limit)
.compose(RxUtil.<BooksByCats>rxCacheListHelper(key));
//依次检查disk、network
Subscription rxSubscription = Observable.concat(RxUtil.rxCreateDiskObservable(key, BooksByCats.class), fromNetWork)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<BooksByCats>() {
@Override
public void onCompleted() {
mView.complete();
}
@Override
public void onError(Throwable e) {
LogUtils.e("getCategoryList:" + e.toString());
mView.showError();
}
@Override
public void onNext(BooksByCats booksByCats) {
mView.showCategoryList(booksByCats, start == 0 ? true : false);
}
});
addSubscrebe(rxSubscription);
}
示例5: getBooksByCats
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
public Observable<BooksByCats> getBooksByCats(String gender, String type, String major, String minor, int start, @Query("limit") int limit) {
return service.getBooksByCats(gender, type, major, minor, start, limit);
}
示例6: onItemClick
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
@Override
public void onItemClick(int position) {
BooksByCats.BooksBean data = mAdapter.getItem(position);
BookDetailActivity.startActivity(activity, data._id);
}
示例7: showRankList
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
@Override
public void showRankList(BooksByCats data) {
mAdapter.clear();
mAdapter.addAll(data.books);
}
示例8: getBooksByCats
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
/**
* 按分类获取书籍列表
*
* @param gender male、female
* @param type hot(热门)、new(新书)、reputation(好评)、over(完结)
* @param major 玄幻
* @param minor 东方玄幻、异界大陆、异界争霸、远古神话
* @param limit 50
* @return
*/
@GET("/book/by-categories")
Observable<BooksByCats> getBooksByCats(@Query("gender") String gender, @Query("type") String type, @Query("major") String major, @Query("minor") String minor, @Query("start") int start, @Query("limit") int limit);
示例9: showCategoryList
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
void showCategoryList(BooksByCats data, boolean isRefresh);
示例10: showRankList
import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
void showRankList(BooksByCats data);