From edf5890cb143a989695422539cab9187b108f003 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 10 Feb 2022 23:08:05 +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/java/io/legado/app/api/ReaderProvider.kt | 1 - app/src/main/java/io/legado/app/help/ContentHelp.kt | 1 - app/src/main/java/io/legado/app/help/LifecycleHelp.kt | 1 - .../main/java/io/legado/app/help/SourceAnalyzer.kt | 1 - .../java/io/legado/app/help/http/BackstageWebView.kt | 3 ++- .../main/java/io/legado/app/lib/permission/Request.kt | 1 - .../main/java/io/legado/app/lib/theme/ThemeUtils.kt | 2 +- app/src/main/java/io/legado/app/lib/webdav/WebDav.kt | 3 +-- app/src/main/java/io/legado/app/model/CheckSource.kt | 2 +- app/src/main/java/io/legado/app/model/Debug.kt | 1 - .../legado/app/model/analyzeRule/AnalyzeByJSonPath.kt | 2 -- .../io/legado/app/model/analyzeRule/AnalyzeByRegex.kt | 1 - .../io/legado/app/model/analyzeRule/AnalyzeByXPath.kt | 1 - .../io/legado/app/model/analyzeRule/AnalyzeRule.kt | 2 -- .../io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 2 -- .../java/io/legado/app/model/localBook/EpubFile.kt | 1 - .../java/io/legado/app/model/localBook/LocalBook.kt | 1 - .../java/io/legado/app/model/localBook/UmdFile.kt | 1 - .../java/io/legado/app/ui/about/ReadRecordActivity.kt | 1 - .../legado/app/ui/book/arrange/ArrangeBookActivity.kt | 1 - .../legado/app/ui/book/arrange/ArrangeBookAdapter.kt | 1 - .../java/io/legado/app/ui/book/cache/CacheActivity.kt | 1 - .../app/ui/book/changesource/ChangeSourceDialog.kt | 1 - .../io/legado/app/ui/book/group/GroupManageDialog.kt | 1 - .../io/legado/app/ui/book/group/GroupSelectDialog.kt | 1 - .../io/legado/app/ui/book/local/ImportBookActivity.kt | 1 - .../legado/app/ui/book/local/ImportBookViewModel.kt | 1 - .../app/ui/book/local/rule/TxtTocRuleActivity.kt | 1 - .../legado/app/ui/book/read/BaseReadBookActivity.kt | 7 +++++-- .../java/io/legado/app/ui/book/read/SearchMenu.kt | 11 ++++++++--- .../app/ui/book/read/config/HttpTtsEditViewModel.kt | 5 ++++- .../app/ui/book/source/manage/BookSourceActivity.kt | 2 +- .../app/ui/book/source/manage/GroupManageDialog.kt | 1 - .../java/io/legado/app/ui/config/CheckSourceConfig.kt | 4 ++-- .../io/legado/app/ui/config/OtherConfigFragment.kt | 2 +- .../io/legado/app/ui/document/adapter/FileAdapter.kt | 1 - .../java/io/legado/app/ui/document/entity/JavaBean.kt | 1 - .../java/io/legado/app/ui/font/FontSelectDialog.kt | 2 -- .../ui/main/bookshelf/style1/books/BooksFragment.kt | 1 - .../ui/main/bookshelf/style2/BookshelfFragment2.kt | 1 - .../io/legado/app/ui/main/explore/ExploreFragment.kt | 1 - .../java/io/legado/app/ui/main/rss/RssFragment.kt | 1 - .../io/legado/app/ui/replace/GroupManageDialog.kt | 6 ++++-- .../io/legado/app/ui/replace/ReplaceRuleActivity.kt | 1 - .../io/legado/app/ui/replace/ReplaceRuleAdapter.kt | 2 -- .../legado/app/ui/rss/article/RssArticlesFragment.kt | 1 - .../app/ui/rss/favorites/RssFavoritesActivity.kt | 1 - .../app/ui/rss/source/manage/GroupManageDialog.kt | 1 - .../app/ui/rss/source/manage/RssSourceActivity.kt | 1 - .../legado/app/ui/rss/subscription/RuleSubActivity.kt | 1 - app/src/main/java/io/legado/app/utils/LogUtils.kt | 5 ++++- .../main/java/io/legado/app/utils/MenuExtensions.kt | 1 - app/src/main/java/io/legado/app/utils/ZipUtils.kt | 1 - app/src/main/java/io/legado/app/web/HttpServer.kt | 1 - .../legado/app/web/socket/BookSourceDebugWebSocket.kt | 5 ++++- .../legado/app/web/socket/RssSourceDebugWebSocket.kt | 5 ++++- 56 files changed, 42 insertions(+), 67 deletions(-) diff --git a/app/src/main/java/io/legado/app/api/ReaderProvider.kt b/app/src/main/java/io/legado/app/api/ReaderProvider.kt index 50ebca936..ad1efda57 100644 --- a/app/src/main/java/io/legado/app/api/ReaderProvider.kt +++ b/app/src/main/java/io/legado/app/api/ReaderProvider.kt @@ -13,7 +13,6 @@ import com.google.gson.Gson import io.legado.app.api.controller.BookController import io.legado.app.api.controller.BookSourceController import io.legado.app.api.controller.RssSourceController -import java.util.* /** * Export book data to other app. diff --git a/app/src/main/java/io/legado/app/help/ContentHelp.kt b/app/src/main/java/io/legado/app/help/ContentHelp.kt index ad742d058..a2064fe3a 100644 --- a/app/src/main/java/io/legado/app/help/ContentHelp.kt +++ b/app/src/main/java/io/legado/app/help/ContentHelp.kt @@ -1,6 +1,5 @@ package io.legado.app.help -import java.util.* import java.util.regex.Pattern import kotlin.math.max import kotlin.math.min diff --git a/app/src/main/java/io/legado/app/help/LifecycleHelp.kt b/app/src/main/java/io/legado/app/help/LifecycleHelp.kt index dad8ca883..9836cfaf5 100644 --- a/app/src/main/java/io/legado/app/help/LifecycleHelp.kt +++ b/app/src/main/java/io/legado/app/help/LifecycleHelp.kt @@ -5,7 +5,6 @@ import android.app.Application import android.os.Bundle import io.legado.app.base.BaseService import java.lang.ref.WeakReference -import java.util.* /** * Activity管理器,管理项目中Activity的状态 diff --git a/app/src/main/java/io/legado/app/help/SourceAnalyzer.kt b/app/src/main/java/io/legado/app/help/SourceAnalyzer.kt index 0f3ae55bb..02f33e0fc 100644 --- a/app/src/main/java/io/legado/app/help/SourceAnalyzer.kt +++ b/app/src/main/java/io/legado/app/help/SourceAnalyzer.kt @@ -7,7 +7,6 @@ import io.legado.app.constant.BookType import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.rule.* import io.legado.app.utils.* -import splitties.init.appCtx import timber.log.Timber import java.util.regex.Pattern diff --git a/app/src/main/java/io/legado/app/help/http/BackstageWebView.kt b/app/src/main/java/io/legado/app/help/http/BackstageWebView.kt index fa1189dfe..925c0174e 100644 --- a/app/src/main/java/io/legado/app/help/http/BackstageWebView.kt +++ b/app/src/main/java/io/legado/app/help/http/BackstageWebView.kt @@ -11,7 +11,8 @@ import android.webkit.WebViewClient import io.legado.app.constant.AppConst import io.legado.app.model.NoStackTraceException import io.legado.app.utils.runOnUI -import kotlinx.coroutines.* +import kotlinx.coroutines.Runnable +import kotlinx.coroutines.suspendCancellableCoroutine import org.apache.commons.text.StringEscapeUtils import splitties.init.appCtx import java.lang.ref.WeakReference diff --git a/app/src/main/java/io/legado/app/lib/permission/Request.kt b/app/src/main/java/io/legado/app/lib/permission/Request.kt index a5f3acacd..605f49da0 100644 --- a/app/src/main/java/io/legado/app/lib/permission/Request.kt +++ b/app/src/main/java/io/legado/app/lib/permission/Request.kt @@ -9,7 +9,6 @@ import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import io.legado.app.R import io.legado.app.utils.startActivity -import java.util.* @Suppress("MemberVisibilityCanBePrivate") internal class Request : OnRequestPermissionsResultCallback { diff --git a/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt b/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt index 198c3ad89..4599942f1 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt +++ b/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt @@ -1,8 +1,8 @@ package io.legado.app.lib.theme import android.content.Context -import androidx.annotation.AttrRes import android.graphics.drawable.Drawable +import androidx.annotation.AttrRes /** * @author Aidan Follestad (afollestad) diff --git a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt index 8ed1af146..3f4b2ab8c 100644 --- a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt +++ b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt @@ -3,7 +3,7 @@ package io.legado.app.lib.webdav import io.legado.app.help.http.newCallResponseBody import io.legado.app.help.http.okHttpClient import io.legado.app.help.http.text -import okhttp3.* +import okhttp3.Credentials import okhttp3.MediaType.Companion.toMediaType import okhttp3.RequestBody.Companion.asRequestBody import okhttp3.RequestBody.Companion.toRequestBody @@ -15,7 +15,6 @@ import java.io.InputStream import java.net.MalformedURLException import java.net.URL import java.net.URLEncoder -import java.util.* @Suppress("unused", "MemberVisibilityCanBePrivate") class WebDav(urlStr: String) { diff --git a/app/src/main/java/io/legado/app/model/CheckSource.kt b/app/src/main/java/io/legado/app/model/CheckSource.kt index d8016bf36..c26d196c1 100644 --- a/app/src/main/java/io/legado/app/model/CheckSource.kt +++ b/app/src/main/java/io/legado/app/model/CheckSource.kt @@ -4,9 +4,9 @@ import android.content.Context import io.legado.app.R import io.legado.app.constant.IntentAction import io.legado.app.data.entities.BookSource +import io.legado.app.help.CacheManager import io.legado.app.service.CheckSourceService import io.legado.app.utils.startService -import io.legado.app.help.CacheManager import splitties.init.appCtx object CheckSource { diff --git a/app/src/main/java/io/legado/app/model/Debug.kt b/app/src/main/java/io/legado/app/model/Debug.kt index 27a78f81c..9152bae22 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -12,7 +12,6 @@ import io.legado.app.utils.msg import kotlinx.coroutines.CoroutineScope import java.text.SimpleDateFormat import java.util.* -import kotlin.collections.HashMap object Debug { var callback: Callback? = null diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt index 084624513..4c0d79d36 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt @@ -3,9 +3,7 @@ package io.legado.app.model.analyzeRule import androidx.annotation.Keep import com.jayway.jsonpath.JsonPath import com.jayway.jsonpath.ReadContext - import timber.log.Timber -import java.util.* @Suppress("RegExpRedundantEscape") @Keep diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByRegex.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByRegex.kt index 161bde603..7e41eba6a 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByRegex.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByRegex.kt @@ -1,7 +1,6 @@ package io.legado.app.model.analyzeRule import androidx.annotation.Keep -import java.util.* import java.util.regex.Pattern @Keep diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByXPath.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByXPath.kt index a67d934f2..3e5a50698 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByXPath.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByXPath.kt @@ -7,7 +7,6 @@ import org.jsoup.nodes.Element import org.jsoup.select.Elements import org.seimicrawler.xpath.JXDocument import org.seimicrawler.xpath.JXNode -import java.util.* @Keep class AnalyzeByXPath(doc: Any) { diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index e1d098517..9922cf0d6 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -15,10 +15,8 @@ import org.jsoup.nodes.Entities import org.mozilla.javascript.NativeObject import timber.log.Timber import java.net.URL -import java.util.* import java.util.regex.Pattern import javax.script.SimpleBindings -import kotlin.collections.HashMap /** * 解析规则获取结果 diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 427e71292..79cd6319a 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -21,10 +21,8 @@ import okhttp3.MediaType.Companion.toMediaType import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response import java.net.URLEncoder -import java.util.* import java.util.regex.Pattern import javax.script.SimpleBindings -import kotlin.collections.HashMap /** * Created by GKF on 2018/1/24. diff --git a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt index 873bb4470..a9cd1de54 100644 --- a/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/EpubFile.kt @@ -23,7 +23,6 @@ import java.io.FileOutputStream import java.io.IOException import java.io.InputStream import java.nio.charset.Charset -import java.util.* class EpubFile(var book: Book) { diff --git a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt index bcfc80324..adc586564 100644 --- a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt +++ b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt @@ -4,7 +4,6 @@ import android.net.Uri import androidx.documentfile.provider.DocumentFile import io.legado.app.R import io.legado.app.constant.AppConst -import io.legado.app.constant.AppPattern import io.legado.app.data.appDb import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter diff --git a/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt b/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt index 95023372b..c7304e552 100644 --- a/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt @@ -11,7 +11,6 @@ import splitties.init.appCtx import timber.log.Timber import java.io.File import java.io.InputStream -import java.util.* class UmdFile(var book: Book) { companion object { diff --git a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt index 31a35de9d..b611b88f7 100644 --- a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt +++ b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt @@ -23,7 +23,6 @@ import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import java.util.* class ReadRecordActivity : BaseActivity() { diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt index 77f9f313a..c8be06b79 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt @@ -31,7 +31,6 @@ import io.legado.app.utils.showDialogFragment import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt index d35d23542..d55938e5c 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt @@ -14,7 +14,6 @@ import io.legado.app.databinding.ItemArrangeBookBinding import io.legado.app.lib.theme.backgroundColor import io.legado.app.ui.widget.recycler.DragSelectTouchHelper import io.legado.app.ui.widget.recycler.ItemTouchCallback -import java.util.* class ArrangeBookAdapter(context: Context, val callBack: CallBack) : RecyclerAdapter(context), diff --git a/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt b/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt index ae0bdcd5e..aac0d62d7 100644 --- a/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt @@ -31,7 +31,6 @@ import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt index 918c8b4f5..f5fed2bbc 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt @@ -27,7 +27,6 @@ import io.legado.app.ui.book.source.manage.BookSourceActivity import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt index d76979d02..a05ca5fc1 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt @@ -28,7 +28,6 @@ import io.legado.app.utils.setLayout import io.legado.app.utils.showDialogFragment import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.visible -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt index b1a4715f0..cbf4df1aa 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt @@ -27,7 +27,6 @@ import io.legado.app.utils.applyTint import io.legado.app.utils.setLayout import io.legado.app.utils.showDialogFragment import io.legado.app.utils.viewbindingdelegate.viewBinding -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt index 78686fe19..0bb325869 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt @@ -26,7 +26,6 @@ import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import java.io.File diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt index dd684bf80..392f260f8 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt @@ -10,7 +10,6 @@ import io.legado.app.utils.FileDoc import io.legado.app.utils.isContentScheme import io.legado.app.utils.toastOnUi import java.io.File -import java.util.* class ImportBookViewModel(application: Application) : BaseViewModel(application) { diff --git a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt index fe95f1597..9b6f67bac 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt @@ -25,7 +25,6 @@ import io.legado.app.utils.setEdgeEffectColor import io.legado.app.utils.snackbar import io.legado.app.utils.splitNotBlank import io.legado.app.utils.viewbindingdelegate.viewBinding -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch class TxtTocRuleActivity : VMBaseActivity(), diff --git a/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt index 27aa92a7c..b6037d383 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt @@ -4,8 +4,11 @@ import android.annotation.SuppressLint import android.content.pm.ActivityInfo import android.os.Build import android.os.Bundle -import android.view.* +import android.view.Gravity +import android.view.View import android.view.ViewGroup.LayoutParams.MATCH_PARENT +import android.view.WindowInsets +import android.view.WindowManager import android.widget.FrameLayout import androidx.activity.viewModels import androidx.core.view.isVisible @@ -214,7 +217,7 @@ abstract class BaseReadBookActivity : } } - @SuppressLint("InflateParams") + @SuppressLint("InflateParams", "SetTextI18n") fun showDownloadDialog() { ReadBook.book?.let { book -> alert(titleResource = R.string.offline_cache) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/SearchMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/SearchMenu.kt index 53f3b8868..6ae9828ba 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/SearchMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/SearchMenu.kt @@ -11,12 +11,17 @@ import android.widget.FrameLayout import androidx.core.view.isVisible import io.legado.app.R import io.legado.app.databinding.ViewSearchMenuBinding -import io.legado.app.help.* -import io.legado.app.lib.theme.* +import io.legado.app.help.ReadBookConfig +import io.legado.app.lib.theme.Selector +import io.legado.app.lib.theme.bottomBackground +import io.legado.app.lib.theme.getPrimaryTextColor import io.legado.app.model.ReadBook import io.legado.app.ui.book.searchContent.SearchResult import io.legado.app.utils.* -import splitties.views.* +import splitties.views.bottomPadding +import splitties.views.leftPadding +import splitties.views.padding +import splitties.views.rightPadding /** * 搜索界面菜单 diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/HttpTtsEditViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/config/HttpTtsEditViewModel.kt index e9b008220..ffeee7050 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/HttpTtsEditViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/HttpTtsEditViewModel.kt @@ -7,7 +7,10 @@ import io.legado.app.data.appDb import io.legado.app.data.entities.HttpTTS import io.legado.app.model.NoStackTraceException import io.legado.app.model.ReadAloud -import io.legado.app.utils.* +import io.legado.app.utils.getClipText +import io.legado.app.utils.isJsonArray +import io.legado.app.utils.isJsonObject +import io.legado.app.utils.toastOnUi class HttpTtsEditViewModel(app: Application) : BaseViewModel(app) { diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 6f4627d04..057baa03f 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -28,10 +28,10 @@ import io.legado.app.lib.theme.primaryTextColor import io.legado.app.model.CheckSource import io.legado.app.model.Debug import io.legado.app.ui.association.ImportBookSourceDialog -import io.legado.app.ui.config.CheckSourceConfig import io.legado.app.ui.book.local.rule.TxtTocRuleActivity import io.legado.app.ui.book.source.debug.BookSourceDebugActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity +import io.legado.app.ui.config.CheckSourceConfig import io.legado.app.ui.document.HandleFileContract import io.legado.app.ui.qrcode.QrCodeResult import io.legado.app.ui.widget.SelectActionBar diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt index 2d72477a2..de77fb446 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt @@ -27,7 +27,6 @@ import io.legado.app.utils.requestInputMethod import io.legado.app.utils.setLayout import io.legado.app.utils.splitNotBlank import io.legado.app.utils.viewbindingdelegate.viewBinding -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt b/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt index 9dfa80aac..af994bac0 100644 --- a/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt +++ b/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt @@ -5,15 +5,15 @@ import android.view.View import android.view.ViewGroup import io.legado.app.R import io.legado.app.base.BaseDialogFragment +import io.legado.app.constant.PreferKey import io.legado.app.databinding.DialogCheckSourceConfigBinding import io.legado.app.lib.theme.primaryColor import io.legado.app.model.CheckSource +import io.legado.app.utils.putPrefString import io.legado.app.utils.setLayout import io.legado.app.utils.toastOnUi import io.legado.app.utils.viewbindingdelegate.viewBinding import splitties.views.onClick -import io.legado.app.constant.PreferKey -import io.legado.app.utils.putPrefString class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config) { diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index a965a939b..1dc958d4a 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -12,12 +12,12 @@ import io.legado.app.R import io.legado.app.base.BasePreferenceFragment import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey -import io.legado.app.model.CheckSource import io.legado.app.databinding.DialogEditTextBinding import io.legado.app.help.AppConfig import io.legado.app.help.BookHelp import io.legado.app.lib.dialogs.alert import io.legado.app.lib.theme.primaryColor +import io.legado.app.model.CheckSource import io.legado.app.receiver.SharedReceiverActivity import io.legado.app.service.WebService import io.legado.app.ui.document.HandleFileContract diff --git a/app/src/main/java/io/legado/app/ui/document/adapter/FileAdapter.kt b/app/src/main/java/io/legado/app/ui/document/adapter/FileAdapter.kt index 975b68409..0f44d9ed1 100644 --- a/app/src/main/java/io/legado/app/ui/document/adapter/FileAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/document/adapter/FileAdapter.kt @@ -14,7 +14,6 @@ import io.legado.app.ui.document.utils.FilePickerIcon import io.legado.app.utils.ConvertUtils import io.legado.app.utils.FileUtils import java.io.File -import java.util.* class FileAdapter(context: Context, val callBack: CallBack) : diff --git a/app/src/main/java/io/legado/app/ui/document/entity/JavaBean.kt b/app/src/main/java/io/legado/app/ui/document/entity/JavaBean.kt index eb81f1c71..1b1dbeda0 100644 --- a/app/src/main/java/io/legado/app/ui/document/entity/JavaBean.kt +++ b/app/src/main/java/io/legado/app/ui/document/entity/JavaBean.kt @@ -3,7 +3,6 @@ package io.legado.app.ui.document.entity import java.io.Serializable import java.lang.reflect.Field import java.lang.reflect.Modifier -import java.util.* /** * JavaBean类 diff --git a/app/src/main/java/io/legado/app/ui/font/FontSelectDialog.kt b/app/src/main/java/io/legado/app/ui/font/FontSelectDialog.kt index d89f8fab5..f7e5be7d5 100644 --- a/app/src/main/java/io/legado/app/ui/font/FontSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/font/FontSelectDialog.kt @@ -23,8 +23,6 @@ import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.launch import java.io.File -import java.util.* -import kotlin.collections.ArrayList class FontSelectDialog : BaseDialogFragment(R.layout.dialog_font_select), Toolbar.OnMenuItemClickListener, diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt index 75f729b6f..7b3cf27e0 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt @@ -27,7 +27,6 @@ import io.legado.app.ui.main.MainViewModel import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlin.math.max diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt index f1ebc2fce..b04206928 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/style2/BookshelfFragment2.kt @@ -29,7 +29,6 @@ import io.legado.app.ui.main.bookshelf.BaseBookshelfFragment import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlin.math.max diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt index 86ceded1c..043620337 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt @@ -26,7 +26,6 @@ import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch /** diff --git a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt index bbf0ade13..a5c92c271 100644 --- a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt @@ -26,7 +26,6 @@ import io.legado.app.ui.rss.subscription.RuleSubActivity import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt index f6621eb15..4bee342c4 100644 --- a/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt @@ -22,9 +22,11 @@ import io.legado.app.lib.dialogs.alert import io.legado.app.lib.theme.backgroundColor import io.legado.app.lib.theme.primaryColor import io.legado.app.ui.widget.recycler.VerticalDivider -import io.legado.app.utils.* +import io.legado.app.utils.applyTint +import io.legado.app.utils.requestInputMethod +import io.legado.app.utils.setLayout +import io.legado.app.utils.splitNotBlank import io.legado.app.utils.viewbindingdelegate.viewBinding -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt index 1b6e15354..861d8e8a1 100644 --- a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt @@ -37,7 +37,6 @@ import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch /** diff --git a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt index 99bdddb64..c9f50d90a 100644 --- a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt @@ -18,8 +18,6 @@ import io.legado.app.ui.widget.recycler.DragSelectTouchHelper import io.legado.app.ui.widget.recycler.ItemTouchCallback import io.legado.app.utils.ColorUtils -import java.util.* - class ReplaceRuleAdapter(context: Context, var callBack: CallBack) : RecyclerAdapter(context), diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesFragment.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesFragment.kt index 00a6b42ae..ed5a810f5 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesFragment.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesFragment.kt @@ -24,7 +24,6 @@ import io.legado.app.utils.setEdgeEffectColor import io.legado.app.utils.startActivity import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch class RssArticlesFragment() : VMBaseFragment(R.layout.fragment_rss_articles), diff --git a/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesActivity.kt b/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesActivity.kt index 18c255eb9..43369679c 100644 --- a/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesActivity.kt @@ -10,7 +10,6 @@ import io.legado.app.ui.rss.read.ReadRssActivity import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.startActivity import io.legado.app.utils.viewbindingdelegate.viewBinding -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt index 92a794cc7..e63231fbd 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt @@ -25,7 +25,6 @@ import io.legado.app.lib.theme.primaryColor import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index fbd344838..442fef0c5 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -32,7 +32,6 @@ import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch /** diff --git a/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubActivity.kt b/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubActivity.kt index b22529d90..9e160ab8d 100644 --- a/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubActivity.kt @@ -20,7 +20,6 @@ import io.legado.app.utils.showDialogFragment import io.legado.app.utils.toastOnUi import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers.IO -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/java/io/legado/app/utils/LogUtils.kt b/app/src/main/java/io/legado/app/utils/LogUtils.kt index 1bd11173c..dd55e1773 100644 --- a/app/src/main/java/io/legado/app/utils/LogUtils.kt +++ b/app/src/main/java/io/legado/app/utils/LogUtils.kt @@ -7,7 +7,10 @@ import io.legado.app.help.AppConfig import splitties.init.appCtx import java.text.SimpleDateFormat import java.util.* -import java.util.logging.* +import java.util.logging.FileHandler +import java.util.logging.Level +import java.util.logging.LogRecord +import java.util.logging.Logger @SuppressLint("SimpleDateFormat") @Suppress("unused") diff --git a/app/src/main/java/io/legado/app/utils/MenuExtensions.kt b/app/src/main/java/io/legado/app/utils/MenuExtensions.kt index d325ecdea..ec7772f67 100644 --- a/app/src/main/java/io/legado/app/utils/MenuExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/MenuExtensions.kt @@ -10,7 +10,6 @@ import androidx.core.view.forEach import io.legado.app.R import io.legado.app.constant.Theme import java.lang.reflect.Method -import java.util.* @SuppressLint("RestrictedApi") fun Menu.applyTint(context: Context, theme: Theme = Theme.Auto): Menu = this.let { menu -> diff --git a/app/src/main/java/io/legado/app/utils/ZipUtils.kt b/app/src/main/java/io/legado/app/utils/ZipUtils.kt index ebfcdc13e..e7127fe58 100644 --- a/app/src/main/java/io/legado/app/utils/ZipUtils.kt +++ b/app/src/main/java/io/legado/app/utils/ZipUtils.kt @@ -4,7 +4,6 @@ import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.withContext import timber.log.Timber import java.io.* -import java.util.* import java.util.zip.ZipEntry import java.util.zip.ZipFile import java.util.zip.ZipOutputStream diff --git a/app/src/main/java/io/legado/app/web/HttpServer.kt b/app/src/main/java/io/legado/app/web/HttpServer.kt index 2d4d2c575..430b136aa 100644 --- a/app/src/main/java/io/legado/app/web/HttpServer.kt +++ b/app/src/main/java/io/legado/app/web/HttpServer.kt @@ -10,7 +10,6 @@ import io.legado.app.api.controller.RssSourceController import io.legado.app.web.utils.AssetsWeb import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream -import java.util.* class HttpServer(port: Int) : NanoHTTPD(port) { diff --git a/app/src/main/java/io/legado/app/web/socket/BookSourceDebugWebSocket.kt b/app/src/main/java/io/legado/app/web/socket/BookSourceDebugWebSocket.kt index 62abbdec2..3420afdce 100644 --- a/app/src/main/java/io/legado/app/web/socket/BookSourceDebugWebSocket.kt +++ b/app/src/main/java/io/legado/app/web/socket/BookSourceDebugWebSocket.kt @@ -6,7 +6,10 @@ import fi.iki.elonen.NanoWSD import io.legado.app.R import io.legado.app.data.appDb import io.legado.app.model.Debug -import io.legado.app.utils.* +import io.legado.app.utils.GSON +import io.legado.app.utils.fromJsonObject +import io.legado.app.utils.isJson +import io.legado.app.utils.runOnIO import kotlinx.coroutines.* import kotlinx.coroutines.Dispatchers.IO import splitties.init.appCtx diff --git a/app/src/main/java/io/legado/app/web/socket/RssSourceDebugWebSocket.kt b/app/src/main/java/io/legado/app/web/socket/RssSourceDebugWebSocket.kt index 73a1f87b2..29fb9486d 100644 --- a/app/src/main/java/io/legado/app/web/socket/RssSourceDebugWebSocket.kt +++ b/app/src/main/java/io/legado/app/web/socket/RssSourceDebugWebSocket.kt @@ -6,7 +6,10 @@ import fi.iki.elonen.NanoWSD import io.legado.app.R import io.legado.app.data.appDb import io.legado.app.model.Debug -import io.legado.app.utils.* +import io.legado.app.utils.GSON +import io.legado.app.utils.fromJsonObject +import io.legado.app.utils.isJson +import io.legado.app.utils.runOnIO import kotlinx.coroutines.* import kotlinx.coroutines.Dispatchers.IO import splitties.init.appCtx