當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。