From 4c5972314949525a7aea50431cc4685727aa9058 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Thu, 4 Jan 2024 23:13:48 +0100 Subject: [PATCH] Update Android dependencies + bump compileSdk to 34 --- app/build.gradle | 22 +++++++++---------- .../org/stratoemu/strato/EmulationActivity.kt | 8 +++---- build.gradle | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ff810c418..8ccfe30e8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,7 +17,7 @@ project.ext.isBuildSigned = (System.getenv("CI") == "true") && (System.getenv("I android { namespace 'org.stratoemu.strato' - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "org.stratoemu.strato" @@ -157,25 +157,25 @@ android { dependencies { /* Google */ - implementation 'androidx.core:core-ktx:1.9.0' - implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'androidx.core:core-ktx:1.12.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.preference:preference-ktx:1.2.0' - implementation 'androidx.activity:activity-ktx:1.6.1' - implementation 'com.google.android.material:material:1.8.0' + implementation 'androidx.preference:preference-ktx:1.2.1' + implementation 'androidx.activity:activity-ktx:1.8.2' + implementation 'com.google.android.material:material:1.10.0' implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - implementation 'androidx.window:window:1.0.0' - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1" - implementation 'androidx.fragment:fragment-ktx:1.5.5' + implementation 'androidx.window:window:1.2.0' + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.2" + implementation 'androidx.fragment:fragment-ktx:1.6.2' implementation "com.google.dagger:hilt-android:$hilt_version" kapt "com.google.dagger:hilt-compiler:$hilt_version" implementation 'com.google.android.flexbox:flexbox:3.0.0' /* Kotlin */ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1" + implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2' /* JetBrains */ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" diff --git a/app/src/main/java/org/stratoemu/strato/EmulationActivity.kt b/app/src/main/java/org/stratoemu/strato/EmulationActivity.kt index bf68e0ae8..95220e357 100644 --- a/app/src/main/java/org/stratoemu/strato/EmulationActivity.kt +++ b/app/src/main/java/org/stratoemu/strato/EmulationActivity.kt @@ -645,7 +645,7 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo val deviceIds = InputDevice.getDeviceIds() deviceIds.forEach { deviceId -> - InputDevice.getDevice(deviceId).apply { + InputDevice.getDevice(deviceId)?.apply { // Verify that the device has gamepad buttons, control sticks, or both. if (sources and InputDevice.SOURCE_JOYSTICK == InputDevice.SOURCE_JOYSTICK) { // This device is a game controller. @@ -689,12 +689,12 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo } else { for (id in InputDevice.getDeviceIds()) { val device = InputDevice.getDevice(id) - if (device.descriptor == inputManager.controllers[index]!!.rumbleDeviceDescriptor) { + if (device?.descriptor == inputManager.controllers[index]!!.rumbleDeviceDescriptor) { val vibrator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - device.vibratorManager.defaultVibrator + device?.vibratorManager!!.defaultVibrator } else { @Suppress("DEPRECATION") - device.vibrator!! + device?.vibrator!! } vibrators[index] = vibrator return@let vibrator diff --git a/build.gradle b/build.gradle index c3b55ef0f..742d4d56f 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { kotlin_version = '1.7.21' - hilt_version = '2.44.2' + hilt_version = '2.50' } repositories {