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


Java BookLists类代码示例

本文整理汇总了Java中com.justwayward.reader.bean.BookLists的典型用法代码示例。如果您正苦于以下问题:Java BookLists类的具体用法?Java BookLists怎么用?Java BookLists使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BookLists类属于com.justwayward.reader.bean包,在下文中一共展示了BookLists类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addCollection

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
public void addCollection(BookLists.BookListsBean bean) {
    List<BookLists.BookListsBean> list = getCollectionList();
    if (list == null) {
        list = new ArrayList<>();
    }
    for (BookLists.BookListsBean data : list) {
        if (data != null) {
            if (TextUtils.equals(data._id, bean._id)) {
                ToastUtils.showToast("已经收藏过啦");
                return;
            }
        }
    }
    list.add(bean);
    ACache.get(ReaderApplication.getsInstance()).put(getCollectionKey(), (Serializable) list);
    ToastUtils.showToast("收藏成功");
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:CacheManager.java

示例2: OnCreateViewHolder

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
@Override
public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
    return new BaseViewHolder<BookLists.BookListsBean>(parent, R.layout.item_sub_category_list) {
        @Override
        public void setData(BookLists.BookListsBean 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)
                    .setText(R.id.tvSubCateShort, item.desc)
                    .setText(R.id.tvSubCateMsg, String.format(mContext.getResources().getString(R.string.subject_book_msg), item.bookCount, item.collectorCount));
        }
    };
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:SubjectBookListAdapter.java

示例3: onItemClick

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
@Override
public void onItemClick(View view, int position, Object data) {
    if (data instanceof HotReview.Reviews) {
        BookDiscussionDetailActivity.startActivity(this, ((HotReview.Reviews) data)._id);
    } else if (data instanceof RecommendBookList.RecommendBook) {
        RecommendBookList.RecommendBook recommendBook = (RecommendBookList.RecommendBook) data;

        BookLists bookLists = new BookLists();
        BookLists.BookListsBean bookListsBean = bookLists.new BookListsBean();
        bookListsBean._id = recommendBook.id;
        bookListsBean.author = recommendBook.author;
        bookListsBean.bookCount = recommendBook.bookCount;
        bookListsBean.collectorCount = recommendBook.collectorCount;
        bookListsBean.cover = recommendBook.cover;
        bookListsBean.desc = recommendBook.desc;
        bookListsBean.title = recommendBook.title;

        SubjectBookListDetailActivity.startActivity(this, bookListsBean);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:BookDetailActivity.java

示例4: removeCollection

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
public void removeCollection(String bookListId) {
    List<BookLists.BookListsBean> list = getCollectionList();
    if (list == null) {
        return;
    }
    for (BookLists.BookListsBean bean : list) {
        if (bean != null) {
            if (TextUtils.equals(bean._id, bookListId)) {
                list.remove(bean);
                ACache.get(ReaderApplication.getsInstance()).put(getCollectionKey(), (Serializable) list);
                break;
            }
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:CacheManager.java

示例5: showBookList

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
@Override
public void showBookList(List<BookLists.BookListsBean> bookLists, boolean isRefresh) {
    if (isRefresh) {
        mAdapter.clear();
        start = 0;
    }
    mAdapter.addAll(bookLists);
    start = start + bookLists.size();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:SubjectFragment.java

示例6: getBookLists

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
@Override
public void getBookLists(String duration, String sort, final int start, int limit, String tag, String gender) {
    String key = StringUtils.creatAcacheKey("book-lists", duration, sort, start + "", limit + "", tag, gender);
    Observable<BookLists> fromNetWork = bookApi.getBookLists(duration, sort, start + "", limit + "", tag, gender)
            .compose(RxUtil.<BookLists>rxCacheListHelper(key));

    //依次检查disk、network
    Subscription rxSubscription = Observable.concat(RxUtil.rxCreateDiskObservable(key, BookLists.class), fromNetWork)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Observer<BookLists>() {
                @Override
                public void onCompleted() {
                    mView.complete();
                }

                @Override
                public void onError(Throwable e) {
                    LogUtils.e("getBookLists:" + e.toString());
                    mView.showError();
                }

                @Override
                public void onNext(BookLists tags) {
                    mView.showBookList(tags.bookLists, start == 0 ? true : false);
                    if (tags.bookLists == null || tags.bookLists.size() <= 0) {
                        ToastUtils.showSingleToast("暂无相关书单");
                    }
                }
            });
    addSubscrebe(rxSubscription);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:32,代码来源:SubjectFragmentPresenter.java

示例7: onRefresh

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
@Override
public void onRefresh() {
    super.onRefresh();
    List<BookLists.BookListsBean> data = CacheManager.getInstance().getCollectionList();
    mAdapter.clear();
    mAdapter.addAll(data);
    mRecyclerView.setRefreshing(false);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:MyBookListActivity.java

示例8: getCollectionList

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
/**
 * 获取我收藏的书单列表
 *
 * @return
 */
public List<BookLists.BookListsBean> getCollectionList() {
    List<BookLists.BookListsBean> list = (ArrayList<BookLists.BookListsBean>) ACache.get(
            ReaderApplication.getsInstance()).getAsObject(getCollectionKey());
    return list == null ? null : list;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:CacheManager.java

示例9: getBookLists

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
public Observable<BookLists> getBookLists(String duration, String sort, String start, String limit, String tag, String gender) {
    return service.getBookLists(duration, sort, start, limit, tag, gender);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:BookApi.java

示例10: startActivity

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
public static void startActivity(Context context, BookLists.BookListsBean bookListsBean) {
    context.startActivity(new Intent(context, SubjectBookListDetailActivity.class)
            .putExtra(INTENT_BEAN, bookListsBean));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:SubjectBookListDetailActivity.java

示例11: initDatas

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
@Override
public void initDatas() {
    bookListsBean = (BookLists.BookListsBean) getIntent().getSerializableExtra(INTENT_BEAN);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:SubjectBookListDetailActivity.java

示例12: getBookLists

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
/**
 * 获取主题书单列表
 * 本周最热:duration=last-seven-days&sort=collectorCount
 * 最新发布:duration=all&sort=created
 * 最多收藏:duration=all&sort=collectorCount
 *
 * @param tag    都市、古代、架空、重生、玄幻、网游
 * @param gender male、female
 * @param limit  20
 * @return
 */
@GET("/book-list")
Observable<BookLists> getBookLists(@Query("duration") String duration, @Query("sort") String sort, @Query("start") String start, @Query("limit") String limit, @Query("tag") String tag, @Query("gender") String gender);
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:BookApiService.java

示例13: showBookList

import com.justwayward.reader.bean.BookLists; //导入依赖的package包/类
void showBookList(List<BookLists.BookListsBean> bookLists, boolean isRefresh); 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:2,代码来源:SubjectFragmentContract.java


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