PhoneEditText makes it easy for you to handle country codes in Phone number fields of your android application. PhoneEditText identifies your country and sets its respective dial code automatically.
forks-badge stars-badge watcher-badge repo_size-badge
Add JitPack to your Project level build.gradle file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the Phone Edit Text Dependency to App level build.gradel file
dependencies {
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'com.github.amannirala13:PhoneEditText-Android:1.1.1'
}
Add the dependency to App level build.gradel file
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'com.asdev.PhoneEditText-Android:PhoneEditText-Android:1.1.1'
<com.asdev.phoneedittext.PhoneEditText android:layout_width="match_parent" android:layout_height="wrap_content" />
import com.asdev.phoneedittext.PhoneEditText; ... ... ... PhoneEditText myPhoneEditText = findViewById(R.id.YOUR_EDIT_TEXT_ID) String code = myPhoneEditText.getDIAL_CODE(); /* return type of getDIAL_CODE() is String*/
- No drop down lists.
- No user based inputs
- No predictive definitions of dial codes.
- Dial code can be changed upon the wish of the user
- Full support of TextInputEditText
- Sets the country code to default +91 when the device is on a Wi-Fi network
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
We would love to connect with you on different social media platforms, here are the links to all out social-media and coding platform handles where you can follow our work.
github_follow_badge twitter-badge
If you like our work, a bit of contribution would motivate us a lot for more open source contributions.