diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferAlertDialog.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferAlertDialog.kt index e48d8e9b0..a6faae7ce 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferAlertDialog.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferAlertDialog.kt @@ -39,7 +39,7 @@ fun SwissTransferAlertDialog( @StringRes descriptionRes: Int, onDismiss: () -> Unit, onConfirmation: () -> Unit, - shouldEnableConfirmButton: () -> Boolean = { true }, + isConfirmButtonEnabled: () -> Boolean = { true }, content: @Composable (ColumnScope.() -> Unit)? = null, ) { BasicAlertDialog( @@ -56,7 +56,7 @@ fun SwissTransferAlertDialog( additionalContent = content, onDismiss = onDismiss, onConfirmation = onConfirmation, - shouldEnableConfirmButton = shouldEnableConfirmButton, + isConfirmButtonEnabled = isConfirmButtonEnabled, ) } } @@ -70,7 +70,7 @@ private fun BasicAlertDialogContent( additionalContent: @Composable (ColumnScope.() -> Unit)? = null, onDismiss: () -> Unit, onConfirmation: () -> Unit, - shouldEnableConfirmButton: () -> Boolean = { true }, + isConfirmButtonEnabled: () -> Boolean = { true }, ) { Column(modifier.padding(Margin.Large)) { TitleAndDescription(titleRes, descriptionRes) @@ -79,7 +79,7 @@ private fun BasicAlertDialogContent( it() Spacer(Modifier.height(Margin.Mini)) } - ActionButtons(onDismiss, onConfirmation, shouldEnableConfirmButton) + ActionButtons(onDismiss, onConfirmation, isConfirmButtonEnabled) } } @@ -99,7 +99,7 @@ private fun TitleAndDescription(titleRes: Int, descriptionRes: Int) { } @Composable -private fun ActionButtons(onDismissRequest: () -> Unit, onConfirmation: () -> Unit, shouldEnable: () -> Boolean) { +private fun ActionButtons(onDismissRequest: () -> Unit, onConfirmation: () -> Unit, isEnabled: () -> Boolean) { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End, @@ -114,7 +114,7 @@ private fun ActionButtons(onDismissRequest: () -> Unit, onConfirmation: () -> Un SmallButton( titleRes = R.string.buttonConfirm, onClick = onConfirmation, - enabled = shouldEnable + enabled = isEnabled ) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/PasswordOptionAlertDialog.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/PasswordOptionAlertDialog.kt index 999c99557..fe275b5e3 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/PasswordOptionAlertDialog.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/PasswordOptionAlertDialog.kt @@ -72,7 +72,7 @@ fun PasswordOptionAlertDialog( descriptionRes = R.string.settingsPasswordDescription, onDismiss = ::onDismiss, onConfirmation = ::onConfirmButtonClicked, - shouldEnableConfirmButton = { !isPasswordActivated || isPasswordValid() }, + isConfirmButtonEnabled = { !isPasswordActivated || isPasswordValid() }, ) { ActivatePasswordSwitch(isChecked = isPasswordActivated, onCheckedChange = { isPasswordActivated = it }) Spacer(Modifier.height(Margin.Medium))