From 4f59ec0b5546ce9365a1906af0594829cd9cb9e1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 26 Sep 2022 10:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A6=E6=9E=B6=E7=AE=A1=E7=90=86=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B9=A6=E6=BA=90=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/manage/BookAdapter.kt | 6 ++ app/src/main/res/layout/item_arrange_book.xml | 55 ++++++++++++------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt index 33224a3c6..875832190 100644 --- a/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/manage/BookAdapter.kt @@ -6,6 +6,7 @@ import android.view.View import android.view.ViewGroup import androidx.core.os.bundleOf import androidx.recyclerview.widget.RecyclerView +import io.legado.app.R import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.Book @@ -52,6 +53,11 @@ class BookAdapter(context: Context, val callBack: CallBack) : tvAuthor.visibility = if (item.author.isEmpty()) View.GONE else View.VISIBLE tvGroupS.text = getGroupName(item.group) checkbox.isChecked = selectedBooks.contains(item) + if (item.isLocalBook()) { + tvOrigin.setText(R.string.local_book) + } else { + tvOrigin.text = item.originName + } } } diff --git a/app/src/main/res/layout/item_arrange_book.xml b/app/src/main/res/layout/item_arrange_book.xml index 15e33e291..48ae5a58a 100644 --- a/app/src/main/res/layout/item_arrange_book.xml +++ b/app/src/main/res/layout/item_arrange_book.xml @@ -1,9 +1,10 @@ + app:layout_constraintLeft_toRightOf="@id/checkbox" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintLeft_toRightOf="@+id/tv_name" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="@+id/tv_name" + tools:ignore="RtlHardcoded" /> + + + app:layout_constraintLeft_toRightOf="@+id/tv_origin" + app:layout_constraintRight_toLeftOf="@+id/tv_group" + app:layout_constraintTop_toBottomOf="@id/tv_author" /> + app:layout_constraintRight_toLeftOf="@+id/tv_delete" + app:layout_constraintTop_toBottomOf="@id/tv_author" /> + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_author" /> \ No newline at end of file