换源添加是否校验作者选项

pull/933/head
gedoor 4 years ago
parent eb7b9284ac
commit 84b6fcc6db
  1. 9
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceAdapter.kt
  2. 7
      app/src/main/res/layout/item_change_source.xml

@ -5,7 +5,6 @@ import android.os.Bundle
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import androidx.core.view.isGone
import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.DiffUtil
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.adapter.DiffRecyclerAdapter import io.legado.app.base.adapter.DiffRecyclerAdapter
@ -51,13 +50,7 @@ class ChangeSourceAdapter(
binding.apply { binding.apply {
if (bundle == null) { if (bundle == null) {
tvOrigin.text = item.originName tvOrigin.text = item.originName
val author = if (item.author.isEmpty()) { tvAuthor.text = item.author
context.getString(R.string.empty)
} else {
item.author
}
tvAuthor.text = context.getString(R.string.author_show, author)
tvAuthor.isGone = viewModel.author == item.author
tvLast.text = item.getDisplayLastChapterTitle() tvLast.text = item.getDisplayLastChapterTitle()
if (callBack.bookUrl == item.bookUrl) { if (callBack.bookUrl == item.bookUrl) {
ivChecked.visible() ivChecked.visible()

@ -23,7 +23,6 @@
android:singleLine="true" android:singleLine="true"
android:textColor="@color/primaryText" android:textColor="@color/primaryText"
android:maxWidth="160dp" android:maxWidth="160dp"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toLeftOf="@+id/iv_checked" /> app:layout_constraintRight_toLeftOf="@+id/iv_checked" />
@ -40,9 +39,9 @@
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_checked" android:id="@+id/iv_checked"
android:layout_width="24dp" android:layout_width="40dp"
android:layout_height="24dp" android:layout_height="40dp"
android:layout_margin="8dp" android:padding="8dp"
android:src="@drawable/ic_check" android:src="@drawable/ic_check"
android:visibility="invisible" android:visibility="invisible"
app:tint="@color/primaryText" app:tint="@color/primaryText"

Loading…
Cancel
Save