优化发现书籍显示

master^2
fengyuecanzhu 2 years ago
parent f7c47d5783
commit cb19cf19f3
No known key found for this signature in database
GPG Key ID: 04B78AD06A9D6E6C
  1. 1
      .idea/misc.xml
  2. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  3. 6
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/FindBookHolder.java

@ -3,6 +3,7 @@
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/android/FYReader/app/src/main/res/drawable/ic_bookstore.xml" value="0.1" />
<entry key="..\:/android/FYReader/app/src/main/res/drawable/ic_check.xml" value="0.118" />
<entry key="..\:/android/FYReader/app/src/main/res/drawable/ic_cloud_download.xml" value="0.118" />
<entry key="..\:/android/FYReader/app/src/main/res/drawable/ic_download.xml" value="0.118" />

@ -426,7 +426,7 @@ public class BookDetailedActivity extends BaseActivity<ActivityBookDetailBinding
BookSource source = BookSourceManager.getBookSourceByStr(mBook.getSource());
binding.ih.bookDetailSource.setText(String.format("书源:%s", source.getSourceName()));
ReadCrawler rc = ReadCrawlerUtil.getReadCrawler(source);
if (rc instanceof BookInfoCrawler) {
if (rc instanceof BookInfoCrawler && !isCollected) {
binding.pbLoading.setVisibility(View.VISIBLE);
BookInfoCrawler bic = (BookInfoCrawler) rc;
BookApi.getBookInfo(mBook, bic).compose(RxUtils::toSimpleSingle).subscribe(new MyObserver<Book>() {

@ -103,6 +103,7 @@ public class FindBookHolder extends ViewHolderImpl<Book> {
initTagList(data);
if (!StringHelper.isEmpty(data.getNewestChapterTitle())) {
tvNewestChapter.setText(getContext().getString(R.string.newest_chapter, data.getNewestChapterTitle()));
tvNewestChapter.setVisibility(View.VISIBLE);
} else {
data.setNewestChapterTitle("");
tvNewestChapter.setText("");
@ -110,6 +111,7 @@ public class FindBookHolder extends ViewHolderImpl<Book> {
}
if (!StringHelper.isEmpty(data.getDesc())) {
tvDesc.setText(String.format("简介:%s", data.getDesc()));
tvDesc.setVisibility(View.VISIBLE);
} else {
data.setDesc("");
tvDesc.setText("");
@ -134,14 +136,14 @@ public class FindBookHolder extends ViewHolderImpl<Book> {
private void initOtherInfo(Book book, ReadCrawler rc) {
//简介
if (StringHelper.isEmpty(tvDesc.getText().toString())) {
tvNewestChapter.setVisibility(View.VISIBLE);
tvDesc.setText(String.format("简介:%s", book.getDesc()));
tvNewestChapter.setVisibility(View.VISIBLE);
} else {
tvNewestChapter.setVisibility(View.GONE);
}
if (StringHelper.isEmpty(tvNewestChapter.getText().toString())) {
tvNewestChapter.setVisibility(View.VISIBLE);
tvNewestChapter.setText(getContext().getString(R.string.newest_chapter, book.getNewestChapterTitle()));
tvNewestChapter.setVisibility(View.VISIBLE);
} else {
tvNewestChapter.setVisibility(View.GONE);
}

Loading…
Cancel
Save