diff --git a/.idea/gradle.xml b/.idea/gradle.xml index a2bbf1c..3a09947 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -3,9 +3,6 @@ - + diff --git a/app/src/main/java/com/edittextpicker/aliazaz/edittextpicker/MainActivity.java b/app/src/main/java/com/edittextpicker/aliazaz/edittextpicker/MainActivity.java index 7cb3713..e56aebc 100644 --- a/app/src/main/java/com/edittextpicker/aliazaz/edittextpicker/MainActivity.java +++ b/app/src/main/java/com/edittextpicker/aliazaz/edittextpicker/MainActivity.java @@ -9,7 +9,7 @@ public class MainActivity extends AppCompatActivity { Button btnSubmit; - com.edittextpicker.aliazaz.EditTextPicker txtBoxRange, txtBoxRangeMaskPat, txtBoxDefault, txtMask, textPhone; + com.edittextpicker.aliazaz.EditTextPicker txtBoxRange, txtBoxRangeMaskPat, txtBoxDefault, txtDate, txtPhone; @Override protected void onCreate(Bundle savedInstanceState) { @@ -26,8 +26,8 @@ private void initializingComponents() { txtBoxRange = findViewById(R.id.txtBoxRange); txtBoxRangeMaskPat = findViewById(R.id.txtBoxRangeMaskPat); txtBoxDefault = findViewById(R.id.txtBoxDefault); - txtMask = findViewById(R.id.txtMask); - textPhone = findViewById(R.id.textPhone); + txtDate = findViewById(R.id.txtDate); + txtPhone = findViewById(R.id.txtPhone); } private void settingListeners() { @@ -54,7 +54,13 @@ private boolean validateComponents() { if (!txtBoxRangeMaskPat.isRangeTextValidate()) return false; - return txtBoxDefault.isTextEqualToPattern(); + if (!txtBoxDefault.isTextEqualToPattern()) + return false; + + if (!txtDate.isEmptyTextBox()) + return false; + + return txtPhone.isEmptyTextBox(); } private void clearFields() { @@ -62,8 +68,8 @@ private void clearFields() { txtBoxRange.setText(null); txtBoxRangeMaskPat.setText(null); txtBoxDefault.setText(null); - txtMask.setText(null); - textPhone.setText(null); + txtDate.setText(null); + txtPhone.setText(null); } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1e89aca..59d4861 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -142,11 +142,11 @@ app:layout_constraintStart_toEndOf="@+id/textView4" app:layout_constraintTop_toBottomOf="@+id/txtBoxRangeMaskPat" app:pattern="[^0-9]{2,4}[0-9]{3,5}" - app:required="true" + app:required="false" app:type="equal" /> + app:required="true" />