當前位置: 首頁>>代碼示例>>Java>>正文


Java BooksByTag類代碼示例

本文整理匯總了Java中com.justwayward.reader.bean.BooksByTag的典型用法代碼示例。如果您正苦於以下問題:Java BooksByTag類的具體用法?Java BooksByTag怎麽用?Java BooksByTag使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BooksByTag類屬於com.justwayward.reader.bean包,在下文中一共展示了BooksByTag類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBindData

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
@Override
protected void onBindData(final EasyRVHolder holder, final int position, final BooksByTag.TagBook item) {
    StringBuffer sbTags = new StringBuffer();
    for (String tag : item.tags) {
        if (!TextUtils.isEmpty(tag)) {
            sbTags.append(tag);
            sbTags.append(" | ");
        }
    }

    holder.setRoundImageUrl(R.id.ivBookCover, Constant.IMG_BASE_URL + item.cover, R.drawable.cover_default)
            .setText(R.id.tvBookListTitle, item.title)
            .setText(R.id.tvShortIntro, item.shortIntro)
            .setText(R.id.tvTags, (item.tags.size() == 0 ? "" : sbTags.substring(0, sbTags
                    .lastIndexOf(" | "))));

    holder.setOnItemViewClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            itemClickListener.onItemClick(holder.getItemView(), position, item);
        }
    });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:24,代碼來源:BooksByTagAdapter.java

示例2: getBooksByTag

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
@Override
public void getBooksByTag(String tags, final String start, String limit) {
    if (!isLoading) {
        isLoading = true;
        String key = StringUtils.creatAcacheKey("books-by-tag", tags, start, limit);
        Observable<BooksByTag> fromNetWork = bookApi.getBooksByTag(tags, start, limit)
                .compose(RxUtil.<BooksByTag>rxCacheListHelper(key));

        //依次檢查disk、network
        Subscription rxSubscription = Observable.concat(RxUtil.rxCreateDiskObservable(key, BooksByTag.class), fromNetWork)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Observer<BooksByTag>() {
                    @Override
                    public void onNext(BooksByTag data) {
                        if (data != null) {
                            List<BooksByTag.TagBook> list = data.books;
                            if (list != null && !list.isEmpty() && mView != null) {
                                boolean isRefresh = start.equals("0") ? true : false;
                                mView.showBooksByTag(list, isRefresh);
                            }
                        }
                    }

                    @Override
                    public void onCompleted() {
                        isLoading = false;
                        mView.onLoadComplete(true, "");
                    }

                    @Override
                    public void onError(Throwable e) {
                        LogUtils.e(e.toString());
                        isLoading = false;
                        mView.onLoadComplete(false, e.toString());
                    }
                });
        addSubscrebe(rxSubscription);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:40,代碼來源:BooksByTagPresenter.java

示例3: getSearchResultList

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
@Override
public void getSearchResultList(String author) {
    String key = StringUtils.creatAcacheKey("search-by-author", author);
    Observable<BooksByTag> fromNetWork = bookApi.searchBooksByAuthor(author)
            .compose(RxUtil.<BooksByTag>rxCacheListHelper(key));

    //依次檢查disk、network
    Subscription rxSubscription = Observable.concat(RxUtil.rxCreateDiskObservable(key, BooksByTag.class), fromNetWork)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Observer<BooksByTag>() {
                @Override
                public void onNext(BooksByTag booksByTag) {
                    if (mView != null)
                        mView.showSearchResultList(booksByTag.books);
                }

                @Override
                public void onCompleted() {
                    LogUtils.i("complete");
                    mView.complete();
                }

                @Override
                public void onError(Throwable e) {
                    LogUtils.e("getSearchResultList:" + e.toString());
                    if (mView != null)
                        mView.showError();
                }
            });
    addSubscrebe(rxSubscription);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:32,代碼來源:SearchByAuthorPresenter.java

示例4: showBooksByTag

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
@Override
public void showBooksByTag(List<BooksByTag.TagBook> list, boolean isRefresh) {
    if (isRefresh)
        mList.clear();
    mList.addAll(list);
    current = mList.size();
    mAdapter.notifyDataSetChanged();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:BooksByTagActivity.java

示例5: showSearchResultList

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
@Override
public void showSearchResultList(List<BooksByTag.TagBook> list) {
    List<SearchDetail.SearchBooks> mList = new ArrayList<>();
    for (BooksByTag.TagBook book : list) {
        mList.add(new SearchDetail.SearchBooks(book._id, book.title, book.author, book.cover, book.retentionRatio, book.latelyFollower));
    }
    mAdapter.clear();
    mAdapter.addAll(mList);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:SearchByAuthorActivity.java

示例6: getBooksByTag

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
@GET("/book/by-tags")
Observable<BooksByTag> getBooksByTag(@Query("tags") String tags, @Query("start") String start, @Query("limit") String limit);
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:3,代碼來源:BookApiService.java

示例7: searchBooksByAuthor

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
public Observable<BooksByTag> searchBooksByAuthor(String author) {
    return service.searchBooksByAuthor(author);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:BookApi.java

示例8: getBooksByTag

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
public Observable<BooksByTag> getBooksByTag(String tags, String start, String limit) {
    return service.getBooksByTag(tags, start, limit);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:BookApi.java

示例9: BooksByTagAdapter

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
public BooksByTagAdapter(Context context, List<BooksByTag.TagBook> list,
                         OnRvItemClickListener listener) {
    super(context, list, R.layout.item_tag_book_list);
    this.itemClickListener = listener;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:BooksByTagAdapter.java

示例10: onItemClick

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
@Override
public void onItemClick(View view, int position, BooksByTag.TagBook data) {
    startActivity(new Intent(BooksByTagActivity.this, BookDetailActivity.class)
            .putExtra("bookId", data._id));
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:BooksByTagActivity.java

示例11: searchBooksByAuthor

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
/**
 * 通過作者查詢書名
 *
 * @param author
 * @return
 */
@GET("/book/accurate-search")
Observable<BooksByTag> searchBooksByAuthor(@Query("author") String author);
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:BookApiService.java

示例12: showBooksByTag

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
void showBooksByTag(List<BooksByTag.TagBook> list, boolean isRefresh); 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:2,代碼來源:BooksByTagContract.java

示例13: showSearchResultList

import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
void showSearchResultList(List<BooksByTag.TagBook> list); 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:2,代碼來源:SearchByAuthorContract.java


注:本文中的com.justwayward.reader.bean.BooksByTag類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。