diff --git a/app/build.gradle b/app/build.gradle
index cb38042..7dd0379 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 28
+ compileSdkVersion 29
defaultConfig {
applicationId "verticalstepperform.ernestoyaquello.com.verticalstepperform"
minSdkVersion 19
- targetSdkVersion 28
+ targetSdkVersion 29
versionCode 1
versionName "1.0"
}
@@ -23,7 +23,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.0.0'
- implementation 'androidx.appcompat:appcompat:1.0.2'
+ implementation 'androidx.appcompat:appcompat:1.1.0'
implementation project(path: ':vertical-stepper-form')
}
diff --git a/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/MainActivity.java b/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/MainActivity.java
index 9a58d14..63465cd 100644
--- a/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/MainActivity.java
+++ b/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/MainActivity.java
@@ -5,6 +5,8 @@
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
+
+import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
@@ -40,7 +42,7 @@ public void onClick(View view) {
}
@Override
- public void onRestoreInstanceState(Bundle savedInstanceState) {
+ public void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
dataReceived = savedInstanceState.getBoolean(DATA_RECEIVED, false);
@@ -55,7 +57,7 @@ public void onRestoreInstanceState(Bundle savedInstanceState) {
}
@Override
- public void onSaveInstanceState(Bundle savedInstanceState) {
+ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
savedInstanceState.putBoolean(DATA_RECEIVED, dataReceived);
diff --git a/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/NewAlarmFormActivity.java b/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/NewAlarmFormActivity.java
index 23f419c..e91a4fc 100644
--- a/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/NewAlarmFormActivity.java
+++ b/app/src/main/java/verticalstepperform/ernestoyaquello/com/verticalstepperform/NewAlarmFormActivity.java
@@ -217,25 +217,20 @@ public void onRestoreInstanceState(Bundle savedInstanceState) {
}
public static class DiscardAlarmConfirmationFragment extends DialogFragment {
-
- private DialogInterface.OnClickListener listener;
-
- @Override
- public void onAttach(Context context) {
- super.onAttach(context);
-
- listener = (DialogInterface.OnClickListener) context;
- }
-
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
- AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ NewAlarmFormActivity activity = (NewAlarmFormActivity)getActivity();
+ if (activity == null) {
+ throw new IllegalStateException("Fragment " + this + " not attached to an activity.");
+ }
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.form_discard_question)
.setMessage(R.string.form_info_will_be_lost)
- .setPositiveButton(R.string.form_discard, listener)
- .setNegativeButton(R.string.form_discard_cancel, listener)
- .setCancelable(false);
+ .setPositiveButton(R.string.form_discard, activity)
+ .setNegativeButton(R.string.form_discard_cancel, activity)
+ .setCancelable(false);
Dialog dialog = builder.create();
dialog.setCanceledOnTouchOutside(false);
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 376473e..2cec8e4 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,7 +1,6 @@
Vertical Stepper Form Example
Add Alarm
- Confirm data and add alarm
New alarm added successfully
At least %1$d character(s)
At least 1 day must be selected
@@ -12,7 +11,6 @@
Alarm description (optional)
Discard alarm?
All the information about this new alarm will be lost
- Add alarm
Adding new alarm…
Cancel
Discard
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index f2940a5..0ba134b 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -7,13 +7,4 @@
- 0dp
-
-
-
-
-
-
diff --git a/build.gradle b/build.gradle
index 9db686d..334b640 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,12 +1,10 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
buildscript {
repositories {
google()
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.4.1'
+ classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index f86819a..fc18dd8 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Apr 27 11:15:07 BST 2019
+#Sun Oct 27 11:18:35 GMT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
diff --git a/vertical-stepper-form/build.gradle b/vertical-stepper-form/build.gradle
index afe8a67..9b0e3f5 100644
--- a/vertical-stepper-form/build.gradle
+++ b/vertical-stepper-form/build.gradle
@@ -27,11 +27,11 @@ ext {
}
android {
- compileSdkVersion 28
+ compileSdkVersion 29
defaultConfig {
minSdkVersion 19
- targetSdkVersion 28
+ targetSdkVersion 29
versionCode 15
versionName libraryVersion
}
@@ -48,7 +48,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.0.0'
- implementation 'androidx.appcompat:appcompat:1.0.2'
+ implementation 'androidx.appcompat:appcompat:1.1.0'
}
group = publishedGroupId
@@ -88,7 +88,7 @@ install {
}
task sourcesJar(type: Jar) {
- classifier = 'sources'
+ archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
@@ -98,7 +98,7 @@ task javadoc(type: Javadoc) {
}
task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
+ archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
diff --git a/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/VerticalStepperFormView.java b/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/VerticalStepperFormView.java
index 94bfa3c..35fbc03 100644
--- a/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/VerticalStepperFormView.java
+++ b/vertical-stepper-form/src/main/java/ernestoyaquello/com/verticalstepperform/VerticalStepperFormView.java
@@ -82,7 +82,7 @@ public Builder setup(StepperFormListener stepperFormListener, Step... steps) {
* @return An instance of the stepper form builder. Use it to configure and initialize the form.
*/
public Builder setup(StepperFormListener stepperFormListener, List steps) {
- Step[] stepsArray = steps.toArray(new Step[steps.size()]);
+ Step[] stepsArray = steps.toArray(new Step[0]);
return new Builder(this, stepperFormListener, stepsArray);
}
@@ -533,124 +533,122 @@ private void onConstructed(Context context, AttributeSet attrs, int defStyleAttr
R.styleable.VerticalStepperFormView,
defStyleAttr,
0);
- if (vars != null) {
- if (vars.hasValue(R.styleable.VerticalStepperFormView_form_next_button_text)) {
- style.stepNextButtonText = vars.getString(
- R.styleable.VerticalStepperFormView_form_next_button_text);
- }
- if (vars.hasValue(R.styleable.VerticalStepperFormView_form_last_button_text)) {
- style.lastStepNextButtonText = vars.getString(
- R.styleable.VerticalStepperFormView_form_last_button_text);
- }
- if (vars.hasValue(R.styleable.VerticalStepperFormView_form_cancel_button_text)) {
- style.lastStepCancelButtonText = vars.getString(
- R.styleable.VerticalStepperFormView_form_cancel_button_text);
- }
- if (vars.hasValue(R.styleable.VerticalStepperFormView_form_confirmation_step_title_text)) {
- style.confirmationStepTitle = vars.getString(
- R.styleable.VerticalStepperFormView_form_confirmation_step_title_text);
- }
- if (vars.hasValue(R.styleable.VerticalStepperFormView_form_confirmation_step_subtitle_text)) {
- style.confirmationStepSubtitle = vars.getString(
- R.styleable.VerticalStepperFormView_form_confirmation_step_subtitle_text);
- }
- style.leftCircleSizeInPx = vars.getDimensionPixelSize(
- R.styleable.VerticalStepperFormView_form_circle_size,
- style.leftCircleSizeInPx);
- style.leftCircleTextSizeInPx = vars.getDimensionPixelSize(
- R.styleable.VerticalStepperFormView_form_circle_text_size,
- style.leftCircleTextSizeInPx);
- style.stepTitleTextSizeInPx = vars.getDimensionPixelSize(
- R.styleable.VerticalStepperFormView_form_title_text_size,
- style.stepTitleTextSizeInPx);
- style.stepSubtitleTextSizeInPx = vars.getDimensionPixelSize(
- R.styleable.VerticalStepperFormView_form_subtitle_text_size,
- style.stepSubtitleTextSizeInPx);
- style.stepErrorMessageTextSizeInPx = vars.getDimensionPixelSize(
- R.styleable.VerticalStepperFormView_form_error_message_text_size,
- style.stepErrorMessageTextSizeInPx);
- style.leftVerticalLineThicknessSizeInPx = vars.getDimensionPixelSize(
- R.styleable.VerticalStepperFormView_form_vertical_line_width,
- style.leftVerticalLineThicknessSizeInPx);
- style.marginFromStepNumbersToContentInPx = vars.getDimensionPixelSize(
- R.styleable.VerticalStepperFormView_form_horizontal_margin_from_step_numbers_to_content,
- style.marginFromStepNumbersToContentInPx);
- style.backgroundColorOfDisabledElements = vars.getColor(
- R.styleable.VerticalStepperFormView_form_disabled_elements_background_color,
- style.backgroundColorOfDisabledElements);
- style.stepNumberBackgroundColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_circle_background_color,
- style.stepNumberBackgroundColor);
- style.nextButtonBackgroundColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_next_button_background_color,
- style.nextButtonBackgroundColor);
- style.nextButtonPressedBackgroundColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_next_button_pressed_background_color,
- style.nextButtonPressedBackgroundColor);
- style.lastStepCancelButtonBackgroundColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_cancel_button_background_color,
- style.lastStepCancelButtonBackgroundColor);
- style.lastStepCancelButtonPressedBackgroundColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_cancel_button_pressed_background_color,
- style.lastStepCancelButtonPressedBackgroundColor);
- style.stepNumberTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_circle_text_color,
- style.stepNumberTextColor);
- style.stepTitleTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_title_text_color,
- style.stepTitleTextColor);
- style.stepSubtitleTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_subtitle_text_color,
- style.stepSubtitleTextColor);
- style.nextButtonTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_next_button_text_color,
- style.nextButtonTextColor);
- style.nextButtonPressedTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_next_button_pressed_text_color,
- style.nextButtonPressedTextColor);
- style.lastStepCancelButtonTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_cancel_button_text_color,
- style.lastStepCancelButtonTextColor);
- style.lastStepCancelButtonPressedTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_cancel_button_pressed_text_color,
- style.lastStepCancelButtonPressedTextColor);
- style.errorMessageTextColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_error_message_text_color,
- style.errorMessageTextColor);
- style.bottomNavigationBackgroundColor = vars.getColor(
- R.styleable.VerticalStepperFormView_form_bottom_navigation_background_color,
- style.bottomNavigationBackgroundColor);
- style.displayBottomNavigation = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_display_bottom_navigation,
- style.displayBottomNavigation);
- style.displayStepButtons = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_display_step_buttons,
- style.displayStepButtons);
- style.displayCancelButtonInLastStep = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_display_cancel_button_in_last_step,
- style.displayCancelButtonInLastStep);
- style.displayStepDataInSubtitleOfClosedSteps = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_display_step_data_in_subtitle_of_closed_steps,
- style.displayStepDataInSubtitleOfClosedSteps);
- style.displayDifferentBackgroundColorOnDisabledElements = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_display_different_background_color_on_disabled_elements,
- style.displayDifferentBackgroundColorOnDisabledElements);
- style.includeConfirmationStep = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_include_confirmation_step,
- style.includeConfirmationStep);
- style.allowNonLinearNavigation = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_allow_non_linear_navigation,
- style.allowNonLinearNavigation);
- style.allowStepOpeningOnHeaderClick = vars.getBoolean(
- R.styleable.VerticalStepperFormView_form_allow_step_opening_on_header_click,
- style.allowStepOpeningOnHeaderClick);
- style.alphaOfDisabledElements = vars.getFloat(
- R.styleable.VerticalStepperFormView_form_alpha_of_disabled_elements,
- style.alphaOfDisabledElements);
-
- vars.recycle();
+ if (vars.hasValue(R.styleable.VerticalStepperFormView_form_next_button_text)) {
+ style.stepNextButtonText = vars.getString(
+ R.styleable.VerticalStepperFormView_form_next_button_text);
+ }
+ if (vars.hasValue(R.styleable.VerticalStepperFormView_form_last_button_text)) {
+ style.lastStepNextButtonText = vars.getString(
+ R.styleable.VerticalStepperFormView_form_last_button_text);
+ }
+ if (vars.hasValue(R.styleable.VerticalStepperFormView_form_cancel_button_text)) {
+ style.lastStepCancelButtonText = vars.getString(
+ R.styleable.VerticalStepperFormView_form_cancel_button_text);
+ }
+ if (vars.hasValue(R.styleable.VerticalStepperFormView_form_confirmation_step_title_text)) {
+ style.confirmationStepTitle = vars.getString(
+ R.styleable.VerticalStepperFormView_form_confirmation_step_title_text);
+ }
+ if (vars.hasValue(R.styleable.VerticalStepperFormView_form_confirmation_step_subtitle_text)) {
+ style.confirmationStepSubtitle = vars.getString(
+ R.styleable.VerticalStepperFormView_form_confirmation_step_subtitle_text);
}
+ style.leftCircleSizeInPx = vars.getDimensionPixelSize(
+ R.styleable.VerticalStepperFormView_form_circle_size,
+ style.leftCircleSizeInPx);
+ style.leftCircleTextSizeInPx = vars.getDimensionPixelSize(
+ R.styleable.VerticalStepperFormView_form_circle_text_size,
+ style.leftCircleTextSizeInPx);
+ style.stepTitleTextSizeInPx = vars.getDimensionPixelSize(
+ R.styleable.VerticalStepperFormView_form_title_text_size,
+ style.stepTitleTextSizeInPx);
+ style.stepSubtitleTextSizeInPx = vars.getDimensionPixelSize(
+ R.styleable.VerticalStepperFormView_form_subtitle_text_size,
+ style.stepSubtitleTextSizeInPx);
+ style.stepErrorMessageTextSizeInPx = vars.getDimensionPixelSize(
+ R.styleable.VerticalStepperFormView_form_error_message_text_size,
+ style.stepErrorMessageTextSizeInPx);
+ style.leftVerticalLineThicknessSizeInPx = vars.getDimensionPixelSize(
+ R.styleable.VerticalStepperFormView_form_vertical_line_width,
+ style.leftVerticalLineThicknessSizeInPx);
+ style.marginFromStepNumbersToContentInPx = vars.getDimensionPixelSize(
+ R.styleable.VerticalStepperFormView_form_horizontal_margin_from_step_numbers_to_content,
+ style.marginFromStepNumbersToContentInPx);
+ style.backgroundColorOfDisabledElements = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_disabled_elements_background_color,
+ style.backgroundColorOfDisabledElements);
+ style.stepNumberBackgroundColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_circle_background_color,
+ style.stepNumberBackgroundColor);
+ style.nextButtonBackgroundColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_next_button_background_color,
+ style.nextButtonBackgroundColor);
+ style.nextButtonPressedBackgroundColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_next_button_pressed_background_color,
+ style.nextButtonPressedBackgroundColor);
+ style.lastStepCancelButtonBackgroundColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_cancel_button_background_color,
+ style.lastStepCancelButtonBackgroundColor);
+ style.lastStepCancelButtonPressedBackgroundColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_cancel_button_pressed_background_color,
+ style.lastStepCancelButtonPressedBackgroundColor);
+ style.stepNumberTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_circle_text_color,
+ style.stepNumberTextColor);
+ style.stepTitleTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_title_text_color,
+ style.stepTitleTextColor);
+ style.stepSubtitleTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_subtitle_text_color,
+ style.stepSubtitleTextColor);
+ style.nextButtonTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_next_button_text_color,
+ style.nextButtonTextColor);
+ style.nextButtonPressedTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_next_button_pressed_text_color,
+ style.nextButtonPressedTextColor);
+ style.lastStepCancelButtonTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_cancel_button_text_color,
+ style.lastStepCancelButtonTextColor);
+ style.lastStepCancelButtonPressedTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_cancel_button_pressed_text_color,
+ style.lastStepCancelButtonPressedTextColor);
+ style.errorMessageTextColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_error_message_text_color,
+ style.errorMessageTextColor);
+ style.bottomNavigationBackgroundColor = vars.getColor(
+ R.styleable.VerticalStepperFormView_form_bottom_navigation_background_color,
+ style.bottomNavigationBackgroundColor);
+ style.displayBottomNavigation = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_display_bottom_navigation,
+ style.displayBottomNavigation);
+ style.displayStepButtons = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_display_step_buttons,
+ style.displayStepButtons);
+ style.displayCancelButtonInLastStep = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_display_cancel_button_in_last_step,
+ style.displayCancelButtonInLastStep);
+ style.displayStepDataInSubtitleOfClosedSteps = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_display_step_data_in_subtitle_of_closed_steps,
+ style.displayStepDataInSubtitleOfClosedSteps);
+ style.displayDifferentBackgroundColorOnDisabledElements = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_display_different_background_color_on_disabled_elements,
+ style.displayDifferentBackgroundColorOnDisabledElements);
+ style.includeConfirmationStep = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_include_confirmation_step,
+ style.includeConfirmationStep);
+ style.allowNonLinearNavigation = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_allow_non_linear_navigation,
+ style.allowNonLinearNavigation);
+ style.allowStepOpeningOnHeaderClick = vars.getBoolean(
+ R.styleable.VerticalStepperFormView_form_allow_step_opening_on_header_click,
+ style.allowStepOpeningOnHeaderClick);
+ style.alphaOfDisabledElements = vars.getFloat(
+ R.styleable.VerticalStepperFormView_form_alpha_of_disabled_elements,
+ style.alphaOfDisabledElements);
+
+ vars.recycle();
}
internalListener = new FormStepListener();