Target SDK 32, up minimum to 26 (#97)

minSdk 24 -> 26
targetSdk 31 -> 32
compileSdk 31 -> 32
This commit is contained in:
Jarne Demeulemeester 2022-02-26 16:06:47 +01:00 committed by GitHub
parent ebdb00f311
commit 4b47d3b8de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 22 deletions

View file

@ -9,13 +9,13 @@ plugins {
}
android {
compileSdk = 31
compileSdk = 32
buildToolsVersion = "32.0.0"
defaultConfig {
applicationId = "dev.jdtech.jellyfin"
minSdk = 24
targetSdk = 31
minSdk = 26
targetSdk = 32
versionCode = 8
versionName = "0.3.2"

View file

@ -2,7 +2,6 @@ package dev.jdtech.jellyfin.viewmodels
import android.app.Application
import android.net.Uri
import android.os.Build
import androidx.lifecycle.*
import dagger.hilt.android.lifecycle.HiltViewModel
import dev.jdtech.jellyfin.database.DownloadDatabaseDao
@ -180,13 +179,8 @@ constructor(
}
private fun getDateString(item: BaseItemDto): String {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val instant = item.premiereDate?.toInstant(ZoneOffset.UTC)
val date = Date.from(instant)
DateFormat.getDateInstance(DateFormat.SHORT).format(date)
} else {
// TODO: Implement a way to get the year from LocalDateTime in Android < O
item.premiereDate.toString()
}
val instant = item.premiereDate?.toInstant(ZoneOffset.UTC)
val date = Date.from(instant)
return DateFormat.getDateInstance(DateFormat.SHORT).format(date)
}
}

View file

@ -2,7 +2,6 @@ package dev.jdtech.jellyfin.viewmodels
import android.app.Application
import android.net.Uri
import android.os.Build
import androidx.lifecycle.LifecycleCoroutineScope
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
@ -249,17 +248,11 @@ constructor(
return when (item.status) {
"Continuing" -> dateString.plus(" - Present")
"Ended" -> {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
return if (item.productionYear == item.endDate?.year) {
dateString
} else {
dateString.plus(" - ${item.endDate?.year}")
}
} else {
// TODO: Implement a way to get the year from LocalDateTime in Android < O
return if (item.productionYear == item.endDate?.year) {
dateString
} else {
dateString.plus(" - ${item.endDate?.year}")
}
}
else -> dateString
}