Merge remote-tracking branch 'origin/master'

This commit is contained in:
kunfei
2023-02-12 15:09:25 +08:00
16 changed files with 49 additions and 8 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
<!DOCTYPE html><html lang="zh-CN" style="padding: 0;height:100%"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="../favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"><title>Legado Bookshelf</title><link href="css/about.78a74084.css" rel="prefetch"><link href="css/detail.75e977de.css" rel="prefetch"><link href="js/about.5e6543cd.js" rel="prefetch"><link href="js/detail.6d8058ff.js" rel="prefetch"><link href="css/app.e4c919b7.css" rel="preload" as="style"><link href="css/chunk-vendors.57f380c8.css" rel="preload" as="style"><link href="js/app.d3b3a3dc.js" rel="preload" as="script"><link href="js/chunk-vendors.7c711c9e.js" rel="preload" as="script"><link href="css/chunk-vendors.57f380c8.css" rel="stylesheet"><link href="css/app.e4c919b7.css" rel="stylesheet"></head><style>body::-webkit-scrollbar {
<!DOCTYPE html><html lang="zh-CN" style="padding: 0;height:100%"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="icon" href="../favicon.ico" type="image/x-icon"><link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"><title>Legado Bookshelf</title><link href="css/about.78a74084.css" rel="prefetch"><link href="css/detail.a52390c0.css" rel="prefetch"><link href="js/about.098470f0.js" rel="prefetch"><link href="js/detail.49778394.js" rel="prefetch"><link href="css/app.e4c919b7.css" rel="preload" as="style"><link href="css/chunk-vendors.57f380c8.css" rel="preload" as="style"><link href="js/app.6608cc19.js" rel="preload" as="script"><link href="js/chunk-vendors.7c711c9e.js" rel="preload" as="script"><link href="css/chunk-vendors.57f380c8.css" rel="stylesheet"><link href="css/app.e4c919b7.css" rel="stylesheet"></head><style>body::-webkit-scrollbar {
display: none;
}</style><body style="margin: 0;height:100%"><noscript><strong>We're sorry but yd-web-tool doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.7c711c9e.js"></script><script src="js/app.d3b3a3dc.js"></script></body></html>
}</style><body style="margin: 0;height:100%"><noscript><strong>We're sorry but yd-web-tool doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.7c711c9e.js"></script><script src="js/app.6608cc19.js"></script></body></html>
File diff suppressed because one or more lines are too long
@@ -123,6 +123,7 @@ object PreferKey {
const val audioPlayWakeLock = "audioPlayWakeLock"
const val readAloudWakeLock = "readAloudWakeLock"
const val showLastUpdateTime = "showLastUpdateTime"
const val clearWebViewData = "clearWebViewData"
const val cPrimary = "colorPrimary"
const val cAccent = "colorAccent"
@@ -1,6 +1,7 @@
package io.legado.app.ui.config
import android.app.Application
import android.content.Context
import io.legado.app.R
import io.legado.app.base.BaseViewModel
import io.legado.app.help.AppWebDav
@@ -25,5 +26,13 @@ class ConfigViewModel(application: Application) : BaseViewModel(application) {
}
}
fun clearWebViewData() {
execute {
FileUtils.delete(context.getDir("webview", Context.MODE_PRIVATE))
}.onSuccess {
context.toastOnUi(R.string.success)
}
}
}
}
@@ -2,6 +2,7 @@ package io.legado.app.ui.config
import android.annotation.SuppressLint
import android.content.ComponentName
import android.content.Context
import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.os.Bundle
@@ -131,6 +132,7 @@ class OtherConfigFragment : PreferenceFragment(),
AppConfig.sourceEditMaxLine = it
}
}
PreferKey.clearWebViewData -> clearWebViewData()
}
return super.onPreferenceTreeClick(preference)
}
@@ -230,6 +232,15 @@ class OtherConfigFragment : PreferenceFragment(),
}
}
private fun clearWebViewData() {
alert(R.string.clear_webview_data, R.string.sure_del) {
okButton {
viewModel.clearWebViewData()
}
noButton()
}
}
private fun isProcessTextEnabled(): Boolean {
return packageManager.getComponentEnabledSetting(componentName) != PackageManager.COMPONENT_ENABLED_STATE_DISABLED
}
@@ -1069,4 +1069,6 @@
<string name="c_blacklist">黑名单(contentBlacklist)</string>
<string name="confirm">确认</string>
<string name="jump_to_another_app">跳转其它应用</string>
<string name="clear_webview_data">清除 WebView 数据</string>
<string name="clear_webview_data_summary">清除内置浏览器所有数据</string>
</resources>
@@ -1072,4 +1072,6 @@
<string name="c_blacklist">黑名单(contentBlacklist)</string>
<string name="confirm">确认</string>
<string name="jump_to_another_app">跳转其它应用</string>
<string name="clear_webview_data">清除 WebView 数据</string>
<string name="clear_webview_data_summary">清除内置浏览器所有数据</string>
</resources>
@@ -1072,4 +1072,6 @@
<string name="c_blacklist">黑名单(contentBlacklist)</string>
<string name="confirm">确认</string>
<string name="jump_to_another_app">跳转其它应用</string>
<string name="clear_webview_data">清除 WebView 数据</string>
<string name="clear_webview_data_summary">清除内置浏览器所有数据</string>
</resources>
@@ -1069,4 +1069,6 @@
<string name="c_blacklist">黑名单(contentBlacklist)</string>
<string name="confirm">确认</string>
<string name="jump_to_another_app">跳转其它应用</string>
<string name="clear_webview_data">清除 WebView 数据</string>
<string name="clear_webview_data_summary">清除内置浏览器所有数据</string>
</resources>
@@ -1071,4 +1071,6 @@
<string name="c_blacklist">黑名单(contentBlacklist)</string>
<string name="confirm">确认</string>
<string name="jump_to_another_app">跳转其它应用</string>
<string name="clear_webview_data">清除 WebView 数据</string>
<string name="clear_webview_data_summary">清除内置浏览器所有数据</string>
</resources>
+2
View File
@@ -1071,4 +1071,6 @@
<string name="c_blacklist">黑名单(contentBlacklist)</string>
<string name="confirm">确认</string>
<string name="jump_to_another_app">跳转其它应用</string>
<string name="clear_webview_data">清除 WebView 数据</string>
<string name="clear_webview_data_summary">清除内置浏览器所有数据</string>
</resources>
+4 -2
View File
@@ -1057,8 +1057,8 @@
<string name="audio_play_wake_lock">Audio service wake-up lock</string>
<string name="audio_play_wake_lock_summary">The wake-up lock is enabled when playing audio, and some phones will be killed when the wake-up lock is turned on.</string>
<string name="change_search_scope">Toggle search scope</string>
<string name="copy_rule">Copy Rul</string>
<string name="paste_rule">Paste Rul</string>
<string name="copy_rule">Copy Rule</string>
<string name="paste_rule">Paste Rule</string>
<string name="groups_or_source">Multi-group / book source</string>
<string name="replace_state_change">Replace (enable / disable)</string>
<string name="show_last_update_time">Show last updated time</string>
@@ -1072,4 +1072,6 @@
<string name="c_blacklist">黑名单(contentBlacklist)</string>
<string name="confirm">Confirm</string>
<string name="jump_to_another_app">Jump to another app</string>
<string name="clear_webview_data">清除 WebView 数据</string>
<string name="clear_webview_data_summary">清除内置浏览器所有数据</string>
</resources>
@@ -145,6 +145,12 @@
android:title="@string/clear_cache"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="clearWebViewData"
android:summary="@string/clear_webview_data_summary"
android:title="@string/clear_webview_data"
app:iconSpaceReserved="false" />
<io.legado.app.lib.prefs.Preference
android:key="threadCount"
android:title="@string/threads_num_title"