Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.hilt.android)
Expand All @@ -9,12 +8,12 @@ plugins {

android {
namespace = "dev.xitee.sleeptimer"
compileSdk = 35
compileSdk = 36

defaultConfig {
applicationId = "dev.xitee.sleeptimer"
minSdk = 26
targetSdk = 35
targetSdk = 36
// Schema: major * 100000 + minor * 1000 + patch * 10 (last digit reserved for hotfixes)
versionCode = 1 * 100000 + 0 * 1000 + 0 * 10
versionName = "1.0.0"
Expand Down Expand Up @@ -55,15 +54,17 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
compose = true
}
}

kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
}
}

dependencies {
implementation(project(":core:data"))
implementation(project(":core:service"))
Expand All @@ -84,6 +85,7 @@ dependencies {
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.androidx.hilt.lifecycle.viewmodel.compose)
implementation(libs.kotlinx.serialization.json)

implementation(libs.hilt.android)
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.hilt.android) apply false
Expand Down
9 changes: 5 additions & 4 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt.android)
alias(libs.plugins.ksp)
}

android {
namespace = "dev.xitee.sleeptimer.core.data"
compileSdk = 35
compileSdk = 36

defaultConfig {
minSdk = 26
Expand All @@ -17,9 +16,11 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlinOptions {
jvmTarget = "17"
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
}
}

Expand Down
9 changes: 5 additions & 4 deletions core/service/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt.android)
alias(libs.plugins.ksp)
}

android {
namespace = "dev.xitee.sleeptimer.core.service"
compileSdk = 35
compileSdk = 36

defaultConfig {
minSdk = 26
Expand All @@ -17,9 +16,11 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

kotlinOptions {
jvmTarget = "17"
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
}
}

Expand Down
14 changes: 8 additions & 6 deletions feature/timer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.hilt.android)
alias(libs.plugins.ksp)
}

android {
namespace = "dev.xitee.sleeptimer.feature.timer"
compileSdk = 35
compileSdk = 36

defaultConfig {
minSdk = 26
Expand All @@ -19,15 +18,17 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
compose = true
}
}

kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xannotation-default-target=param-property")
}
}

dependencies {
implementation(project(":core:data"))
implementation(project(":core:service"))
Expand All @@ -45,6 +46,7 @@ dependencies {
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.androidx.hilt.lifecycle.viewmodel.compose)

implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import dev.xitee.sleeptimer.feature.timer.R
import dev.xitee.sleeptimer.feature.timer.theme.AppThemes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.LifecycleEventEffect
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand Down Expand Up @@ -98,7 +97,11 @@ private fun SettingsContent(
onNavigateToAbout: () -> Unit,
viewModel: SettingsViewModel,
) {
val context = LocalContext.current
val screenDescription = stringResource(R.string.screen_description)
val shizukuSoftScreenOffExplanation =
stringResource(R.string.shizuku_feature_soft_screen_off)
val shizukuWifiExplanation = stringResource(R.string.shizuku_feature_wifi)
val shizukuBluetoothExplanation = stringResource(R.string.shizuku_feature_bluetooth)

val deviceAdminLauncher = rememberLauncherForActivityResult(
ActivityResultContracts.StartActivityForResult(),
Expand Down Expand Up @@ -148,14 +151,14 @@ private fun SettingsContent(
)
putExtra(
DevicePolicyManager.EXTRA_ADD_EXPLANATION,
context.getString(R.string.screen_description),
screenDescription,
)
}
deviceAdminLauncher.launch(intent)
}
},
onSoftLockSelected = {
requestWithShizuku(context.getString(R.string.shizuku_feature_soft_screen_off)) {
requestWithShizuku(shizukuSoftScreenOffExplanation) {
viewModel.updateScreenOff(true)
viewModel.updateSoftScreenOff(true)
}
Expand Down Expand Up @@ -266,7 +269,7 @@ private fun SettingsContent(
checked = uiState.settings.turnOffWifi,
onCheckedChange = { enabled ->
if (enabled) {
requestWithShizuku(context.getString(R.string.shizuku_feature_wifi)) {
requestWithShizuku(shizukuWifiExplanation) {
viewModel.updateTurnOffWifi(true)
}
} else {
Expand All @@ -282,7 +285,7 @@ private fun SettingsContent(
checked = uiState.settings.turnOffBluetooth,
onCheckedChange = { enabled ->
if (enabled) {
requestWithShizuku(context.getString(R.string.shizuku_feature_bluetooth)) {
requestWithShizuku(shizukuBluetoothExplanation) {
viewModel.updateTurnOffBluetooth(true)
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import dev.xitee.sleeptimer.core.data.model.ThemeId
import dev.xitee.sleeptimer.feature.timer.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.unit.dp
import androidx.core.content.ContextCompat
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import dev.xitee.sleeptimer.core.data.util.remainingMillisToDisplayMinutes
import dev.xitee.sleeptimer.core.service.shizuku.ShizukuManager
Expand Down Expand Up @@ -99,6 +99,7 @@ private fun TimerContent(
val settings by viewModel.settings.collectAsStateWithLifecycle()
val dialState = rememberCircularDialState()
val context = LocalContext.current
val screenDescription = stringResource(R.string.screen_description)

val orientation by rememberDeviceOrientation()
val isLandscape = orientation == DeviceOrientation.LANDSCAPE_LEFT ||
Expand Down Expand Up @@ -145,7 +146,7 @@ private fun TimerContent(
)
putExtra(
DevicePolicyManager.EXTRA_ADD_EXPLANATION,
context.getString(R.string.screen_description),
screenDescription,
)
}
adminStartupLauncher.launch(intent)
Expand Down
25 changes: 13 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[versions]
agp = "8.7.3"
kotlin = "2.1.0"
ksp = "2.1.0-1.0.29"
hilt = "2.53.1"
composeBom = "2024.12.01"
androidxLifecycle = "2.8.7"
androidxNavigation = "2.8.5"
androidxHiltNavigationCompose = "1.2.0"
androidxDatastore = "1.1.1"
androidxCoreKtx = "1.15.0"
androidxActivityCompose = "1.9.3"
kotlinxSerializationJson = "1.7.3"
agp = "9.1.1"
kotlin = "2.3.20"
ksp = "2.3.6"
hilt = "2.59.2"
composeBom = "2026.03.01"
androidxLifecycle = "2.10.0"
androidxNavigation = "2.9.7"
androidxHiltNavigationCompose = "1.3.0"
androidxDatastore = "1.2.1"
androidxCoreKtx = "1.18.0"
androidxActivityCompose = "1.13.0"
kotlinxSerializationJson = "1.11.0"
shizuku = "13.1.5"

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

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

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading