Skip to content

Commit 90800c9

Browse files
authored
Merge pull request #29 from Xitee1/chore/deps-upgrade-agp9
chore(deps): upgrade to AGP 9 / Kotlin 2.3 / Compose BOM 2026.03
2 parents 3dffa7f + fe99103 commit 90800c9

11 files changed

Lines changed: 56 additions & 46 deletions

File tree

app/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
plugins {
22
alias(libs.plugins.android.application)
3-
alias(libs.plugins.kotlin.android)
43
alias(libs.plugins.kotlin.compose)
54
alias(libs.plugins.kotlin.serialization)
65
alias(libs.plugins.hilt.android)
@@ -9,12 +8,12 @@ plugins {
98

109
android {
1110
namespace = "dev.xitee.sleeptimer"
12-
compileSdk = 35
11+
compileSdk = 36
1312

1413
defaultConfig {
1514
applicationId = "dev.xitee.sleeptimer"
1615
minSdk = 26
17-
targetSdk = 35
16+
targetSdk = 36
1817
// Schema: major * 100000 + minor * 1000 + patch * 10 (last digit reserved for hotfixes)
1918
versionCode = 1 * 100000 + 0 * 1000 + 0 * 10
2019
versionName = "1.0.0"
@@ -55,15 +54,17 @@ android {
5554
targetCompatibility = JavaVersion.VERSION_17
5655
}
5756

58-
kotlinOptions {
59-
jvmTarget = "17"
60-
}
61-
6257
buildFeatures {
6358
compose = true
6459
}
6560
}
6661

62+
kotlin {
63+
compilerOptions {
64+
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
65+
}
66+
}
67+
6768
dependencies {
6869
implementation(project(":core:data"))
6970
implementation(project(":core:service"))
@@ -84,6 +85,7 @@ dependencies {
8485
implementation(libs.androidx.lifecycle.viewmodel.compose)
8586
implementation(libs.androidx.navigation.compose)
8687
implementation(libs.androidx.hilt.navigation.compose)
88+
implementation(libs.androidx.hilt.lifecycle.viewmodel.compose)
8789
implementation(libs.kotlinx.serialization.json)
8890

8991
implementation(libs.hilt.android)

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
alias(libs.plugins.android.application) apply false
33
alias(libs.plugins.android.library) apply false
4-
alias(libs.plugins.kotlin.android) apply false
54
alias(libs.plugins.kotlin.compose) apply false
65
alias(libs.plugins.kotlin.serialization) apply false
76
alias(libs.plugins.hilt.android) apply false

core/data/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
plugins {
22
alias(libs.plugins.android.library)
3-
alias(libs.plugins.kotlin.android)
43
alias(libs.plugins.hilt.android)
54
alias(libs.plugins.ksp)
65
}
76

87
android {
98
namespace = "dev.xitee.sleeptimer.core.data"
10-
compileSdk = 35
9+
compileSdk = 36
1110

1211
defaultConfig {
1312
minSdk = 26
@@ -17,9 +16,11 @@ android {
1716
sourceCompatibility = JavaVersion.VERSION_17
1817
targetCompatibility = JavaVersion.VERSION_17
1918
}
19+
}
2020

21-
kotlinOptions {
22-
jvmTarget = "17"
21+
kotlin {
22+
compilerOptions {
23+
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
2324
}
2425
}
2526

core/service/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
plugins {
22
alias(libs.plugins.android.library)
3-
alias(libs.plugins.kotlin.android)
43
alias(libs.plugins.hilt.android)
54
alias(libs.plugins.ksp)
65
}
76

87
android {
98
namespace = "dev.xitee.sleeptimer.core.service"
10-
compileSdk = 35
9+
compileSdk = 36
1110

1211
defaultConfig {
1312
minSdk = 26
@@ -17,9 +16,11 @@ android {
1716
sourceCompatibility = JavaVersion.VERSION_17
1817
targetCompatibility = JavaVersion.VERSION_17
1918
}
19+
}
2020

21-
kotlinOptions {
22-
jvmTarget = "17"
21+
kotlin {
22+
compilerOptions {
23+
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
2324
}
2425
}
2526

feature/timer/build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
plugins {
22
alias(libs.plugins.android.library)
3-
alias(libs.plugins.kotlin.android)
43
alias(libs.plugins.kotlin.compose)
54
alias(libs.plugins.hilt.android)
65
alias(libs.plugins.ksp)
76
}
87

98
android {
109
namespace = "dev.xitee.sleeptimer.feature.timer"
11-
compileSdk = 35
10+
compileSdk = 36
1211

1312
defaultConfig {
1413
minSdk = 26
@@ -19,15 +18,17 @@ android {
1918
targetCompatibility = JavaVersion.VERSION_17
2019
}
2120

22-
kotlinOptions {
23-
jvmTarget = "17"
24-
}
25-
2621
buildFeatures {
2722
compose = true
2823
}
2924
}
3025

26+
kotlin {
27+
compilerOptions {
28+
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
29+
}
30+
}
31+
3132
dependencies {
3233
implementation(project(":core:data"))
3334
implementation(project(":core:service"))
@@ -45,6 +46,7 @@ dependencies {
4546
implementation(libs.androidx.lifecycle.runtime.compose)
4647
implementation(libs.androidx.lifecycle.viewmodel.compose)
4748
implementation(libs.androidx.hilt.navigation.compose)
49+
implementation(libs.androidx.hilt.lifecycle.viewmodel.compose)
4850

4951
implementation(libs.hilt.android)
5052
ksp(libs.hilt.android.compiler)

feature/timer/src/main/kotlin/dev/xitee/sleeptimer/feature/timer/about/AboutScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import androidx.compose.ui.platform.LocalContext
4545
import androidx.compose.ui.res.stringResource
4646
import androidx.compose.ui.unit.dp
4747
import androidx.compose.ui.unit.sp
48-
import androidx.hilt.navigation.compose.hiltViewModel
48+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
4949
import androidx.lifecycle.compose.collectAsStateWithLifecycle
5050
import dev.xitee.sleeptimer.feature.timer.R
5151
import dev.xitee.sleeptimer.feature.timer.theme.AppThemes

feature/timer/src/main/kotlin/dev/xitee/sleeptimer/feature/timer/settings/SettingsScreen.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ import androidx.compose.ui.Alignment
4646
import androidx.compose.ui.Modifier
4747
import androidx.compose.ui.draw.clip
4848
import androidx.compose.ui.graphics.vector.ImageVector
49-
import androidx.compose.ui.platform.LocalContext
5049
import androidx.compose.ui.res.stringResource
5150
import androidx.compose.ui.unit.dp
52-
import androidx.hilt.navigation.compose.hiltViewModel
51+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
5352
import androidx.lifecycle.Lifecycle
5453
import androidx.lifecycle.compose.LifecycleEventEffect
5554
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -98,7 +97,11 @@ private fun SettingsContent(
9897
onNavigateToAbout: () -> Unit,
9998
viewModel: SettingsViewModel,
10099
) {
101-
val context = LocalContext.current
100+
val screenDescription = stringResource(R.string.screen_description)
101+
val shizukuSoftScreenOffExplanation =
102+
stringResource(R.string.shizuku_feature_soft_screen_off)
103+
val shizukuWifiExplanation = stringResource(R.string.shizuku_feature_wifi)
104+
val shizukuBluetoothExplanation = stringResource(R.string.shizuku_feature_bluetooth)
102105

103106
val deviceAdminLauncher = rememberLauncherForActivityResult(
104107
ActivityResultContracts.StartActivityForResult(),
@@ -148,14 +151,14 @@ private fun SettingsContent(
148151
)
149152
putExtra(
150153
DevicePolicyManager.EXTRA_ADD_EXPLANATION,
151-
context.getString(R.string.screen_description),
154+
screenDescription,
152155
)
153156
}
154157
deviceAdminLauncher.launch(intent)
155158
}
156159
},
157160
onSoftLockSelected = {
158-
requestWithShizuku(context.getString(R.string.shizuku_feature_soft_screen_off)) {
161+
requestWithShizuku(shizukuSoftScreenOffExplanation) {
159162
viewModel.updateScreenOff(true)
160163
viewModel.updateSoftScreenOff(true)
161164
}
@@ -266,7 +269,7 @@ private fun SettingsContent(
266269
checked = uiState.settings.turnOffWifi,
267270
onCheckedChange = { enabled ->
268271
if (enabled) {
269-
requestWithShizuku(context.getString(R.string.shizuku_feature_wifi)) {
272+
requestWithShizuku(shizukuWifiExplanation) {
270273
viewModel.updateTurnOffWifi(true)
271274
}
272275
} else {
@@ -282,7 +285,7 @@ private fun SettingsContent(
282285
checked = uiState.settings.turnOffBluetooth,
283286
onCheckedChange = { enabled ->
284287
if (enabled) {
285-
requestWithShizuku(context.getString(R.string.shizuku_feature_bluetooth)) {
288+
requestWithShizuku(shizukuBluetoothExplanation) {
286289
viewModel.updateTurnOffBluetooth(true)
287290
}
288291
} else {

feature/timer/src/main/kotlin/dev/xitee/sleeptimer/feature/timer/settings/ThemePickerScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import androidx.compose.ui.draw.clip
2727
import androidx.compose.ui.res.stringResource
2828
import androidx.compose.ui.text.font.FontWeight
2929
import androidx.compose.ui.unit.dp
30-
import androidx.hilt.navigation.compose.hiltViewModel
30+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
3131
import androidx.lifecycle.compose.collectAsStateWithLifecycle
3232
import dev.xitee.sleeptimer.core.data.model.ThemeId
3333
import dev.xitee.sleeptimer.feature.timer.R

feature/timer/src/main/kotlin/dev/xitee/sleeptimer/feature/timer/timer/TimerScreen.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import androidx.compose.ui.res.stringResource
5555
import androidx.compose.ui.text.rememberTextMeasurer
5656
import androidx.compose.ui.unit.dp
5757
import androidx.core.content.ContextCompat
58-
import androidx.hilt.navigation.compose.hiltViewModel
58+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
5959
import androidx.lifecycle.compose.collectAsStateWithLifecycle
6060
import dev.xitee.sleeptimer.core.data.util.remainingMillisToDisplayMinutes
6161
import dev.xitee.sleeptimer.core.service.shizuku.ShizukuManager
@@ -99,6 +99,7 @@ private fun TimerContent(
9999
val settings by viewModel.settings.collectAsStateWithLifecycle()
100100
val dialState = rememberCircularDialState()
101101
val context = LocalContext.current
102+
val screenDescription = stringResource(R.string.screen_description)
102103

103104
val orientation by rememberDeviceOrientation()
104105
val isLandscape = orientation == DeviceOrientation.LANDSCAPE_LEFT ||
@@ -145,7 +146,7 @@ private fun TimerContent(
145146
)
146147
putExtra(
147148
DevicePolicyManager.EXTRA_ADD_EXPLANATION,
148-
context.getString(R.string.screen_description),
149+
screenDescription,
149150
)
150151
}
151152
adminStartupLauncher.launch(intent)

gradle/libs.versions.toml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[versions]
2-
agp = "8.7.3"
3-
kotlin = "2.1.0"
4-
ksp = "2.1.0-1.0.29"
5-
hilt = "2.53.1"
6-
composeBom = "2024.12.01"
7-
androidxLifecycle = "2.8.7"
8-
androidxNavigation = "2.8.5"
9-
androidxHiltNavigationCompose = "1.2.0"
10-
androidxDatastore = "1.1.1"
11-
androidxCoreKtx = "1.15.0"
12-
androidxActivityCompose = "1.9.3"
13-
kotlinxSerializationJson = "1.7.3"
2+
agp = "9.1.1"
3+
kotlin = "2.3.20"
4+
ksp = "2.3.6"
5+
hilt = "2.59.2"
6+
composeBom = "2026.03.01"
7+
androidxLifecycle = "2.10.0"
8+
androidxNavigation = "2.9.7"
9+
androidxHiltNavigationCompose = "1.3.0"
10+
androidxDatastore = "1.2.1"
11+
androidxCoreKtx = "1.18.0"
12+
androidxActivityCompose = "1.13.0"
13+
kotlinxSerializationJson = "1.11.0"
1414
shizuku = "13.1.5"
1515

1616
[libraries]
@@ -34,6 +34,7 @@ androidx-datastore-preferences = { group = "androidx.datastore", name = "datasto
3434
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
3535
hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" }
3636
androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" }
37+
androidx-hilt-lifecycle-viewmodel-compose = { group = "androidx.hilt", name = "hilt-lifecycle-viewmodel-compose", version.ref = "androidxHiltNavigationCompose" }
3738

3839
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
3940

0 commit comments

Comments
 (0)