diff --git a/build.gradle b/build.gradle index c41cc145..f0f6196f 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ ext { fileChooserDialogVersion = "1.3.0-androidx" - androidUtilsVersion = '1.1.1-SNAPSHOT' + androidUtilsVersion = '1.1.2' fastAdapterVersion = "5.2.4" diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/TransferMoneyDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/TransferMoneyDialog.kt index 516c1079..15fbeff3 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/TransferMoneyDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/TransferMoneyDialog.kt @@ -39,6 +39,7 @@ import net.dankito.utils.multiplatform.toBigDecimal import net.dankito.utils.android.extensions.asActivity import net.dankito.utils.android.extensions.getDimension import net.dankito.utils.android.extensions.getResourceIdentifier +import net.dankito.utils.android.extensions.setVisibility import java.math.BigDecimal import java.text.DecimalFormatSymbols import java.util.* @@ -478,14 +479,18 @@ open class TransferMoneyDialog : DialogFragment() { } } + val showHintOrError = validationResult.validationError != null || validationResult.validationHint != null + + val textInputErrorLayout = textInputLayout.getResourceIdentifier("textinput_error", "id")?.let { textInputErrorId -> textInputLayout.findViewById(textInputErrorId)?.parent?.parent as? View } + textInputErrorLayout?.setVisibility(showHintOrError) + textInputLayout.error = validationResult.validationError if (validationResult.validationError == null) { // don't overwrite error text textInputLayout.helperText = validationResult.validationHint } (textInputLayout.layoutParams as? ViewGroup.MarginLayoutParams)?.let { params -> - val isShowingHintOrError = validationResult.validationError != null || validationResult.validationHint != null - params.bottomMargin = if (isShowingHintOrError == false || textInputLayout == lytReference) 0 + params.bottomMargin = if (showHintOrError == false || textInputLayout == lytReference) 0 else context!!.getDimension(R.dimen.dialog_transfer_money_input_fields_bottom_margin_when_displaying_validation_label) } }