From 093beaae8606c4e4f89d396461428f746cb01541 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 12 Aug 2019 17:00:22 +0800 Subject: [PATCH] up --- .../app/ui/bookinfo/BookInfoActivity.kt | 8 +++---- .../app/ui/bookinfo/BookInfoViewModel.kt | 2 ++ .../io/legado/app/ui/search/SearchAdapter.kt | 2 +- .../main/res/layout/activity_book_info.xml | 22 ++++++++++--------- .../main/res/layout/item_bookshelf_list.xml | 4 ++-- app/src/main/res/values/strings.xml | 5 +++-- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt index 104a52dda..0172fea6e 100644 --- a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt @@ -22,10 +22,10 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_boo private fun showBook(book: Book) { tv_name.text = book.name - tv_author.text = book.author - tv_origin.text = book.originName - tv_lasted.text = book.latestChapterTitle - tv_intro.text = book.getDisplayIntro() + tv_author.text = getString(R.string.author_show, book.author) + tv_origin.text = getString(R.string.origin_show, book.originName) + tv_lasted.text = getString(R.string.lasted_show, book.latestChapterTitle) + tv_intro.text = getString(R.string.intro_show, book.getDisplayIntro()) book.getDisplayCover()?.let { ImageLoader.load(this, it) .placeholder(R.drawable.img_cover_default) diff --git a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoViewModel.kt index ea88b145c..eafdc8b70 100644 --- a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoViewModel.kt @@ -10,11 +10,13 @@ import io.legado.app.data.entities.Book class BookInfoViewModel(application: Application) : BaseViewModel(application) { val bookData = MutableLiveData() + var inBookshelf = false fun loadData(intent: Intent) { execute { intent.getStringExtra("bookUrl")?.let { App.db.bookDao().getBook(it)?.let { book -> + inBookshelf = true bookData.postValue(book) } } ?: intent.getStringExtra("searchBookUrl")?.let { diff --git a/app/src/main/java/io/legado/app/ui/search/SearchAdapter.kt b/app/src/main/java/io/legado/app/ui/search/SearchAdapter.kt index c25e3f323..61ebcc5f1 100644 --- a/app/src/main/java/io/legado/app/ui/search/SearchAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/search/SearchAdapter.kt @@ -54,7 +54,7 @@ class SearchAdapter : PagedListAdapter(D if (searchBook.latestChapterTitle.isNullOrEmpty()) { tv_lasted.gone() } else { - tv_lasted.text = context.getString(R.string.book_search_last, searchBook.latestChapterTitle) + tv_lasted.text = context.getString(R.string.lasted_show, searchBook.latestChapterTitle) tv_lasted.visible() } tv_introduce.text = searchBook.intro diff --git a/app/src/main/res/layout/activity_book_info.xml b/app/src/main/res/layout/activity_book_info.xml index 02ceb64a8..c93413b91 100644 --- a/app/src/main/res/layout/activity_book_info.xml +++ b/app/src/main/res/layout/activity_book_info.xml @@ -36,29 +36,29 @@ + android:layout_height="0dp" + android:layout_weight="1" + android:singleLine="true" /> diff --git a/app/src/main/res/layout/item_bookshelf_list.xml b/app/src/main/res/layout/item_bookshelf_list.xml index aaed990db..29b58d03f 100644 --- a/app/src/main/res/layout/item_bookshelf_list.xml +++ b/app/src/main/res/layout/item_bookshelf_list.xml @@ -134,7 +134,7 @@ android:layout_width="@dimen/desc_icon_size" android:layout_height="@dimen/desc_icon_size" android:layout_marginLeft="8dp" - android:contentDescription="@string/book_search_last" + android:contentDescription="@string/lasted_show" android:paddingStart="2dp" android:paddingEnd="2dp" android:src="@drawable/ic_book_last" @@ -150,7 +150,7 @@ android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:singleLine="true" - android:text="@string/book_search_last" + android:text="@string/lasted_show" android:textColor="@color/tv_text_secondary" android:textSize="13sp" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d1b9122c2..10b7bec83 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -65,7 +65,7 @@ 来源: %s 最近: %s 书名 - 最新: %s + 最新: %s 是否将《%s》放入书架? 共%s个Text文件 加载中… @@ -197,8 +197,9 @@ 加载数据中… 加载失败,点击重试 内容简介 + 简介:%s 打开外部书籍 - 来源 + 来源:%s 本地导入 网络导入 书架排序