![](https://camo.githubusercontent.com/ceeed8dbadf2bc425ac98e3c26d69e82723b95dff6c19ef777101a4a80790fa0/68747470733a2f2f6a69747061636b2e696f2f762f6d726d6b682f416e64726f6964437573746f6d45646974546578742e737667)
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.mrmkh:AndroidCustomEditText:1.0.2'
}
![Optional title Alt text](https://camo.githubusercontent.com/2c085c1cc51b2175d365b9617268673efb55914272d23bbd82791d5fb0369394/687474703a2f2f7331322e7069636f66696c652e636f6d2f66696c652f383430333939323935302f556e7469746c6564312e706e67)
<custom.edittext.lib.Username
android:id="@+id/user"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<custom.edittext.lib.Password
android:id="@+id/pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<custom.edittext.lib.EmailAddress
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<custom.edittext.lib.PhoneNumber
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<custom.edittext.lib.CustomEditText
android:id="@+id/text"
app:hintText="Custom Iconic EditText"
app:set_text=""
app:input_type="textEmailAddress"
app:hintIcon="@drawable/search_24dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
private void phoneNum() {
// Toast.makeText(this, phone.getCountryCode()+" "+phone.getText(), Toast.LENGTH_SHORT).show();
test1.setText(phone.getCountryCode()+" "+phone.getText());
}
private void emailValid() {
boolean mailValid = email.isValid(EmailAddress.ValidationType.EMAIL);
if (mailValid == true){
Toast.makeText(this, "true", Toast.LENGTH_SHORT).show();
}
else if (mailValid==false){
email.setError("Email is invalid");
}
}
private void passwordValid() {
boolean passValid = pass.isValid(Password.ValidationType.PASSWORD);
if (passValid==true){
Toast.makeText(this, "True", Toast.LENGTH_SHORT).show();
} else if (passValid==false){
pass.setError("8 characters long\ninclude at least one number and symbol\n1 uppercase & 1 lowercase character");
}
}
private void usernameValid() {
boolean userValid = user.isValid(Username.ValidationType.USERNAME);
if (userValid==true){
Toast.makeText(this, "True", Toast.LENGTH_SHORT).show();
} else {
user.setError("Please use only letters (a-z) , numbers and Underline");
//4-32 character
}
}
MIT