From 5cedf97f9f41ce68ede55d4c883a42c421a22880 Mon Sep 17 00:00:00 2001 From: DongChyeon Date: Mon, 5 Feb 2024 15:16:05 +0900 Subject: [PATCH] =?UTF-8?q?#=20Feat=20:=20=EB=A7=9B=EC=9D=84=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=ED=95=A0=20=EB=95=8C=EB=A7=88=EB=8B=A4=20=EC=95=84?= =?UTF-8?q?=EB=9E=98=EB=A1=9C=20=EC=9E=90=EB=8F=99=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A1=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notewrite/NoteWineInfoFlavorScreen.kt | 32 +++++++++++++++++-- .../NoteWineInfoVintageAndPriceScreen.kt | 3 +- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoFlavorScreen.kt b/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoFlavorScreen.kt index aa902ef1..072d5fe3 100644 --- a/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoFlavorScreen.kt +++ b/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoFlavorScreen.kt @@ -14,7 +14,11 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.tooling.preview.Preview @@ -46,14 +50,22 @@ fun NoteWineInfoFlavorScreen( ) { val uiState by viewModel.uiState.collectAsStateWithLifecycle() + val scrollState = rememberScrollState() + var selectedItemCount by remember { mutableIntStateOf(0) } + + LaunchedEffect(selectedItemCount) { + scrollState.scrollTo(999999) + } + TopBar(content = "와인 정보 입력") { appState.navController.navigateUp() } + Column( modifier = Modifier .padding(horizontal = 24.dp, vertical = 20.dp) - .weight(1f) - .verticalScroll(rememberScrollState()) + .verticalScroll(scrollState) + .weight(1f), ) { Row( modifier = Modifier.fillMaxWidth(), @@ -75,6 +87,7 @@ fun NoteWineInfoFlavorScreen( ) } HeightSpacer(30.dp) + WineTasteSlider( score = uiState.wineNote.sweetness, onValueChange = { viewModel.updateSweetness(it) }, @@ -82,6 +95,7 @@ fun NoteWineInfoFlavorScreen( subTitle = "단맛의 정도", ) HeightSpacer(30.dp) + if (uiState.wineNote.sweetness > 0) { WineTasteSlider( score = uiState.wineNote.acidity, @@ -90,7 +104,10 @@ fun NoteWineInfoFlavorScreen( subTitle = "신맛의 정도" ) HeightSpacer(30.dp) + + selectedItemCount = 1 } + if (uiState.wineNote.acidity > 0) { WineTasteSlider( score = uiState.wineNote.body, @@ -99,7 +116,10 @@ fun NoteWineInfoFlavorScreen( subTitle = "농도와 질감의 정도" ) HeightSpacer(30.dp) + + selectedItemCount = 2 } + if (uiState.wineNote.body > 0) { WineTasteSlider( score = uiState.wineNote.tannin, @@ -108,7 +128,10 @@ fun NoteWineInfoFlavorScreen( subTitle = "떫고 씁쓸함의 정도" ) HeightSpacer(30.dp) + + selectedItemCount = 3 } + if (uiState.wineNote.tannin > 0) { WineTasteSlider( score = uiState.wineNote.alcohol, @@ -117,7 +140,10 @@ fun NoteWineInfoFlavorScreen( subTitle = "알코올 세기의 정도" ) HeightSpacer(30.dp) + + selectedItemCount = 4 } + if (uiState.wineNote.alcohol > 0) { WineTasteSlider( score = uiState.wineNote.finish, @@ -126,6 +152,8 @@ fun NoteWineInfoFlavorScreen( subTitle = "마신 후 맛과 항야 지속되는 정도" ) HeightSpacer(30.dp) + + selectedItemCount = 5 } } diff --git a/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoVintageAndPriceScreen.kt b/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoVintageAndPriceScreen.kt index 37cf8570..1d88d7ab 100644 --- a/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoVintageAndPriceScreen.kt +++ b/feature/note/src/main/java/com/teamwiney/notewrite/NoteWineInfoVintageAndPriceScreen.kt @@ -173,7 +173,8 @@ fun NoteWineInfoVintageAndPriceScreen( ) WineInfoTextField( - value = uiState.wineNote.price, onValueChanged = { viewModel.updatePrice(it) }, + value = uiState.wineNote.price, + onValueChanged = { viewModel.updatePrice(it) }, placeholderText = "ex) 30000", trailingIcon = { Text(