-
Notifications
You must be signed in to change notification settings - Fork 7
hgfgg #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nvmanh
wants to merge
17
commits into
tesk_hook
Choose a base branch
from
master
base: tesk_hook
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
hgfgg #8
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
132acd0
add ci
60f5ff7
Merge pull request #3 from nvmanh/update_style
nvmanh 0677e7b
update check style report
7c0a48d
Merge pull request #4 from nvmanh/update_checkstyle
nvmanh 14d1611
test
cd5576c
a
nvmanh f49c953
Merge pull request #6 from nvmanh/task_1
nvmanh fc787de
updated
ae9a17b
Merge pull request #10 from nvmanh/chatwork
nvmanh d123b41
create, merge pull
d40547b
Merge pull request #15 from nvmanh/chatwork_5
nvmanh 5982f40
adt
b5709b8
Merge pull request #16 from nvmanh/adt
nvmanh b156f13
test 3
nvmanh 56e3623
Merge pull request #18 from nvmanh/test_3
nvmanh c5dbaf6
updated
nvmanh a7021ca
Merge pull request #19 from nvmanh/update_24072016
nvmanh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 26 additions & 18 deletions
44
app/src/main/java/com/manhnv/validation/EmailVerifier.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,66 @@ | ||
| package com.manhnv.validation; | ||
|
|
||
| public interface IVerifier { | ||
| public static final int SUCCESS_CODE = -1; | ||
| public static final int ERROR_CODE_REQUIRED = 0; | ||
| public static final int ERROR_CODE_MIN = 1; | ||
| public static final int ERROR_CODE_MAX = 2; | ||
| public static final int ERROR_CODE_EMAIL = 3; | ||
| public static final int ERROR_CODE_NUMBER = 4; | ||
| public static final int ERROR_CODE_FUTURE = 5; | ||
| public static final int ERROR_CODE_FROM_DATE = 6; | ||
| public static final int ERROR_CODE_TO_DATE = 7; | ||
| int SUCCESS_CODE = -1; | ||
| int ERROR_CODE_REQUIRED = 0; | ||
| int ERROR_CODE_MIN = 1; | ||
| int ERROR_CODE_MAX = 2; | ||
| int ERROR_CODE_EMAIL = 3; | ||
| int ERROR_CODE_NUMBER = 4; | ||
| int ERROR_CODE_FUTURE = 5; | ||
| int ERROR_CODE_FROM_DATE = 6; | ||
| int ERROR_CODE_TO_DATE = 7; | ||
|
|
||
| /** | ||
| * do validate action in here | ||
| * | ||
| * | ||
| * @return true: validated success<br> | ||
| * false: validated fail | ||
| * false: validated fail | ||
| */ | ||
| boolean verify(); | ||
|
|
||
| /** | ||
| * error message will be show on | ||
| * {@linkplain #android.widget.TextView.setError(CharSequence error)} | ||
| * | ||
| * | ||
| * @return if user define his message {@link #setErrorMessage(String)} -> show this message<br> | ||
| * if not show default message field name + message | ||
| * if not show default message field name + message | ||
| * @see android.widget.EditText#setError(CharSequence) | ||
| */ | ||
| String getErrorMessage(); | ||
|
|
||
| /** | ||
| * using to show error message and you can know what field is invalid | ||
| * | ||
| * | ||
| * @return field name (pass in constructor by user) | ||
| */ | ||
| String getFieldName(); | ||
|
|
||
| /** | ||
| * belong to type of verifier: email, phone, blank ... | ||
| * | ||
| * @param error | ||
| * | ||
| * @return String fit with error code | ||
| */ | ||
| String getErrorMessage(int error); | ||
|
|
||
| /** | ||
| * belong to type of verifier: email, phone, blank ... | ||
| * | ||
| * | ||
| * @return code of error | ||
| */ | ||
| int getErrorCode(); | ||
|
|
||
| /** | ||
| * {@linkplain #android.widget.TextView.setError(CharSequence error)} | ||
| * @see android.widget.EditText#setError(CharSequence) | ||
| */ | ||
| void showError(); | ||
|
|
||
| /** | ||
| * {@linkplain #android.widget.TextView.setError(CharSequence error)} setError(null) | ||
| * @see android.widget.EditText#setError(CharSequence) | ||
| */ | ||
| void hideError(); | ||
|
|
||
| /** | ||
| * user defined his message | ||
| * | ||
| * @param message | ||
| */ | ||
| void setErrorMessage(String message); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #Mon Dec 28 10:00:20 PST 2015 | ||
| #Mon Aug 29 14:22:56 ICT 2016 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"a":"123", "b":2} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@