项目作者: marcoscgdev

项目描述 :
An Android EditText with automatic currency formatting.
高级语言: Kotlin
项目地址: git://github.com/marcoscgdev/CurrencyEditText.git
创建时间: 2021-04-05T22:53:33Z
项目社区:https://github.com/marcoscgdev/CurrencyEditText

开源协议:Apache License 2.0

下载


CurrencyEditText

An Android EditText with automatic currency formatting.


Releases:

Current release: 1.0.1.

You can see all the library releases here.


Screenshots

Download the sample apk here.


Usage:

Adding the depencency

Add this to your root build.gradle file:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Now add the dependency to your app build.gradle file:

  1. implementation 'com.github.marcoscgdev:CurrencyEditText:1.0.1'

Using the widget

  1. <com.marcoscg.currencyedittext.CurrencyEditText
  2. android:id="@+id/editText"
  3. android:layout_width="match_parent"
  4. android:layout_height="wrap_content" ></com.marcoscg.currencyedittext.CurrencyEditText>

Retrieving the value

  1. val value = currencyEditText.getNumericValue()

Using a custom locale

  1. currencyEditText.setLocale(Locale.UK)

Setting max number length

  1. currencyEditText.setMaxLength(6)

See the sample project to clarify any queries you may have.


License

  1. Copyright 2021 Marcos Calvo García
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.