Using official Android S SDK

This commit is contained in:
Jays2Kings 2021-07-14 15:48:28 -04:00
parent 5026c48864
commit ef93655d87
4 changed files with 5 additions and 9 deletions

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.extension.util package eu.kanade.tachiyomi.extension.util
import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.app.PendingIntent import android.app.PendingIntent
import android.content.Intent import android.content.Intent
@ -23,7 +22,6 @@ import uy.kohesive.injekt.injectLazy
*/ */
class ExtensionInstallActivity : Activity() { class ExtensionInstallActivity : Activity() {
@SuppressLint("NewApi")
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
try { try {
@ -39,9 +37,7 @@ class ExtensionInstallActivity : Activity() {
val params = SessionParams( val params = SessionParams(
SessionParams.MODE_FULL_INSTALL SessionParams.MODE_FULL_INSTALL
) )
// TODO: Add once compiling via SDK 31 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// if (Build.VERSION.SDK_INT >= 31) {
if (Build.VERSION.PREVIEW_SDK_INT + Build.VERSION.SDK_INT >= 31) {
params.setRequireUserAction(USER_ACTION_NOT_REQUIRED) params.setRequireUserAction(USER_ACTION_NOT_REQUIRED)
} }
val sessionId = packageInstaller.createSession(params) val sessionId = packageInstaller.createSession(params)

View File

@ -31,7 +31,7 @@ import eu.kanade.tachiyomi.util.system.isLTR
import eu.kanade.tachiyomi.util.view.resetStrokeColor import eu.kanade.tachiyomi.util.view.resetStrokeColor
import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.updateLayoutParams
@SuppressLint("ClickableViewAccessibility", "NewApi") @SuppressLint("ClickableViewAccessibility")
class MangaHeaderHolder( class MangaHeaderHolder(
view: View, view: View,
private val adapter: MangaDetailsAdapter, private val adapter: MangaDetailsAdapter,
@ -127,7 +127,7 @@ class MangaHeaderHolder(
) )
true true
} }
if (Build.VERSION.PREVIEW_SDK_INT + Build.VERSION.SDK_INT >= 31) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
backdrop.setRenderEffect( backdrop.setRenderEffect(
RenderEffect.createBlurEffect( RenderEffect.createBlurEffect(
10f, 10f,

View File

@ -59,7 +59,7 @@ class ThemePreference @JvmOverloads constructor(context: Context, attrs: Attribu
selectExtensionLight = fastAdapterLight.getSelectExtension().setThemeListener(false) selectExtensionLight = fastAdapterLight.getSelectExtension().setThemeListener(false)
selectExtensionDark = fastAdapterDark.getSelectExtension().setThemeListener(true) selectExtensionDark = fastAdapterDark.getSelectExtension().setThemeListener(true)
val enumConstants = Themes.values() 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( itemAdapterLight.set(
enumConstants enumConstants
.filter { (!it.isDarkTheme || it.followsSystem) && (it.styleRes != R.style.Theme_Tachiyomi_Monet || isOnA12) } .filter { (!it.isDarkTheme || it.followsSystem) && (it.styleRes != R.style.Theme_Tachiyomi_Monet || isOnA12) }

View File

@ -93,7 +93,7 @@ object LegacyPluginClassPath {
} }
object AndroidVersions { object AndroidVersions {
const val compileSdk = "android-S" const val compileSdk = 31
const val minSdk = 23 const val minSdk = 23
const val targetSdk = 30 const val targetSdk = 30
const val versionCode = 77 const val versionCode = 77