From b98a8a2103b63c0e4d2007a869862b07d5a3bc74 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Sun, 10 Mar 2024 19:52:19 +0100 Subject: [PATCH 1/2] chore: Update dependencies --- app/build.gradle | 10 +++++----- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7f147f94b..3e02c26e2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -97,12 +97,12 @@ dependencies { implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' implementation 'androidx.activity:activity-compose:1.8.2' implementation 'androidx.activity:activity-ktx:1.8.2' - implementation platform('androidx.compose:compose-bom:2022.10.00') + implementation platform('androidx.compose:compose-bom:2024.02.02') implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.ui:ui-graphics' implementation 'androidx.compose.ui:ui-tooling-preview' - implementation 'androidx.compose.material3:material3:1.2.0' - implementation "androidx.compose.material:material-icons-extended:1.6.2" + implementation 'androidx.compose.material3:material3:1.2.1' + implementation "androidx.compose.material:material-icons-extended:1.6.3" implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.lifecycle:lifecycle-service:2.7.0' @@ -110,7 +110,7 @@ dependencies { testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00') + androidTestImplementation platform('androidx.compose:compose-bom:2024.02.02') androidTestImplementation 'androidx.compose.ui:ui-test-junit4' debugImplementation 'androidx.compose.ui:ui-tooling' debugImplementation 'androidx.compose.ui:ui-test-manifest' @@ -135,7 +135,7 @@ dependencies { implementation 'com.maxkeppeler.sheets-compose-dialogs:list:1.2.0' implementation 'com.maxkeppeler.sheets-compose-dialogs:input:1.2.0' - def camerax_version = "1.3.1" + def camerax_version = "1.3.2" implementation "androidx.camera:camera-core:${camerax_version}" implementation "androidx.camera:camera-camera2:${camerax_version}" implementation "androidx.camera:camera-lifecycle:${camerax_version}" diff --git a/build.gradle b/build.gradle index 8fdd47847..a00ecda56 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.2.2' apply false - id 'com.android.library' version '8.2.2' apply false + id 'com.android.application' version '8.3.0' apply false + id 'com.android.library' version '8.3.0' apply false id 'org.jetbrains.kotlin.android' version '1.9.22' apply false id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 17efaba79..1c201445c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Jul 30 13:54:47 CEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From c25decc777f22542fea1cd671de5d3f7d7c78796 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Sat, 16 Mar 2024 15:26:38 +0100 Subject: [PATCH 2/2] feat: Automatically change interval duration and max duration Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com> --- .../SettingsScreen/Tiles/IntervalDurationTile.kt | 8 ++++++-- .../ui/components/SettingsScreen/Tiles/MaxDurationTile.kt | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/IntervalDurationTile.kt b/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/IntervalDurationTile.kt index 09bc86edb..edfe06a5b 100644 --- a/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/IntervalDurationTile.kt +++ b/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/IntervalDurationTile.kt @@ -2,7 +2,6 @@ package app.myzel394.alibi.ui.components.SettingsScreen.Tiles import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Mic -import androidx.compose.material.icons.filled.Timer import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.ExperimentalMaterial3Api @@ -10,7 +9,6 @@ import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource @@ -43,6 +41,12 @@ fun IntervalDurationTile( fun updateValue(intervalDuration: Long) { scope.launch { + if (intervalDuration > settings.maxDuration) { + dataStore.updateData { + it.setMaxDuration(intervalDuration) + } + } + dataStore.updateData { it.setIntervalDuration(intervalDuration) } diff --git a/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/MaxDurationTile.kt b/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/MaxDurationTile.kt index 6319cb67a..abf067b93 100644 --- a/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/MaxDurationTile.kt +++ b/app/src/main/java/app/myzel394/alibi/ui/components/SettingsScreen/Tiles/MaxDurationTile.kt @@ -1,7 +1,6 @@ package app.myzel394.alibi.ui.components.SettingsScreen.Tiles import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Memory import androidx.compose.material.icons.filled.Timer import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults @@ -10,7 +9,6 @@ import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource @@ -42,6 +40,12 @@ fun MaxDurationTile( fun updateValue(maxDuration: Long) { scope.launch { + if (maxDuration < settings.intervalDuration) { + dataStore.updateData { + it.setIntervalDuration(maxDuration) + } + } + dataStore.updateData { it.setMaxDuration(maxDuration) }