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

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

@ -51,7 +51,12 @@ class ChangeSourceAdapter(
binding.apply { binding.apply {
if (bundle == null) { if (bundle == null) {
tvOrigin.text = item.originName tvOrigin.text = item.originName
tvAuthor.text = context.getString(R.string.author_show, item.author) val author = if (item.author.isEmpty()) {
context.getString(R.string.empty)
} else {
item.author
}
tvAuthor.text = context.getString(R.string.author_show, author)
tvAuthor.isGone = viewModel.author == item.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) {

@ -77,7 +77,12 @@ class ChangeSourceDialog : BaseDialogFragment(),
private fun showTitle() { private fun showTitle() {
binding.toolBar.title = viewModel.name binding.toolBar.title = viewModel.name
binding.toolBar.subtitle = getString(R.string.author_show, viewModel.author) val author = if (viewModel.author.isBlank()) {
getString(R.string.empty)
} else {
viewModel.author
}
binding.toolBar.subtitle = getString(R.string.author_show, author)
} }
private fun initMenu() { private fun initMenu() {

@ -22,7 +22,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/primaryText" android:textColor="@color/primaryText"
android:maxWidth="30dp" android:maxWidth="160dp"
android:visibility="gone" 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" />

Loading…
Cancel
Save