当前位置: 首页>>代码示例>>Java>>正文


Java BooksByCats类代码示例

本文整理汇总了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));
        }
    };
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:SubCategoryAdapter.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:SubCategoryFragment.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:31,代码来源:SubRankPresenter.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:29,代码来源:SubCategoryFragmentPresenter.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:BookApi.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:SubCategoryFragment.java

示例7: showRankList

import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
@Override
public void showRankList(BooksByCats data) {
    mAdapter.clear();
    mAdapter.addAll(data.books);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:SubRankFragment.java

示例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);
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:BookApiService.java

示例9: showCategoryList

import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
void showCategoryList(BooksByCats data, boolean isRefresh); 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:2,代码来源:SubCategoryFragmentContract.java

示例10: showRankList

import com.justwayward.reader.bean.BooksByCats; //导入依赖的package包/类
void showRankList(BooksByCats data); 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:2,代码来源:SubRankContract.java


注:本文中的com.justwayward.reader.bean.BooksByCats类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。