From 74f30c13ea36984701c631ca67a94e97e74557f5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 8 Sep 2022 20:09:41 +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/constant/AppConst.kt | 1 + .../main/java/io/legado/app/receiver/MediaButtonReceiver.kt | 1 + .../java/io/legado/app/ui/book/bookmark/BookmarkDialog.kt | 2 ++ .../main/java/io/legado/app/ui/book/group/GroupEditDialog.kt | 1 + .../java/io/legado/app/ui/book/local/ImportBookActivity.kt | 2 ++ .../main/java/io/legado/app/ui/book/read/TextActionMenu.kt | 1 + .../java/io/legado/app/ui/book/remote/RemoteBookActivity.kt | 5 ++++- app/src/main/java/io/legado/app/utils/ContextExtensions.kt | 3 +++ 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/constant/AppConst.kt b/app/src/main/java/io/legado/app/constant/AppConst.kt index 2e8eb69c3..51090ee9f 100644 --- a/app/src/main/java/io/legado/app/constant/AppConst.kt +++ b/app/src/main/java/io/legado/app/constant/AppConst.kt @@ -68,6 +68,7 @@ object AppConst { val appInfo: AppInfo by lazy { val appInfo = AppInfo() + @Suppress("DEPRECATION") appCtx.packageManager.getPackageInfo(appCtx.packageName, PackageManager.GET_ACTIVITIES) ?.let { appInfo.versionName = it.versionName diff --git a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt index 707697f53..03e2616c5 100644 --- a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt +++ b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt @@ -36,6 +36,7 @@ class MediaButtonReceiver : BroadcastReceiver() { fun handleIntent(context: Context, intent: Intent): Boolean { val intentAction = intent.action if (Intent.ACTION_MEDIA_BUTTON == intentAction) { + @Suppress("DEPRECATION") val keyEvent = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) ?: return false val keycode: Int = keyEvent.keyCode diff --git a/app/src/main/java/io/legado/app/ui/book/bookmark/BookmarkDialog.kt b/app/src/main/java/io/legado/app/ui/book/bookmark/BookmarkDialog.kt index f31fb9f8b..838d60bfe 100644 --- a/app/src/main/java/io/legado/app/ui/book/bookmark/BookmarkDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/bookmark/BookmarkDialog.kt @@ -38,6 +38,8 @@ class BookmarkDialog() : BaseDialogFragment(R.layout.dialog_bookmark) { dismiss() return } + + @Suppress("DEPRECATION") val bookmark = arguments.getParcelable("bookmark") bookmark ?: let { dismiss() diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt index a187f7a6f..6f5607737 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt @@ -44,6 +44,7 @@ class GroupEditDialog() : BaseDialogFragment(R.layout.dialog_book_group_edit) { override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { binding.toolBar.setBackgroundColor(primaryColor) + @Suppress("DEPRECATION") bookGroup = arguments?.getParcelable("group") bookGroup?.let { binding.tieGroupName.setText(it.groupName) 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 4d40184bb..4ea28ac68 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 @@ -279,8 +279,10 @@ class ImportBookActivity : VMBaseActivity { + @Suppress("DEPRECATION") return context.packageManager .queryIntentActivities(createProcessTextIntent(), 0) } diff --git a/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt index eb60584c0..abe4c3171 100644 --- a/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.book.remote +import android.annotation.SuppressLint import android.os.Bundle import android.view.Menu import android.view.MenuItem @@ -12,7 +13,6 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.databinding.ActivityImportBookBinding import io.legado.app.lib.theme.backgroundColor import io.legado.app.ui.about.AppLogDialog -import io.legado.app.ui.book.remote.manager.RemoteBookWebDav import io.legado.app.ui.widget.SelectActionBar import io.legado.app.ui.widget.dialog.WaitDialog import io.legado.app.utils.showDialogFragment @@ -117,6 +117,7 @@ class RemoteBookActivity : VMBaseActivity= Configuration.SCREENLAYOUT_SIZE_LARGE } +@Suppress("DEPRECATION") val Context.channel: String get() { try {