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
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)

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.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,

View File

@ -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) }

View File

@ -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