Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Commit aca35fd

Browse files
committed
Change methods signature to better expressive
1 parent c6adada commit aca35fd

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ public class YourActivity extends AppCompatActivity implements Validator.Validat
174174
}
175175
176176
@Override
177-
public void onSuccess() {
177+
public void onValidationSuccess() {
178178
saveToDatabase();
179179
}
180180
181181
@Override
182-
public void onError() {
182+
public void onValidationError() {
183183
Toast.makeText(YourActivity.this, "Dados inválidos!", Toast.LENGTH_SHORT).show();
184184
}
185185
}

library/src/main/java/br/com/ilhasoft/support/validation/Validator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public void toValidate() {
3939
if (validationListener == null) throw new IllegalArgumentException("Validation listener should not be null.");
4040

4141
if (validate()) {
42-
validationListener.onSuccess();
42+
validationListener.onValidationSuccess();
4343
} else {
44-
validationListener.onError();
44+
validationListener.onValidationError();
4545
}
4646
}
4747

@@ -114,8 +114,8 @@ private List<View> getViewsWithValidation(View view) {
114114

115115
public interface ValidationListener {
116116

117-
void onSuccess();
117+
void onValidationSuccess();
118118

119-
void onError();
119+
void onValidationError();
120120
}
121121
}

sample/src/main/java/br/com/ilhasoft/support/validation/sample/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ public class MainActivity extends AppCompatActivity implements Validator.Validat
2020
private Validator validator;
2121

2222
@Override
23-
public void onSuccess() {
23+
public void onValidationSuccess() {
2424
saveToDatabase();
2525
}
2626

2727
@Override
28-
public void onError() {
28+
public void onValidationError() {
2929
Toast.makeText(MainActivity.this, "Dados inválidos!", Toast.LENGTH_SHORT).show();
3030
}
3131

0 commit comments

Comments
 (0)