mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
6130edfe31
commit
2463966583
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user