From ec102a5cd20269c9098ae462722b0cca13adacd9 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 10 Jul 2021 19:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 21 ------------------- .../java/io/legado/app/base/BaseService.kt | 13 ++++++++++++ .../io/legado/app/service/DownloadService.kt | 5 ----- .../app/service/HttpReadAloudService.kt | 7 ------- .../legado/app/service/TTSReadAloudService.kt | 7 ------- 5 files changed, 13 insertions(+), 40 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 8c8574e41..77ec900db 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -81,10 +81,6 @@ chapter.html的关键字有{title}、{content} 其他html文件的关键字有{name}、{author}、{intro}、{kind}、{wordCount} ``` -**2021/05/26** -* 书签绑定书名与作者 -* 修复详情页目录问题 - **2021/05/24** * 反转目录后刷新内容 * 修复上下滑动会导致左右切换问题 @@ -267,9 +263,6 @@ chapter.html的关键字有{title}、{content} * 选择文字时优先选词 * 优化进度同步,进入书籍时同步,每次同步单本书,减少同步文件大小 -**2020/12/06** -* 添加规则订阅功能,订阅界面第一个图标,可以订阅书源/订阅源/替换规则 - **2020/12/04** * 阅读进度从页数改为字数,排版变化时定位更准确 * 修改viewBinding @@ -290,14 +283,6 @@ chapter.html的关键字有{title}、{content} base64DecodeToByteArray(str: String?): ByteArray? base64DecodeToByteArray(str: String?, flags: Int): ByteArray? ``` -* 导出添加替换净化 -* 修复正文内容TalkBack不对的bug,优化视障使用体验 - -**2020/11/08** -* 优化书源,订阅源导入,添加保持原名选项 -* 优化使用体验,初次使用是自动弹出帮助文档 -* 添加阅读界面的点击区域设置 -* 滚动翻页时自动翻页也采用滚动模式 **2020/11/07** * 详情页菜单添加拷贝URL @@ -308,12 +293,6 @@ base64DecodeToByteArray(str: String?, flags: Int): ByteArray? * 自动分段优化 by [tumuyan](https://github.com/tumuyan) * web支持图片显示 by [六月](https://github.com/Celeter) -**2020/10/27** -* 点击书籍分组可显示书籍数量 -* 升级到SDK30 -* 修复8.0不显示默认背景图片的bug -* 添加排版命名 - **2020/10/24** * 修复选择错误的bug * 修复长图最后一张不能滚动的bug diff --git a/app/src/main/java/io/legado/app/base/BaseService.kt b/app/src/main/java/io/legado/app/base/BaseService.kt index 192737447..1ed5077c3 100644 --- a/app/src/main/java/io/legado/app/base/BaseService.kt +++ b/app/src/main/java/io/legado/app/base/BaseService.kt @@ -3,6 +3,7 @@ package io.legado.app.base import android.app.Service import android.content.Intent import android.os.IBinder +import androidx.annotation.CallSuper import io.legado.app.help.coroutine.Coroutine import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -18,10 +19,22 @@ abstract class BaseService : Service(), CoroutineScope by MainScope() { block: suspend CoroutineScope.() -> T ) = Coroutine.async(scope, context) { block() } + @CallSuper + override fun onCreate() { + super.onCreate() + } + + @CallSuper + override fun onTaskRemoved(rootIntent: Intent?) { + super.onTaskRemoved(rootIntent) + stopSelf() + } + override fun onBind(intent: Intent?): IBinder? { return null } + @CallSuper override fun onDestroy() { super.onDestroy() cancel() diff --git a/app/src/main/java/io/legado/app/service/DownloadService.kt b/app/src/main/java/io/legado/app/service/DownloadService.kt index 990271808..156f9eccf 100644 --- a/app/src/main/java/io/legado/app/service/DownloadService.kt +++ b/app/src/main/java/io/legado/app/service/DownloadService.kt @@ -44,11 +44,6 @@ class DownloadService : BaseService() { registerReceiver(downloadReceiver, IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)) } - override fun onTaskRemoved(rootIntent: Intent?) { - super.onTaskRemoved(rootIntent) - stopSelf() - } - override fun onDestroy() { super.onDestroy() unregisterReceiver(downloadReceiver) diff --git a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt index bccf89319..0bdebe5a0 100644 --- a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt @@ -1,9 +1,7 @@ package io.legado.app.service import android.app.PendingIntent -import android.content.Intent import android.media.MediaPlayer - import io.legado.app.constant.EventBus import io.legado.app.help.AppConfig import io.legado.app.help.IntentHelp @@ -40,11 +38,6 @@ class HttpReadAloudService : BaseReadAloudService(), player.setOnCompletionListener(this) } - override fun onTaskRemoved(rootIntent: Intent?) { - super.onTaskRemoved(rootIntent) - stopSelf() - } - override fun onDestroy() { super.onDestroy() task?.cancel() diff --git a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt index 60cb11bdf..d814d4e09 100644 --- a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt @@ -1,7 +1,6 @@ package io.legado.app.service import android.app.PendingIntent -import android.content.Intent import android.speech.tts.TextToSpeech import android.speech.tts.UtteranceProgressListener import io.legado.app.R @@ -29,12 +28,6 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener upSpeechRate() } - override fun onTaskRemoved(rootIntent: Intent?) { - super.onTaskRemoved(rootIntent) - clearTTS() - stopSelf() - } - override fun onDestroy() { super.onDestroy() clearTTS()