Skip to content

Commit

Permalink
Merge pull request #26 from jiachenning/master
Browse files Browse the repository at this point in the history
support dynamic new FormEditText()
  • Loading branch information
vekexasia committed Oct 10, 2014
2 parents 03cf366 + cbf317c commit e298061
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions library/src/com/andreabaccega/widget/DefaultEditTextValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
public class DefaultEditTextValidator
implements EditTextValidator
{
/**
* support dynamic new DefaultEditTextValidator() ,used for Java call
* @param editText
* @param context
*/
public DefaultEditTextValidator( EditText editText, Context context )
{
testType = EditTextValidator.TEST_NOCHECK;
setEditText( editText );
resetValidators( context );
}

public DefaultEditTextValidator( EditText editText, AttributeSet attrs, Context context )
{
Expand Down
4 changes: 2 additions & 2 deletions library/src/com/andreabaccega/widget/FormEditText.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class FormEditText extends EditText {
public FormEditText(Context context) {
super(context);
// FIXME how should this constructor be handled
throw new RuntimeException("Not supported");
//support dynamic new FormEditText(context)
editTextValidator = new DefaultEditTextValidator(this, context);
}

public FormEditText(Context context, AttributeSet attrs) {
Expand Down

0 comments on commit e298061

Please sign in to comment.