From ef93655d8732e2d278f35f92d05316d21e20e14e Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Wed, 14 Jul 2021 15:48:28 -0400 Subject: [PATCH] Using official Android S SDK --- .../tachiyomi/extension/util/ExtensionInstallActivity.kt | 6 +----- .../java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt | 4 ++-- .../java/eu/kanade/tachiyomi/ui/setting/ThemePreference.kt | 2 +- buildSrc/src/main/kotlin/Dependencies.kt | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt index 6d948674b2..a8d6622b2a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallActivity.kt @@ -1,6 +1,5 @@ package eu.kanade.tachiyomi.extension.util -import android.annotation.SuppressLint import android.app.Activity import android.app.PendingIntent import android.content.Intent @@ -23,7 +22,6 @@ import uy.kohesive.injekt.injectLazy */ class ExtensionInstallActivity : Activity() { - @SuppressLint("NewApi") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) try { @@ -39,9 +37,7 @@ class ExtensionInstallActivity : Activity() { val params = SessionParams( SessionParams.MODE_FULL_INSTALL ) - // TODO: Add once compiling via SDK 31 -// if (Build.VERSION.SDK_INT >= 31) { - if (Build.VERSION.PREVIEW_SDK_INT + Build.VERSION.SDK_INT >= 31) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { params.setRequireUserAction(USER_ACTION_NOT_REQUIRED) } val sessionId = packageInstaller.createSession(params) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt index 78355625b8..f92505024b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt @@ -31,7 +31,7 @@ import eu.kanade.tachiyomi.util.system.isLTR import eu.kanade.tachiyomi.util.view.resetStrokeColor import eu.kanade.tachiyomi.util.view.updateLayoutParams -@SuppressLint("ClickableViewAccessibility", "NewApi") +@SuppressLint("ClickableViewAccessibility") class MangaHeaderHolder( view: View, private val adapter: MangaDetailsAdapter, @@ -127,7 +127,7 @@ class MangaHeaderHolder( ) true } - if (Build.VERSION.PREVIEW_SDK_INT + Build.VERSION.SDK_INT >= 31) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { backdrop.setRenderEffect( RenderEffect.createBlurEffect( 10f, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ThemePreference.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ThemePreference.kt index d5a4e46165..4df6880887 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ThemePreference.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/ThemePreference.kt @@ -59,7 +59,7 @@ class ThemePreference @JvmOverloads constructor(context: Context, attrs: Attribu selectExtensionLight = fastAdapterLight.getSelectExtension().setThemeListener(false) selectExtensionDark = fastAdapterDark.getSelectExtension().setThemeListener(true) val enumConstants = Themes.values() - val isOnA12 = Build.VERSION.SDK_INT + Build.VERSION.PREVIEW_SDK_INT >= 31 + val isOnA12 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S itemAdapterLight.set( enumConstants .filter { (!it.isDarkTheme || it.followsSystem) && (it.styleRes != R.style.Theme_Tachiyomi_Monet || isOnA12) } diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 85dc33075b..323b22bf11 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -93,7 +93,7 @@ object LegacyPluginClassPath { } object AndroidVersions { - const val compileSdk = "android-S" + const val compileSdk = 31 const val minSdk = 23 const val targetSdk = 30 const val versionCode = 77