From 4afda1879aff6836c09501e9ae8d56c9fec27773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Ernesto=20Rodr=C3=ADguez=20Caba=C3=B1as?= Date: Thu, 13 Jan 2022 20:53:02 +0000 Subject: [PATCH] Fixed error that was causing next buttons to disappear on step removal --- .../com/verticalstepperform/StepHelper.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/StepHelper.java b/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/StepHelper.java index c93a085..8df555c 100644 --- a/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/StepHelper.java +++ b/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/StepHelper.java @@ -230,13 +230,17 @@ void updateStepViewsAfterPositionChange(VerticalStepperFormView form) { cancelButtonView.setVisibility(View.GONE); } - if (formStyle.displayNextButtonInLastStep && isLast) { - String nextButtonText = formStyle.lastStepNextButtonText == null - ? "" : formStyle.lastStepNextButtonText; - nextButtonView.setText(nextButtonText); - nextButtonView.setVisibility(View.VISIBLE); + if (!isLast) { + nextButtonView.setVisibility(formStyle.displayStepButtons ? View.VISIBLE : View.GONE); } else { - nextButtonView.setVisibility(View.GONE); + if (formStyle.displayNextButtonInLastStep) { + String nextButtonText = formStyle.lastStepNextButtonText == null + ? "" : formStyle.lastStepNextButtonText; + nextButtonView.setText(nextButtonText); + nextButtonView.setVisibility(View.VISIBLE); + } else { + nextButtonView.setVisibility(View.GONE); + } } lineView1.setVisibility(isLast ? View.GONE : View.VISIBLE);