本文整理匯總了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);
}
});
}
示例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);
}
}
示例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);
}
示例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();
}
示例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);
}
示例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);
示例7: searchBooksByAuthor
import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
public Observable<BooksByTag> searchBooksByAuthor(String author) {
return service.searchBooksByAuthor(author);
}
示例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);
}
示例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;
}
示例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));
}
示例11: searchBooksByAuthor
import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
/**
* 通過作者查詢書名
*
* @param author
* @return
*/
@GET("/book/accurate-search")
Observable<BooksByTag> searchBooksByAuthor(@Query("author") String author);
示例12: showBooksByTag
import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
void showBooksByTag(List<BooksByTag.TagBook> list, boolean isRefresh);
示例13: showSearchResultList
import com.justwayward.reader.bean.BooksByTag; //導入依賴的package包/類
void showSearchResultList(List<BooksByTag.TagBook> list);