Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
adding max length and singleline option by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo Esparis committed Feb 13, 2017
1 parent 9010821 commit 048f104
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.leoxnidas.phoneedittext;



public class Codes {
public static final int AFG = 1;
public static final int ALB = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.text.Editable;
import android.text.InputFilter;
import android.text.InputType;
import android.text.Selection;
import android.text.TextWatcher;
Expand Down Expand Up @@ -48,6 +49,8 @@ public void setCode(int code) {
p_mCode = code;
p_mCodeStr = Codes.asString(code);
setText((PLUS + p_mCodeStr));
setSingleLine(true);
setFilters(new InputFilter[]{new InputFilter.LengthFilter(14)});
} else {
throw new RuntimeException("International code does not exists.");
}
Expand Down

0 comments on commit 048f104

Please sign in to comment.