EditTextPicker

Additional

Language
Java
Version
1.0.2 (May 23, 2019)
Created
Nov 7, 2018
Updated
Jun 2, 2019
Owner
Ali Azaz Alam (AliAzaz)
Contributor
Ali Azaz Alam (AliAzaz)
1
Activity
Badge
Generate
Download
Source code
APK file

Commercial

EditTextPicker 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

Images

How to use it??

Gradle

In project.gradle add this code it in root build.gradle at the end of repositories:

allprojects {
 repositories {
  ...
  maven { url 'https://jitpack.io' }
 }
}

Now, add the dependency in app.gradle:

dependencies {
    implementation 'com.github.AliAzaz:Edittext-Library:X.X.X'
}

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;

LICENSE

Distributed under the MIT license. See LICENSE information.