diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index d33a363bc..77a75bd6b 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -11,11 +11,12 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! -**2021/09/30** +**2021/10/01** 1. 默认封面名称显示全 2. 发现js错误时可以查看详情 -3. 其它一些优化 +4. 修复rss标题显示url的问题 +5. 长按正文网址可以选择是否外部浏览器打开,会记住选择 **2021/09/29** diff --git a/app/src/main/java/io/legado/app/constant/PreferKey.kt b/app/src/main/java/io/legado/app/constant/PreferKey.kt index 55016befd..956634b09 100644 --- a/app/src/main/java/io/legado/app/constant/PreferKey.kt +++ b/app/src/main/java/io/legado/app/constant/PreferKey.kt @@ -89,6 +89,7 @@ object PreferKey { const val nightBrightness = "nightBrightness" const val expandTextMenu = "expandTextMenu" const val doublePageHorizontal = "doublePageHorizontal" + const val readUrlOpenInBrowser = "readUrlInBrowser" const val cPrimary = "colorPrimary" const val cAccent = "colorAccent" diff --git a/app/src/main/java/io/legado/app/help/AppConfig.kt b/app/src/main/java/io/legado/app/help/AppConfig.kt index 6661cfe0d..db5068c05 100644 --- a/app/src/main/java/io/legado/app/help/AppConfig.kt +++ b/app/src/main/java/io/legado/app/help/AppConfig.kt @@ -182,6 +182,12 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener { appCtx.putPrefInt(PreferKey.barElevation, value) } + var readUrlInBrowser: Boolean + get() = appCtx.getPrefBoolean(PreferKey.readUrlOpenInBrowser) + set(value) { + appCtx.putPrefBoolean(PreferKey.readUrlOpenInBrowser, value) + } + var exportCharset: String get() { val c = appCtx.getPrefString(PreferKey.exportCharset) diff --git a/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt b/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt index 646f6fa1f..81ab6e3e8 100644 --- a/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt +++ b/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt @@ -49,6 +49,8 @@ fun Context.alert( this.setMessage(messageResource) } if (init != null) init() + }.apply { + show() } } diff --git a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt index c063e69db..31a35de9d 100644 --- a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt +++ b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt @@ -66,7 +66,7 @@ class ReadRecordActivity : BaseActivity() { initData() } noButton() - }.show() + } } } @@ -143,7 +143,7 @@ class ReadRecordActivity : BaseActivity() { initData() } noButton() - }.show() + } } } diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt index 377f77834..d0b20507c 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt @@ -160,7 +160,7 @@ class ArrangeBookActivity : VMBaseActivity viewModel.upCanUpdate(adapter.selectedBooks(), true) R.id.menu_update_disable -> @@ -222,7 +222,7 @@ class ArrangeBookActivity : VMBaseActivity() AppConfig.bookExportFileName = alertBinding.editView.text?.toString() } cancelButton() - }.show() + } } private fun getTypeName(): String { @@ -328,7 +328,7 @@ class CacheActivity : VMBaseActivity() AppConfig.exportCharset = alertBinding.editView.text?.toString() ?: "UTF-8" } cancelButton() - }.show() + } } override fun exportProgress(bookUrl: String): Int? { diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 1f015fa9c..f6d634d6e 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -333,7 +333,7 @@ class BookInfoActivity : neutralButton(R.string.delete) { viewModel.bookSource?.setVariable(null) } - }.show() + } } } @@ -358,7 +358,7 @@ class BookInfoActivity : ?.putVariable("custom", null) viewModel.saveBook() } - }.show() + } } } diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt index 6b118b66f..f71e4047f 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt @@ -290,7 +290,7 @@ class ImportBookActivity : VMBaseActivity Unit = { diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 2b9a5600f..3a1214088 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -858,7 +858,7 @@ class ReadBookActivity : ReadBookBaseActivity(), BookRead.setProgress(progress) } noButton() - }.show() + } } private fun skipToSearch(index: Int, indexWithinChapter: Int) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt index 77f882c66..e1424ee7e 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt @@ -202,7 +202,7 @@ abstract class ReadBookBaseActivity : } } noButton() - }.show() + } } } @@ -220,7 +220,7 @@ abstract class ReadBookBaseActivity : } } cancelButton() - }.show() + } } fun showPageAnimConfig(success: () -> Unit) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt index a0b21a93f..d59d913cb 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt @@ -15,6 +15,7 @@ import io.legado.app.R import io.legado.app.constant.PreferKey import io.legado.app.databinding.ViewReadMenuBinding import io.legado.app.help.* +import io.legado.app.lib.dialogs.alert import io.legado.app.lib.theme.* import io.legado.app.model.BookRead import io.legado.app.ui.web.WebViewActivity @@ -141,11 +142,26 @@ class ReadMenu @JvmOverloads constructor( callBack.openSourceEditActivity() } tvChapterUrl.setOnClickListener { - context.startActivity { - val url = tvChapterUrl.text.toString() - putExtra("title", tvChapterName.text) - putExtra("url", url) - IntentData.put(url, BookRead.bookSource?.getHeaderMap(true)) + if (AppConfig.readUrlInBrowser) { + context.openUrl(tvChapterUrl.text.toString().substringBefore(",{")) + } else { + context.startActivity { + val url = tvChapterUrl.text.toString() + putExtra("title", tvChapterName.text) + putExtra("url", url) + IntentData.put(url, BookRead.bookSource?.getHeaderMap(true)) + } + } + } + tvChapterUrl.onLongClick { + context.alert(R.string.Open_fan) { + setMessage(R.string.use_browser_open) + okButton { + AppConfig.readUrlInBrowser = true + } + noButton { + AppConfig.readUrlInBrowser = false + } } } //登录 diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ChineseConverter.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ChineseConverter.kt index 514e0a350..549f21729 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ChineseConverter.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ChineseConverter.kt @@ -44,7 +44,7 @@ class ChineseConverter(context: Context, attrs: AttributeSet?) : StrokeTextView( upUi(i) onChanged?.invoke() } - }.show() + } } fun onChanged(unit: () -> Unit) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt index 0b5b74236..a53d40736 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt @@ -207,7 +207,7 @@ class SpeakEngineDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener ) showDialogFragment(TextDialog(helpStr, TextDialog.Mode.MD)) } - }.show() + } } inner class Adapter(context: Context) : diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt index d720d1e51..7b19c3bad 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt @@ -46,7 +46,7 @@ class TextFontWeightConverter(context: Context, attrs: AttributeSet?) : upUi(i) onChanged?.invoke() } - }.show() + } } fun onChanged(unit: () -> Unit) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt index 24d87f5bf..764776640 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt @@ -164,7 +164,7 @@ class TocRegexDialog() : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { } } cancelButton() - }.show() + } } @SuppressLint("InflateParams") @@ -185,7 +185,7 @@ class TocRegexDialog() : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { } } cancelButton() - }.show() + } } inner class TocRegexAdapter(context: Context) : diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index 86c41850b..efd5eff2d 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -160,7 +160,7 @@ class BookSourceEditActivity : negativeButton(R.string.no) { super.finish() } - }.show() + } } else { super.finish() } diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 275f7116a..d7fc5400f 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -90,7 +90,7 @@ class BookSourceActivity : VMBaseActivity @@ -443,7 +443,7 @@ class BookSourceActivity : VMBaseActivity @@ -295,7 +295,7 @@ class RssSourceActivity : VMBaseActivity(), } } cancelButton() - }.show() + } } override fun delSubscription(ruleSub: RuleSub) { diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 4a816ed21..0941f2c5b 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -893,5 +893,7 @@ 横屏双页 浏览器打开 拷贝url + 打开方式 + 是否使用外部浏览器打开? diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 5c42ba161..caf71576c 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -897,5 +897,7 @@ 横屏双页 浏览器打开 拷贝url + 打开方式 + 是否使用外部浏览器打开? diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index e8ae30aae..d14aba696 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -897,5 +897,7 @@ 横屏双页 浏览器打开 拷贝url + 打开方式 + 是否使用外部浏览器打开? diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 9ccbfa41f..4d6fdf9d9 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -894,5 +894,7 @@ 横屏双页 浏览器打开 拷贝url + 打开方式 + 是否使用外部浏览器打开? diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 88c9f3f9f..9085ebcac 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -896,5 +896,7 @@ 横屏双页 浏览器打开 拷贝url + 打开方式 + 是否使用外部浏览器打开? diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 9b9015346..734dd3c96 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -896,5 +896,7 @@ 横屏双页 浏览器打开 拷贝url + 打开方式 + 是否使用外部浏览器打开? diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8d3a35a22..a066206b5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -897,5 +897,7 @@ 横屏双页 浏览器打开 拷贝url + 打开方式 + 是否使用外部浏览器打开?