Skip to content

custom EditText for add comma when typing and limit lenght scale

Notifications You must be signed in to change notification settings

lordgift/EditTextDecimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EditTextDecimal

version 1.2

EditText Decimal is custom EditText for show decimal with comma(,) and validation of precision & scale

Screenshot

##Component

  1. th.in.lordgift.widget.EditTextDecimal - Decimal with floating point validation.
  2. th.in.lordgift.widget.EditTextIntegerComma - Integer format with comma(,) and validate numberLength because maxLenght count comma(,).
  3. th.in.lordgift.widget.EditTextDecimalComma - mix of above.
  4. th.in.lordgift.widget.EditTextCard - validate idCard format with hyphen(-)

##Installation

Add dependency to your build.gradle

    compile 'th.in.lordgift:edittextdecimal:1.2'

##Usage

Please see the demo module

  1. Add namespace to your top-level layout XML
xmlns:app="http://schemas.android.com/apk/res-auto"
  1. Add components to layout somewhere
   <th.in.lordgift.widget.EditTextDecimalComma
       android:id="@+id/editText2"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:hint="12,345.67"
       app:precision="10"
       app:scale="2" />
  • precision - limit all digit included scale EditTextDecimalComma & EditTextDecimalComma
  • scale - limit digit after point(.) EditTextDecimalComma & EditTextDecimalComma
  • numberLength - limit all digit without comma for EditTextIntegerComma
  • cardType - can only use idCard that is thai id-card format & validation

*DO NOT FORGET SET ATTRIBUTES FOR COMPONENT, please CTRL+SPACE

  1. getValue() to get real value without comma(,) and hyphen(-)

About

custom EditText for add comma when typing and limit lenght scale

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages