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), + ) {} } } }