diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0b9bbd903d..c72f13feff 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -87,7 +87,7 @@ android { dependencies { //AndroidX - implementation("androidx.activity:activity-compose:1.7.1") + implementation("androidx.activity:activity-compose:1.7.2") implementation("androidx.core:core-splashscreen:1.0.1") implementation("androidx.exifinterface:exifinterface:1.3.6") implementation("androidx.appcompat:appcompat:1.7.0-alpha02") @@ -103,10 +103,10 @@ dependencies { implementation("nl.dionsegijn:konfetti-compose:2.0.2") //Compose - implementation("androidx.compose.material3:material3:1.2.0-alpha01") - implementation("androidx.compose.material3:material3-window-size-class:1.2.0-alpha01") - implementation("androidx.compose.material:material-icons-extended:1.5.0-alpha04") - implementation("androidx.compose.material:material:1.5.0-alpha04") + implementation("androidx.compose.material3:material3:1.2.0-alpha02") + implementation("androidx.compose.material3:material3-window-size-class:1.2.0-alpha02") + implementation("androidx.compose.material:material-icons-extended:1.5.0-beta01") + implementation("androidx.compose.material:material:1.5.0-beta01") //Di implementation("com.google.dagger:hilt-android:2.46.1") diff --git a/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/MainScreen.kt b/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/MainScreen.kt index bfa2398a16..b6472d499a 100644 --- a/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/MainScreen.kt +++ b/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/MainScreen.kt @@ -364,6 +364,7 @@ fun MainScreen( } ) Divider() + val currentFolderUri = viewModel.saveFolderUri LazyColumn( contentPadding = WindowInsets.navigationBars.asPaddingValues(), state = lazyListState @@ -371,10 +372,15 @@ fun MainScreen( SettingsBlock( onEditPresets = { editPresetsState.value = true }, onEditArrangement = { showArrangementSheet.value = true }, - onEditColorScheme = { showPickColorDialog.value = true }, - onEditEmoji = { showEmojiDialog.value = true }, onEditFilename = { showChangeFilenameDialog = true }, + onEditEmoji = { showEmojiDialog.value = true }, + onEditColorScheme = { showPickColorDialog.value = true }, onShowAuthor = { showAuthorDialog.value = true }, + settingsState = settingsState, + currentFolderUri = currentFolderUri, + toastHost = toastHost, + scope = scope, + context = context, viewModel = viewModel ) } diff --git a/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/SettingsBlock.kt b/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/SettingsBlock.kt index d7e24e2cb4..64df26ecc1 100644 --- a/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/SettingsBlock.kt +++ b/app/src/main/java/ru/tech/imageresizershrinker/main_screen/components/SettingsBlock.kt @@ -51,7 +51,6 @@ import androidx.compose.material.icons.rounded.TableRows import androidx.compose.material.icons.rounded.Translate import androidx.compose.material.icons.rounded.WbSunny import androidx.compose.material3.Divider -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Slider @@ -60,7 +59,6 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember -import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -76,6 +74,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.t8rin.dynamic.theme.ColorTupleItem +import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import ru.tech.imageresizershrinker.BuildConfig import ru.tech.imageresizershrinker.R @@ -101,17 +100,16 @@ import ru.tech.imageresizershrinker.utils.storage.LocalFileController import ru.tech.imageresizershrinker.utils.storage.SaveTarget import ru.tech.imageresizershrinker.utils.storage.constructFilename import ru.tech.imageresizershrinker.utils.storage.toUiPath -import ru.tech.imageresizershrinker.widget.LocalToastHost import ru.tech.imageresizershrinker.widget.PreferenceRow import ru.tech.imageresizershrinker.widget.PreferenceRowSwitch import ru.tech.imageresizershrinker.widget.TitleItem +import ru.tech.imageresizershrinker.widget.ToastHostState import ru.tech.imageresizershrinker.widget.image.Picture -import ru.tech.imageresizershrinker.widget.utils.LocalSettingsState +import ru.tech.imageresizershrinker.widget.utils.SettingsState import ru.tech.imageresizershrinker.widget.utils.isNightMode import ru.tech.imageresizershrinker.widget.utils.toAlignment import kotlin.math.roundToInt -@OptIn(ExperimentalMaterial3Api::class) fun LazyListScope.SettingsBlock( onEditPresets: () -> Unit, onEditArrangement: () -> Unit, @@ -119,14 +117,14 @@ fun LazyListScope.SettingsBlock( onEditEmoji: () -> Unit, onEditColorScheme: () -> Unit, onShowAuthor: () -> Unit, + settingsState: SettingsState, + currentFolderUri: Uri?, + toastHost: ToastHostState, + scope: CoroutineScope, + context: Context, viewModel: MainViewModel ) { item { - val settingsState = LocalSettingsState.current - val currentFolderUri = viewModel.saveFolderUri - val toastHost = LocalToastHost.current - val scope = rememberCoroutineScope() - val context = LocalContext.current // Night mode Column { TitleItem( @@ -171,6 +169,8 @@ fun LazyListScope.SettingsBlock( Spacer(Modifier.height(16.dp)) } Divider() + } + item { // Customization Column { TitleItem( @@ -528,6 +528,8 @@ fun LazyListScope.SettingsBlock( Spacer(Modifier.height(16.dp)) } Divider() + } + item { // Arrangement Column { TitleItem( @@ -550,6 +552,8 @@ fun LazyListScope.SettingsBlock( Spacer(Modifier.height(16.dp)) } Divider() + } + item { // Presets Column { TitleItem( @@ -572,6 +576,8 @@ fun LazyListScope.SettingsBlock( Spacer(Modifier.height(16.dp)) } Divider() + } + item { // Folder Column { val launcher = rememberLauncherForActivityResult( @@ -661,6 +667,8 @@ fun LazyListScope.SettingsBlock( Spacer(Modifier.height(16.dp)) } Divider() + } + item { // File Column { val fileController = LocalFileController.current @@ -737,6 +745,8 @@ fun LazyListScope.SettingsBlock( Spacer(Modifier.height(16.dp)) } Divider() + } + item { // Source Column { TitleItem( @@ -826,6 +836,8 @@ fun LazyListScope.SettingsBlock( Spacer(Modifier.height(16.dp)) } Divider() + } + item { // About app Column { TitleItem( diff --git a/dynamic_theme/build.gradle.kts b/dynamic_theme/build.gradle.kts index 4b591895a0..5598e9c203 100644 --- a/dynamic_theme/build.gradle.kts +++ b/dynamic_theme/build.gradle.kts @@ -41,7 +41,7 @@ android { } dependencies { - implementation(platform("androidx.compose:compose-bom:2023.05.00")) + implementation(platform("androidx.compose:compose-bom:2023.05.01")) implementation("androidx.core:core-ktx:1.10.1") implementation("androidx.compose.material3:material3") implementation("androidx.palette:palette:1.0.0") diff --git a/modalsheet/build.gradle.kts b/modalsheet/build.gradle.kts index 444e8e934b..69262027b3 100644 --- a/modalsheet/build.gradle.kts +++ b/modalsheet/build.gradle.kts @@ -46,7 +46,7 @@ android { } dependencies { - implementation(platform("androidx.compose:compose-bom:2023.05.00")) + implementation(platform("androidx.compose:compose-bom:2023.05.01")) implementation("androidx.compose.ui:ui") implementation("androidx.compose.foundation:foundation") implementation("androidx.compose.material3:material3:1.1.0")