From fea7991c6490368fcbd966b280087b686cd7ecd7 Mon Sep 17 00:00:00 2001 From: seoggyui Date: Wed, 22 Nov 2023 20:57:02 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/home/BandalartBottomSheet.kt | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/feature/home/src/main/kotlin/com/nexters/bandalart/android/feature/home/BandalartBottomSheet.kt b/feature/home/src/main/kotlin/com/nexters/bandalart/android/feature/home/BandalartBottomSheet.kt index 96ba4eea..b5df9bbc 100644 --- a/feature/home/src/main/kotlin/com/nexters/bandalart/android/feature/home/BandalartBottomSheet.kt +++ b/feature/home/src/main/kotlin/com/nexters/bandalart/android/feature/home/BandalartBottomSheet.kt @@ -114,6 +114,8 @@ fun BandalartBottomSheet( val scope = rememberCoroutineScope() val bottomSheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true) val focusRequester = remember { FocusRequester() } + val focusManager = LocalFocusManager.current + val scrollState = rememberScrollState() ModalBottomSheet( onDismissRequest = { @@ -192,9 +194,6 @@ fun BandalartBottomSheet( ) } - val focusManager = LocalFocusManager.current - val scrollState = rememberScrollState() - Column( modifier = Modifier .background(White) @@ -378,7 +377,7 @@ fun BandalartBottomSheet( viewModel.dueDateChanged(dueDate = dueDateResult.toString()) viewModel.openDatePicker(flag = openDatePickerPushResult) }, - datePickerScope = rememberCoroutineScope(), + datePickerScope = scope, datePickerState = rememberModalBottomSheetState(skipPartiallyExpanded = true), currentDueDate = uiState.cellData.dueDate?.toLocalDateTime() ?: LocalDateTime.now(), ) @@ -502,34 +501,30 @@ fun BandalartBottomSheet( } Spacer(modifier = Modifier.height(StatusBarHeightDp + NavigationBarHeightDp + 20.dp)) } - when { - scrollState.value > 0 -> { - Column( - modifier = Modifier.background( - brush = Brush.verticalGradient( - colors = listOf(White, Transparent), - ), - shape = RectangleShape, - ) - .height(77.dp) - .fillMaxWidth(), - ) {} - } + if (scrollState.value > 0) { + Column( + modifier = Modifier.background( + brush = Brush.verticalGradient( + colors = listOf(White, Transparent), + ), + shape = RectangleShape, + ) + .height(77.dp) + .fillMaxWidth(), + ) {} } - when { - scrollState.value < scrollState.maxValue -> { - Column( - modifier = Modifier.background( - brush = Brush.verticalGradient( - colors = listOf(Transparent, White), - ), - shape = RectangleShape, - ) - .height(77.dp) - .fillMaxWidth() - .align(Alignment.BottomCenter), - ) {} - } + if (scrollState.value < scrollState.maxValue) { + Column( + modifier = Modifier.background( + brush = Brush.verticalGradient( + colors = listOf(Transparent, White), + ), + shape = RectangleShape, + ) + .height(77.dp) + .fillMaxWidth() + .align(Alignment.BottomCenter), + ) {} } } }