VIF - Validation Input Filter (VIF) for Android Edittext

Overview

VIF (Validation Input Filter)

This library allows you to add various validations for the Edittext Input you use in your application.

Features

  • Email
  • Name or Surname
  • Phone

Validations..

Implementation

dependencies {
    implementation 'io.github.fkocak2505:vif:1.0.0'
}

Classes & Functions

VIFEmail (Validation Input Filter for Email)

Function Name Parameters
etLosesFocus() ignoreLastSpesificChar: String, cannotMoreThanCharecter: String
ignoreMultipleSpesificSymbol() iMultipleSymbol: String
ignoreFirstSpesificChar() iFirstSymbol: MutableList<String>
ignoreConsecutiveChars() iConsecutiveChars: String
ignoreTwoCharsConsecutive() iTwoConsecutiveChars: MutableList<String>

VIFName (Validation Input Filter for Name or Surname)

Function Name Parameters
ignoreFirstSpesificChar() iFirstSpesificSymbol: MutableList<String>
ignoreConsecutiveCharByLimit() iConsecutiveChartLimit: Int
ignoreVowelCharByLimit() iVowelCharLimit: Int
ignoreConsonantCharByLimit() iConsonantCharLimit: Int

VIFPhone (Validation Input Filter for Phone)

Function Name Parameters
etLoseFunction() ignoreFirstCharForPhoneNumber: String, areaCode: String

VIFEmail Functions Description

etLosesFocus(ignoreLastSpesificChar, cannotMoreThanCharecter)

It works as soon as the edittext loses focus. It has two parameters.

  • First parameter, you specify which last character of Email you cannot type.
  • The second parameter is "@,-,_,." Except for the minimum value that should be in the email. For example "[email protected]" would be an invalid mail.

 

ignoreMultipleSpesificSymbol(iMultipleSymbol)

If you do not want to use more than one special character (without @,-,_,.) in the e-mail address, you should use this method.

 

ignoreFirstSpesificChar(iFirstSymbol)

If there are characters that you do not want for the first letter in the email address, you should use this method. You can write as many values ​​as you want in the array.

 

ignoreConsecutiveChars(iConsecutiveChars)

If you do not want consecutive characters in the email, you should use this method.

 

ignoreTwoCharsConsecutive(iTwoConsecutiveChars)

If there are two characters in the email that you do not want to be consecutive, you should use this method. You must send values ​​in array

 

VIFName Functions Description

ignoreFirstSpesificChar(iFirstSpesificSymbol)

If there are two characters in the name that you do not want to be consecutive, you should use this method. You must send values ​​in array

 

ignoreConsecutiveCharByLimit(iConsecutiveChartLimit)

If you want to determine the maximum number of the same character in the name, you should use this method.

 

ignoreVowelCharByLimit(iVowelCharLimit)

If you want to specify the maximum number of repetitions of vowels in the name, you should use this method.

 

ignoreConsonantCharByLimit(iConsonantCharLimit)

If you want to specify the maximum number of consonants in the name, you should use this method.

 

VIFPhone Functions Description

etLoseFunction(ignoreFirstCharForPhoneNumber,areaCode)

It works as soon as the edittext loses focus. It has two parameters.

  • First parameter, you specify which first number of phone you cannot type.
  • The second parameter is area code. This parameter is mandatory to calculate the first parameter and must be written in full.

 

VIF Example

VIFEmail

VIFEmail(binding.etEmail, this@MainActivity)
        .etLosesFocus(".", 4)
        .ignoreMultipleSpesificSymbol("@")
        .ignoreFirstSpesificChar(mutableListOf("@","."))
        .ignoreConsecutiveChars(".")
        .ignoreTwoCharsConsecutive(mutableListOf(".@", "@."))

binding.etEmail.filters = arrayOf(validationOfEmail)

 

VIFName

VIFName(this@MainActivity)
        .ignoreFirstSpesificChar(mutableListOf("ğ", " "))
        .ignoreConsecutiveCharByLimit(2)
        .ignoreVowelCharByLimit(3)
        .ignoreConsonantCharByLimit(4)

binding.etName.inputType = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS or InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
binding.etName.filters = arrayOf(validationOfName)

 

VIFPhone

VIFPhone(binding.etPhone, this@MainActivity)
        .etLoseFunction("5", "+90")

binding.etPhone.filters = arrayOf(validationOfPhone)

 

Authors

You might also like...
An extension of Android's TextView, EditText and Button that let's you use the font of your choice

AnyTextView (deprecated) Note: AnyTextView is no longer being maintained. I recommend replacing AnyTextView with the Calligraphy library instead. Frus

Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText
Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText

Simple Linkable Text Simple way to create link text, such as @username or #hashtag, in Android TextView and EditText Installation Gradle Add dependenc

A simple Android Tag EditText
A simple Android Tag EditText

TagEditText A simple Android Tag EditText. Setup The easiest way to add the TagEditText library to your project is by adding it as a dependency to you

An Android App example of how to create a custom EditText using DoubleLinkedList Data Structure
An Android App example of how to create a custom EditText using DoubleLinkedList Data Structure

DoubleLinkedListEditText Library This is a library to create an EditText based on the Doubly Linked List data structure so that the user can enter cod

A custom EditText with a switchable icon which shows or hides the password
A custom EditText with a switchable icon which shows or hides the password

Deprecated This library is deprecated now as there is an official way to use the password toggle with the TextInputLayout (inside the support library

A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform
A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform

material-singleinputform A single EditText instead of a classical form. This Library is a library implementation of flavienlaurent's "Single input for

A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform
A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform

material-singleinputform A single EditText instead of a classical form. This Library is a library implementation of flavienlaurent's "Single input for

Uma máscara personalizável para EditText, que pode ser adicionada como um TextWatcher.

Custom-Mask-for-EditText 🎭 ( Máscara personalizável para EditTexts!) Uma máscara customizável que pode ser adicionada aos seus EditTexts, e adaptada

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.
RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android. Looking for iOS? Check out cjwirth/RichEditorView Supported Functions Bold

Owner
null
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Linden 147 Nov 20, 2022
Android library contain custom realisation of EditText component for masking and formatting input text

Masked-Edittext Masked-Edittext android library EditText widget wrapper add masking and formatting input text functionality. Install Maven <dependency

Evgeny Safronov 600 Nov 29, 2022
Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.

MaskFormatter MaskFormatter adds mask functionality to your EditText. It will prevent user from inserting not allowed signs, and format input as well.

Azimo Labs 161 Nov 25, 2022
Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

AnimatedEditText for Android This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement fe

Ali Muzaffar 439 Nov 29, 2022
Date text field with on the fly validation built with Jetpack Compose.

Date text field with on the fly validation built with Jetpack Compose.

null 15 Nov 16, 2022
A material style input for codes

Material Code input A material style input for put codes Based on Code input field concept by SAMUEL KANTALA How to use Minimal SDK Version 11 Usage w

Adrián Lomas 962 Nov 26, 2022
User input masking library repo.

More GIFs [~3 MB] Migration Guide: v.6 This update brings breaking changes. Namely, the autocomplete flag is now a part of the CaretGravity enum, thus

red_mad_robot 1.2k Dec 20, 2022
A library to show emoji in TextView, EditText (like WhatsApp) for Android

Discontinued This projected is discontinued. Please consider using other alternative, i.e EmojiCompat. Contact me if you want to continue working on a

Hieu Rocker 3.6k Jan 5, 2023
AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size.

AutoscaleEditText AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size. Latest Version How to use

Txus Ballesteros 354 Nov 28, 2022
A module designed to encapsulate the use of an Android EditText field for gathering currency information from a user. Supports all ISO-3166 compliant locales/currencies.

CurrencyEditText CurrencyEditText is an extension of Android's EditText view object. It is a module designed to provide ease-of-use when using an Edit

Josh Kitchens 335 Dec 25, 2022