This commit is contained in:
kunfei 2023-02-05 21:49:15 +08:00
parent d604b96032
commit 80ce5f2c3e
8 changed files with 59 additions and 45 deletions

View File

@ -204,7 +204,7 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
private suspend fun checkNotificationPermission() = suspendCoroutine { block ->
PermissionsCompat.Builder(this)
.addPermissions(Permissions.POST_NOTIFICATIONS)
.rationale("阅读需要发送通知来显示朗读控制和下载进度")
.rationale(R.string.notification_permission_rationale)
.onDenied {
block.resume(null)
}
@ -226,7 +226,7 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
withContext(IO) { AppWebDav.lastBackUp().getOrNull() } ?: return@launch
if (lastBackupFile.lastModify - LocalConfig.lastBackup > DateUtils.MINUTE_IN_MILLIS) {
LocalConfig.lastBackup = lastBackupFile.lastModify
alert("恢复", "webDav书源比本地新,是否恢复") {
alert(R.string.restore, R.string.webdav_after_local_restore_confirm) {
cancelButton()
okButton {
viewModel.restoreWebDav(lastBackupFile.displayName)

View File

@ -1063,4 +1063,6 @@
<string name="tip_divider_color">分隔线颜色</string>
<string name="same_title_removed">移除重复标题</string>
<string name="update_book_fail">更新失败</string>
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
</resources>

View File

@ -1066,4 +1066,6 @@
<string name="tip_divider_color">分隔线颜色</string>
<string name="same_title_removed">移除重复标题</string>
<string name="update_book_fail">更新失败</string>
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
</resources>

View File

@ -1066,4 +1066,6 @@
<string name="tip_divider_color">分隔线颜色</string>
<string name="same_title_removed">移除重复标题</string>
<string name="update_book_fail">更新失败</string>
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
</resources>

View File

@ -1063,4 +1063,6 @@
<string name="tip_divider_color">分隔线颜色</string>
<string name="same_title_removed">移除重复标题</string>
<string name="update_book_fail">更新失败</string>
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
</resources>

View File

@ -1065,4 +1065,6 @@
<string name="tip_divider_color">分隔线颜色</string>
<string name="same_title_removed">移除重复标题</string>
<string name="update_book_fail">更新失败</string>
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
</resources>

View File

@ -1065,4 +1065,6 @@
<string name="tip_divider_color">分隔线颜色</string>
<string name="same_title_removed">移除重复标题</string>
<string name="update_book_fail">更新失败</string>
<string name="notification_permission_rationale">阅读需要发送通知来显示朗读控制和下载进度</string>
<string name="webdav_after_local_restore_confirm">webDav书源比本地新,是否恢复</string>
</resources>

View File

@ -931,66 +931,66 @@
<string name="bg_alpha">Background alpha</string>
<!-- check source config string -->
<string name="check_source_config">校验设置</string>
<string name="check_source_item">校验项目</string>
<string name="check_source_config">Check setting</string>
<string name="check_source_item">Check item</string>
<string name="check_source_timeout">单个书源校验超时(秒)</string>
<string name="timeout">超时</string>
<string name="seconds"></string>
<string name="less_than">小于</string>
<string name="timeout">Timeout</string>
<string name="seconds">Seconds</string>
<string name="less_than">Less than</string>
<string name="check_source_config_summary">校验超时: %1$s秒\n校验项目:%2$s</string>
<string name="record_debug_log">Record debug log</string>
<string name="sub_dir">Sub dir</string>
<string name="general">General</string>
<string name="use_replace">Use replace</string>
<string name="scope_title">作用于标题</string>
<string name="scope_content">作用于正文</string>
<string name="scope_title">Act on the title</string>
<string name="scope_content">Act on the content</string>
<string name="join_qq_channel">Join QQ channel</string>
<string name="qq_channel_summary">点击加入阅读QQ频道</string>
<string name="menu_refresh_dur">刷新当前章节</string>
<string name="menu_refresh_after">刷新之后章节</string>
<string name="menu_refresh_all">刷新全部章节</string>
<string name="menu_refresh_dur">Refresh the current chapter</string>
<string name="menu_refresh_after">Refresh the chapter after</string>
<string name="menu_refresh_all">Refresh all chapters</string>
<string name="edit_content">Edit Content</string>
<string name="chapter_change_source">单章换源</string>
<string name="book_change_source">整书换源</string>
<string name="chapter_change_source">Single chapter source switching</string>
<string name="book_change_source">Change the source of the whole book</string>
<string name="sort_by_time">Sort by time</string>
<string name="enable_record">开启记录</string>
<string name="copy_all">拷贝所有</string>
<string name="auto_complete">自动补全</string>
<string name="copy_all">Copy all</string>
<string name="auto_complete">Automatic completion</string>
<string name="sort_by_size">Sort by size</string>
<string name="welcome_style">启动界面样式</string>
<string name="welcome_style">Launch interface style</string>
<string name="welcome_style_summary">启动界面图片和是否显示文字等</string>
<string name="show_welcome_text">显示文字</string>
<string name="show_welcome_text">Display text</string>
<string name="welcome_text">阅读|享受美好时光</string>
<string name="custom_welcome">自定义欢迎页</string>
<string name="custom_welcome">Customize the welcome page</string>
<string name="custom_welcome_summary">是否使用自定义欢迎页</string>
<string name="show_icon">显示图标</string>
<string name="show_default_book_icon">显示默认书籍图标</string>
<string name="cache_export">缓存/导出</string>
<string name="assists_key_config">辅助按键配置</string>
<string name="url_option">Url参数</string>
<string name="only_wifi">WIFI</string>
<string name="only_wifi_summary">仅在wifi下加载网络封面</string>
<string name="cover_rule">封面规则</string>
<string name="cover_rule_summary">进入详情页时使用封面规则重新获取封面</string>
<string name="scroll_to_dur_source">定位到当前书源</string>
<string name="sys_tts_config">系统tts设置</string>
<string name="sys_tts_config_summary">打开系统tts设置界面</string>
<string name="cannot_timed_non_playback">非播放状态无法定时</string>
<string name="all_bookmark">所有书签</string>
<string name="change_source_batch">批量换源</string>
<string name="book_type_different">书籍类型不一样</string>
<string name="soure_change_source">是否确认换源</string>
<string name="input_verification_code">输入验证码</string>
<string name="verification_code">验证码</string>
<string name="timeout_millisecond">超时毫秒数</string>
<string name="show_icon">Show icon</string>
<string name="show_default_book_icon">Show default book icon</string>
<string name="cache_export">Cache / Export</string>
<string name="assists_key_config">Secondary button configuration</string>
<string name="url_option">Url parameter</string>
<string name="only_wifi">WIFI only</string>
<string name="only_wifi_summary">Load network cover only under wifi</string>
<string name="cover_rule">Cover rule</string>
<string name="cover_rule_summary">Use the cover rule to retrieve the cover when entering the details page</string>
<string name="scroll_to_dur_source">Navigate to the current book source</string>
<string name="sys_tts_config">System tts Settings</string>
<string name="sys_tts_config_summary">Open the system tts settings interface</string>
<string name="cannot_timed_non_playback">When the non-playback state is not legal</string>
<string name="all_bookmark">All bookmarks</string>
<string name="change_source_batch">Batch source switching</string>
<string name="book_type_different">Different types of books</string>
<string name="soure_change_source">Whether to confirm the source change</string>
<string name="input_verification_code">Enter the CAPTCHA</string>
<string name="verification_code">Verification code</string>
<string name="timeout_millisecond">Timed out milliseconds</string>
<string name="file_not_supported">Continue to open although %1$s is not supported ?</string>
<string name="import_tts">导入TTS</string>
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="import_tts">Import TTS</string>
<string name="import_theme">Import theme</string>
<string name="import_txt_toc_rule">Import txt directory rules</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<string name="cookie">清除cookie</string>
<string name="download_and_import_file">导入在线书籍文件</string>
<string name="click_read_button_load">Click to read the load directory</string>
<string name="cookie">Clear cookie</string>
<string name="download_and_import_file">Import online book files</string>
<string name="upload_book_success">Upload Success</string>
<string name="upload_book_fail">Upload Fail</string>
<string name="download_book_success">Download Success</string>
@ -1066,4 +1066,6 @@
<string name="tip_divider_color">Separator color</string>
<string name="same_title_removed">Remove duplicate title</string>
<string name="update_book_fail">Update failed</string>
<string name="notification_permission_rationale">Reading requires sending notifications to show reading control and download progress</string>
<string name="webdav_after_local_restore_confirm">The webDav book source is newer than the local one, whether to restore it or not</string>
</resources>