This commit is contained in:
Horis 2023-12-11 22:23:51 +08:00
parent 635d4360d9
commit 9f5a22f01b
9 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import io.legado.app.help.book.BookHelp
import io.legado.app.utils.FileUtils
import io.legado.app.utils.restart
import io.legado.app.utils.toastOnUi
import kotlinx.coroutines.delay
import splitties.init.appCtx
class ConfigViewModel(application: Application) : BaseViewModel(application) {
@ -32,6 +33,8 @@ class ConfigViewModel(application: Application) : BaseViewModel(application) {
fun clearWebViewData() {
execute {
FileUtils.delete(context.getDir("webview", Context.MODE_PRIVATE))
context.toastOnUi(R.string.clear_webview_data_success)
delay(3000)
appCtx.restart()
}
}

View File

@ -1138,4 +1138,5 @@
<string name="del_h_tag">删除h标签</string>
<string name="adjust_chapter_page">调整本章页数</string>
<string name="adjust_chapter_index">调整章节位置</string>
<string name="clear_webview_data_success">清除成功3秒后自动重启应用</string>
</resources>

View File

@ -1141,4 +1141,5 @@
<string name="del_h_tag">删除h标签</string>
<string name="adjust_chapter_page">调整本章页数</string>
<string name="adjust_chapter_index">调整章节位置</string>
<string name="clear_webview_data_success">清除成功3秒后自动重启应用</string>
</resources>

View File

@ -1141,4 +1141,5 @@
<string name="del_h_tag">删除h标签</string>
<string name="adjust_chapter_page">调整本章页数</string>
<string name="adjust_chapter_index">调整章节位置</string>
<string name="clear_webview_data_success">清除成功3秒后自动重启应用</string>
</resources>

View File

@ -1137,4 +1137,5 @@ Còn </string>
<string name="del_h_tag">删除h标签</string>
<string name="adjust_chapter_page">调整本章页数</string>
<string name="adjust_chapter_index">调整章节位置</string>
<string name="clear_webview_data_success">清除成功3秒后自动重启应用</string>
</resources>

View File

@ -1138,4 +1138,5 @@
<string name="del_h_tag">删除h标签</string>
<string name="adjust_chapter_page">调整本章页数</string>
<string name="adjust_chapter_index">调整章节位置</string>
<string name="clear_webview_data_success">清除成功3秒后自动重启应用</string>
</resources>

View File

@ -1140,4 +1140,5 @@
<string name="del_h_tag">删除h标签</string>
<string name="adjust_chapter_page">调整本章页数</string>
<string name="adjust_chapter_index">调整章节位置</string>
<string name="clear_webview_data_success">清除成功3秒后自动重启应用</string>
</resources>

View File

@ -1140,4 +1140,5 @@
<string name="del_h_tag">删除h标签</string>
<string name="adjust_chapter_page">调整本章页数</string>
<string name="adjust_chapter_index">调整章节位置</string>
<string name="clear_webview_data_success">清除成功3秒后自动重启应用</string>
</resources>

View File

@ -1141,4 +1141,5 @@
<string name="del_h_tag">Delete h tag</string>
<string name="adjust_chapter_page">Adjust of chapter page</string>
<string name="adjust_chapter_index">Adjust of chapter index</string>
<string name="clear_webview_data_success">Cleared successfully, automatically restarts the application after 3 seconds</string>
</resources>