-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementado a validação no enveto de focus dos campos
- Loading branch information
1 parent
e01bcdb
commit 16a5739
Showing
4 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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 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
32 changes: 32 additions & 0 deletions
32
sample/src/main/java/com/rca/sample/OnFocusValidationListener.java
This file contains 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,32 @@ | ||
package com.rca.sample; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.view.View; | ||
|
||
import com.rca.formvalidator.Validate; | ||
|
||
/** | ||
* Created by rafael on 22/06/16. | ||
*/ | ||
public class OnFocusValidationListener implements View.OnFocusChangeListener { | ||
|
||
private Validate validate; | ||
|
||
public OnFocusValidationListener(@NonNull Validate validate) { | ||
|
||
this.validate = validate; | ||
} | ||
|
||
@Override | ||
public void onFocusChange(View view, boolean hasFocus) { | ||
|
||
if (hasFocus) { | ||
|
||
validate.closeError(); | ||
|
||
} else { | ||
|
||
validate.isValid(); | ||
} | ||
} | ||
} |