diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceAdapter.kt index e35f00e89..1222391cc 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceAdapter.kt @@ -51,7 +51,12 @@ class ChangeSourceAdapter( binding.apply { if (bundle == null) { 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 tvLast.text = item.getDisplayLastChapterTitle() if (callBack.bookUrl == item.bookUrl) { diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt index 9040f7d13..dafd9a40f 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt @@ -77,7 +77,12 @@ class ChangeSourceDialog : BaseDialogFragment(), private fun showTitle() { 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() { diff --git a/app/src/main/res/layout/item_change_source.xml b/app/src/main/res/layout/item_change_source.xml index 0bebee9fe..809b2b93d 100644 --- a/app/src/main/res/layout/item_change_source.xml +++ b/app/src/main/res/layout/item_change_source.xml @@ -22,7 +22,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:textColor="@color/primaryText" - android:maxWidth="30dp" + android:maxWidth="160dp" android:visibility="gone" app:layout_constraintTop_toTopOf="parent" app:layout_constraintRight_toLeftOf="@+id/iv_checked" />