build: up min sdk to 28 (#456)

* build: bump min sdk to 28

* refactor: remove unnecessary checks

* refactor: remove unused import
This commit is contained in:
Jarne Demeulemeester 2023-07-30 16:08:36 +02:00 committed by GitHub
parent 75ea33fd33
commit 0717103895
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 24 deletions

View file

@ -16,7 +16,7 @@ android {
defaultConfig { defaultConfig {
applicationId = "dev.jdtech.jellyfin" applicationId = "dev.jdtech.jellyfin"
minSdk = 27 minSdk = 28
targetSdk = 34 targetSdk = 34
val appVersionCode: Int by rootProject.extra val appVersionCode: Int by rootProject.extra

View file

@ -1,6 +1,5 @@
package dev.jdtech.jellyfin package dev.jdtech.jellyfin
import android.os.Build
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@ -51,10 +50,8 @@ abstract class BasePlayerActivity : AppCompatActivity() {
) )
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { window.attributes.layoutInDisplayCutoutMode =
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
} }
protected fun isRendererType( protected fun isRendererType(
@ -71,18 +68,16 @@ abstract class BasePlayerActivity : AppCompatActivity() {
} }
protected fun configureInsets(playerControls: View) { protected fun configureInsets(playerControls: View) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { playerControls
playerControls .setOnApplyWindowInsetsListener { _, windowInsets ->
.setOnApplyWindowInsetsListener { _, windowInsets -> val cutout = windowInsets.displayCutout
val cutout = windowInsets.displayCutout playerControls.updatePadding(
playerControls.updatePadding( left = cutout?.safeInsetLeft ?: 0,
left = cutout?.safeInsetLeft ?: 0, top = cutout?.safeInsetTop ?: 0,
top = cutout?.safeInsetTop ?: 0, right = cutout?.safeInsetRight ?: 0,
right = cutout?.safeInsetRight ?: 0, bottom = cutout?.safeInsetBottom ?: 0,
bottom = cutout?.safeInsetBottom ?: 0, )
) return@setOnApplyWindowInsetsListener windowInsets
return@setOnApplyWindowInsetsListener windowInsets }
}
}
} }
} }

View file

@ -14,7 +14,7 @@ android {
buildToolsVersion = "34.0.0" buildToolsVersion = "34.0.0"
defaultConfig { defaultConfig {
minSdk = 27 minSdk = 28
} }
buildTypes { buildTypes {

View file

@ -12,7 +12,7 @@ android {
buildToolsVersion = "34.0.0" buildToolsVersion = "34.0.0"
defaultConfig { defaultConfig {
minSdk = 27 minSdk = 28
val appVersionCode: Int by rootProject.extra val appVersionCode: Int by rootProject.extra
val appVersionName: String by rootProject.extra val appVersionName: String by rootProject.extra

View file

@ -11,7 +11,7 @@ android {
buildToolsVersion = "34.0.0" buildToolsVersion = "34.0.0"
defaultConfig { defaultConfig {
minSdk = 27 minSdk = 28
} }
buildTypes { buildTypes {

View file

@ -13,7 +13,7 @@ android {
buildToolsVersion = "34.0.0" buildToolsVersion = "34.0.0"
defaultConfig { defaultConfig {
minSdk = 27 minSdk = 28
} }
buildTypes { buildTypes {

View file

@ -10,7 +10,7 @@ android {
buildToolsVersion = "34.0.0" buildToolsVersion = "34.0.0"
defaultConfig { defaultConfig {
minSdk = 27 minSdk = 28
} }
buildTypes { buildTypes {