From bb9db7318237333478a2a799cbfda5fcaf783d2d Mon Sep 17 00:00:00 2001 From: moon <56061215+MgKyawLay@users.noreply.github.com> Date: Tue, 25 Aug 2026 22:42:18 +0630 Subject: [PATCH] disable next btn if amount is 0 --- .../mob/utsmyanmar/ui/input_amount/InputAmountScreen.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/mob/utsmyanmar/ui/input_amount/InputAmountScreen.kt b/app/src/main/java/com/mob/utsmyanmar/ui/input_amount/InputAmountScreen.kt index 8b064f0..29b40a0 100644 --- a/app/src/main/java/com/mob/utsmyanmar/ui/input_amount/InputAmountScreen.kt +++ b/app/src/main/java/com/mob/utsmyanmar/ui/input_amount/InputAmountScreen.kt @@ -171,16 +171,16 @@ fun InputAmount( Text("Cancel") } + val isAmountValid = amount.toDoubleOrNull()?.let { it > 0.0 } == true + Button( onClick = { - if (amount.isNotEmpty()) { - onChargeClick(amount) - } + onChargeClick(amount) }, modifier = Modifier .weight(1f) .height(56.dp), - enabled = amount.isNotEmpty(), + enabled = isAmountValid, shape = RoundedCornerShape(8.dp), colors = ButtonDefaults.buttonColors( containerColor = Color.LegacyRed,