Hi everyone! How to fix this button issue? This c...
# compose-android
n
Hi everyone! How to fix this button issue? This content is ModalBottomSheet
Copy code
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DigitalLoanApplicationResultBottomSheet(
    item: TotalStateEntity,
    employeeCode: String,
    onEmployeeCodeChanged: (String) -> Unit,
    sheetState: SheetState,
    isSheetOpen: (Boolean)-> Unit,
) {

    ModalBottomSheet(
        modifier = Modifier.fillMaxSize().statusBarsPadding(),
        sheetState = sheetState,
        containerColor = colorResource(R.color.colorSurfaceBackgroundPrimary),
        contentColor = colorResource(R.color.colorSurfaceBackgroundPrimary),
        onDismissRequest = {
            isSheetOpen.invoke(false)
        },
//        contentWindowInsets = BottomSheetDefaults.windowInsets,
        dragHandle = {
            Box(
                modifier = Modifier
                    .padding(8.dp)
                    .width(36.dp)
                    .height(5.dp)
                    .clip(RoundedCornerShape(50))
                    .background(colorResource(R.color.colorLabelsVibrantTertiary))
            )
        }
    ) {
       .....
        Column(
            modifier = Modifier
                .padding(top = 72.dp, start = 16.dp, end = 16.dp, bottom = 16.dp)
                .windowInsetsPadding(WindowInsets.statusBars)
                .imePadding(),
                // enable scrolling, // Add Status Bar Padding,
            horizontalAlignment = Alignment.CenterHorizontally,
            verticalArrangement = Arrangement.Top
        ) {
            Box(
                modifier = Modifier
                    .size(80.dp)
                    .background(
                        color = bgColor,
                        shape = RoundedCornerShape(50)
                    ),
                contentAlignment = Alignment.Center
            ) {
                Image(
                    painter = painterResource(icon),
                    contentDescription = "Checkmark",
                    colorFilter = ColorFilter.tint(tintColor),
                    modifier = Modifier.size(40.dp),
                )
            }
            Spacer(modifier = Modifier.height(24.dp))
            val formattedText = item.text?.replace("\\n", "\n").orEmpty()
            Text(
                text = formattedText,
                textAlign = TextAlign.Center,
                style = TextStyle(
                    color = colorResource(R.color.colorTextPrimary),
                    fontSize = 20.sp,
                    fontWeight = FontWeight.W600
                )
            )
            Spacer(modifier = Modifier.height(8.dp))
            if(item.subText.isNullOrEmpty().not()) {
                Text(
                    text = item.subText.orEmpty(),
                    style = TextStyle(
                        color = colorResource(R.color.colorTextSecondary),
                        fontSize = 13.sp,
                        fontWeight = FontWeight.W400
                    ),
                    textAlign = TextAlign.Center
                )
                Spacer(modifier = Modifier.height(8.dp))
            }
            Text(
                text = item.date.orEmpty(),
                style = TextStyle(
                    color = colorResource(R.color.colorTextSecondary),
                    fontSize = 13.sp,
                    fontWeight = FontWeight.W400
                ),
                textAlign = TextAlign.Center
            )

            Spacer(modifier = Modifier.weight(1f))
            Column(
                modifier = Modifier
                    .border(
                        width = 1.dp,
                        color = colorResource(R.color.colorSurfaceBorder),
                        shape = RoundedCornerShape(16.dp)
                    ).padding(20.dp),
                horizontalAlignment = Alignment.CenterHorizontally
            ) {
                Text(
                    text = stringResource(R.string.lbl_if_you_applied_branch_with_help_of_employee_specify_their_code),
                    style = TextStyle(
                        color = colorResource(R.color.colorTextSecondary),
                        fontSize = 14.sp,
                        fontWeight = FontWeight.W400
                    ),
                    textAlign = TextAlign.Center,
                    lineHeight = 20.sp
                )
                Spacer(modifier = Modifier.height(16.dp))
                AppInputCompose(
                    value = employeeCode,
                    onValueChange = {
                        onEmployeeCodeChanged.invoke(it)
                    },
                    imeAction = ImeAction.Done,
                    label = stringResource(R.string.lbl_employee_code),
                )
            }
            FilledButtonCompose(
                modifier = Modifier.padding(vertical = 16.dp),
                text = stringResource(R.string.title_close),
                onClick = {
                    isSheetOpen.invoke(false)
                }
            )
        }
    }
}
đź§µ 5
c
Please move the long code snippet in the thread in here and also don’t split your message into multiple posts. Move the images in here as well, please.