AliAzaz / Edittext Picker
Projects that are alternatives of or similar to Edittext Picker
EditTextPicker/Masked-Edittext Library
Edittext library by which you can easily achieve lot of functionalities though directly implemented some lines of code in XML and on Java side. Following are the functions that EditTextPicker provides:
- Empty checking
- Masking Edittext
- Pattern checking
- Range checking
Description:
Please see the description of this library on my article Edittext Picker Library
Some Output Screenshots
How to use it??
Implementation
In project.gradle add this code it in root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Note: In future the new amendments will only reflect on AndroidX support
Now, add the dependency in app.gradle:
dependencies {
implementation 'com.github.AliAzaz:Edittext-Library:X.X.X'
}
Quick Usage
XML
Note: By default required is true. But if you don't want to validate specific edittext then simply set it to false: app:required="false"
-- Required Edittext
<com.edittextpicker.aliazaz.EditTextPicker
android:id="@+id/txtBoxReq"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:required="true" />
-- Range (5-10) with default value of 999
<com.edittextpicker.aliazaz.EditTextPicker
android:id="@+id/txtBoxRange"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
app:defaultValue="999"
app:maxValue="10"
app:minValue="5"
app:required="true"
app:type="range" />
-- Masking
<com.edittextpicker.aliazaz.EditTextPicker
android:id="@+id/txtMask"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
app:mask="##-##-####"
app:required="false" />
-- Pattern with default value checking [Following pattern is: (2-4)Characters with (3-5)Digits ]
<com.edittextpicker.aliazaz.EditTextPicker
android:id="@+id/txtBoxDefault"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:defaultValue="null"
app:pattern="[^0-9]{2,4}[0-9]{3,5}"
app:required="true"
app:type="equal" />
Java
Implement this code in submit button click
--- For Required component
if (!txtBoxReq.isEmptyTextBox())
return;
-- For validating range component
if (!txtBoxRange.isRangeTextValidate())
return;
-- For validating pattern component
if (!txtBoxDefault.isTextEqualToPattern())
return;
CONNECT👍
Medium: https://medium.com/@ali.azaz.alam
Twitter: https://twitter.com/AliAzazAlam1
Github: https://github.com/aliazaz
LinkedIn: https://www.linkedin.com/in/aliazazalam/
LICENSE
Distributed under the MIT license. See LICENSE information.