diff --git a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt index 90d15092c..24e1e98d1 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt @@ -212,23 +212,22 @@ class ImportBookSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_vie else -> "已有" } } - } override fun registerListener(holder: ItemViewHolder, binding: ItemSourceImportBinding) { binding.apply { - root.onClick { - cbSourceName.isChecked = !cbSourceName.isChecked - viewModel.selectStatus[holder.layoutPosition] = cbSourceName.isChecked - upSelectText() - } cbSourceName.setOnCheckedChangeListener { buttonView, isChecked -> if (buttonView.isPressed) { viewModel.selectStatus[holder.layoutPosition] = isChecked upSelectText() } } - tvSee.setOnClickListener { + root.onClick { + cbSourceName.isChecked = !cbSourceName.isChecked + viewModel.selectStatus[holder.layoutPosition] = cbSourceName.isChecked + upSelectText() + } + tvOpen.setOnClickListener { val source = viewModel.allSources[holder.layoutPosition] showDialogFragment(CodeDialog(GSON.toJson(source))) } diff --git a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt index 5433ed90a..94635bf12 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportReplaceRuleDialog.kt @@ -27,6 +27,7 @@ import io.legado.app.ui.widget.dialog.CodeDialog import io.legado.app.ui.widget.dialog.WaitDialog import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding +import splitties.views.onClick class ImportReplaceRuleDialog() : BaseDialogFragment(R.layout.dialog_recycler_view), Toolbar.OnMenuItemClickListener { @@ -216,7 +217,12 @@ class ImportReplaceRuleDialog() : BaseDialogFragment(R.layout.dialog_recycler_vi upSelectText() } } - tvSee.setOnClickListener { + root.onClick { + cbSourceName.isChecked = !cbSourceName.isChecked + viewModel.selectStatus[holder.layoutPosition] = cbSourceName.isChecked + upSelectText() + } + tvOpen.setOnClickListener { val source = viewModel.allRules[holder.layoutPosition] showDialogFragment(CodeDialog(GSON.toJson(source))) } diff --git a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt index 0d6425161..aa3d0114d 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt @@ -28,6 +28,7 @@ import io.legado.app.ui.widget.dialog.CodeDialog import io.legado.app.ui.widget.dialog.WaitDialog import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding +import splitties.views.onClick /** * 导入rss源弹出窗口 @@ -219,7 +220,12 @@ class ImportRssSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_view upSelectText() } } - tvSee.setOnClickListener { + root.onClick { + cbSourceName.isChecked = !cbSourceName.isChecked + viewModel.selectStatus[holder.layoutPosition] = cbSourceName.isChecked + upSelectText() + } + tvOpen.setOnClickListener { val source = viewModel.allSources[holder.layoutPosition] showDialogFragment(CodeDialog(GSON.toJson(source))) } diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index c1ecf1b85..4a9ec12a9 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -319,7 +319,7 @@ class ReadRssActivity : VMBaseActivity override fun onPageFinished(view: WebView?, url: String?) { super.onPageFinished(view, url) view?.title?.let { title -> - if (title != url && title != view.url && title.isNotBlank()) { + if (title != url && title != view.url && title.isNotBlank() && url != "about:blank") { binding.titleBar.title = title } else { binding.titleBar.title = intent.getStringExtra("title") diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt index 76cd85d35..6a6c08536 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dialog/CodeDialog.kt @@ -5,6 +5,7 @@ import android.view.View import io.legado.app.R import io.legado.app.base.BaseDialogFragment import io.legado.app.databinding.DialogCodeViewBinding +import io.legado.app.lib.theme.primaryColor import io.legado.app.ui.widget.code.addJsPattern import io.legado.app.ui.widget.code.addJsonPattern import io.legado.app.ui.widget.code.addLegadoPattern @@ -15,6 +16,7 @@ class CodeDialog() : BaseDialogFragment(R.layout.dialog_code_view) { constructor(code: String) : this() { arguments = Bundle().apply { + putString("code", code) } } @@ -27,6 +29,7 @@ class CodeDialog() : BaseDialogFragment(R.layout.dialog_code_view) { } override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { + binding.toolBar.setBackgroundColor(primaryColor) binding.codeView.addLegadoPattern() binding.codeView.addJsonPattern() binding.codeView.addJsPattern() diff --git a/app/src/main/res/layout/dialog_code_view.xml b/app/src/main/res/layout/dialog_code_view.xml index baffc4129..411ac4a8c 100644 --- a/app/src/main/res/layout/dialog_code_view.xml +++ b/app/src/main/res/layout/dialog_code_view.xml @@ -1,8 +1,19 @@ - + xmlns:app="http://schemas.android.com/apk/res-auto" + android:background="@color/background" + android:orientation="vertical"> + + - + diff --git a/app/src/main/res/layout/item_source_import.xml b/app/src/main/res/layout/item_source_import.xml index 43bdf3be0..126ba43d2 100644 --- a/app/src/main/res/layout/item_source_import.xml +++ b/app/src/main/res/layout/item_source_import.xml @@ -1,17 +1,23 @@ - + android:padding="8dp"> - - + android:textColor="@color/secondaryText" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toRightOf="@id/cb_source_name" + app:layout_constraintRight_toLeftOf="@id/tv_open" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintHorizontal_chainStyle="packed" /> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 7ac691939..5acc3a45c 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -896,5 +896,6 @@ 打开方式 是否使用外部浏览器打开? 查看 + 打开 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 62662ea4a..4802eec78 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -900,5 +900,6 @@ 打开方式 是否使用外部浏览器打开? 查看 + 打开 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index c253d452e..a3865ec1f 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -900,5 +900,6 @@ 打开方式 是否使用外部浏览器打开? 查看 + 打开 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 01abaf008..cc97e3034 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -897,5 +897,6 @@ 打开方式 是否使用外部浏览器打开? 查看 + 打开 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 95d64c3e9..920870dc0 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -899,5 +899,6 @@ 打开方式 是否使用外部浏览器打开? 查看 + 打开 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 06c175cf9..f1482d9f6 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -899,5 +899,6 @@ 打开方式 是否使用外部浏览器打开? 查看 + 打开 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 54d09a835..6836d9989 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -900,5 +900,6 @@ 打开方式 是否使用外部浏览器打开? 查看 + 打开