All Projects → AbhinayMe → currency-edittext

AbhinayMe / currency-edittext

Licence: Apache-2.0 license
A Custom EditText implementation that allows formatting of currency-based numeric inputs.

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to currency-edittext

CustomFontView
Custom View classes for TextView, EditText & Buttons - to set custom fonts
Stars: ✭ 26 (-69.77%)
Mutual labels:  android-application, android-app, edittext
HomeApp
A little smart home app for Philips Hue and other devices
Stars: ✭ 54 (-37.21%)
Mutual labels:  android-application, android-app
xkcdViewer
A beautiful xkcd viewer app written with Flutter
Stars: ✭ 60 (-30.23%)
Mutual labels:  android-application, android-app
Extract-Color-Palette-Api
Create gradient drawable by extracting prominent colors from image⚫⚪
Stars: ✭ 16 (-81.4%)
Mutual labels:  android-application, android-app
Bottomsheet
BottomSheet dialog library for Android
Stars: ✭ 219 (+154.65%)
Mutual labels:  android-application, android-app
Modern Android Development
Modern Android Development tools & key points
Stars: ✭ 219 (+154.65%)
Mutual labels:  android-application, android-app
media-picker
Easy customizable picker for all your needs in Android application
Stars: ✭ 167 (+94.19%)
Mutual labels:  android-application, android-app
Baldphone
A new accessible interface for your smartphone, suitable for seniors
Stars: ✭ 181 (+110.47%)
Mutual labels:  android-application, android-app
Simpler
Simpler是一款轻量级的第三方微博应用,具有微博的基础功能,兼有外观优雅,运行流畅,内存占用低,省电省流量等特点。
Stars: ✭ 27 (-68.6%)
Mutual labels:  android-application, android-app
BatteryTool
Automatically stop apps running in the background. Free, no ads and open source.
Stars: ✭ 48 (-44.19%)
Mutual labels:  android-application, android-app
screenshot
This library helps to take screenshot dynamically
Stars: ✭ 64 (-25.58%)
Mutual labels:  android-application, android-app
Ionic Starter Template
Reinventing the wheel, again! Sorry Ionic Team... but there are many newbies learning on Youtube!
Stars: ✭ 208 (+141.86%)
Mutual labels:  android-application, android-app
Moviehunt
Movie Android App written in Kotlin, MVVM, RxJava, Android Architecture Components.
Stars: ✭ 199 (+131.4%)
Mutual labels:  android-application, android-app
CurrencyEditText
A simple EditText input designed to input decimal and currency values.
Stars: ✭ 18 (-79.07%)
Mutual labels:  currency, edittext
Rethink App
DNS over HTTPS / DNS over Tor / DNSCrypt client, firewall, and connection tracker for Android.
Stars: ✭ 188 (+118.6%)
Mutual labels:  android-application, android-app
Floral
Minimal design gallery app for Android.
Stars: ✭ 23 (-73.26%)
Mutual labels:  android-application, android-app
Litrato
Android photo editing app with various filters and tools. Included advanced features like masking, histogram, color picker, EXIF viewer...
Stars: ✭ 54 (-37.21%)
Mutual labels:  android-application, android-app
Posidonlauncher
a one-page homescreen with a news feed
Stars: ✭ 163 (+89.53%)
Mutual labels:  android-application, android-app
Paginglibrary Sample
An open source app that is refactored to demo Paging Library from Android Jetpack
Stars: ✭ 165 (+91.86%)
Mutual labels:  android-application, android-app
ClipboardCleaner
Check and clean your clipboard using service, widget, shortcut and quick setting tile.
Stars: ✭ 85 (-1.16%)
Mutual labels:  android-application, android-app

Download Build Status License Android Arsenal

Currency-Edittext

A Custom EditText implementation that allows formatting of currency-based numeric inputs.

Alt text

💻 Installation

Add this in your app's build.gradle file:

dependencies {
  implementation 'me.abhinay.input:currency-edittext:1.1'
}

Or add ClapFab as a new dependency inside your pom.xml

<dependency>
  <groupId>me.abhinay.input</groupId>
  <artifactId>currency-edittext</artifactId>
  <version>1.1</version>
  <type>pom</type>
</dependency>

Implementation Sample

XML

<me.abhinay.input.CurrencyEditText
        android:id="@+id/etInput"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Type value"
        android:inputType="number"
        android:textSize="24sp" />

Code

CurrencyEditText etInput;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    etInput = (CurrencyEditText) findViewById(R.id.etInput);
    etInput.setCurrency(Currency.USA);
    etInput.setDelimiter(false);
    etInput.setSpacing(false);
    etInput.setDecimals(true);
    //Make sure that Decimals is set as false if a custom Separator is used
    etInput.setSeparator(".");
}

Customizing

The following attributes can be manipulated:

  • Currency by specifying the country
  • Spacing between currency and value
  • Delimeter
  • Decimals
  • Thousands Separator Symbol

Currency

Specify the currency by setting the country of your choice.

etInput.Currency = Currency.MALAYSIA;

Currency can also be disabled by:

etInput.Currency = Currency.NONE;

Custom Currency/Symbol

If a custom symbol that is not included in the library is required, any string value can be used since the the Currency attribute expects a String value.

etInput.Currency = "TEST";

Which produces:

TEST 450.00

Note: Currency is set to your app's Local currency by default.

Spacing

The spacing between the currency and the value can be specified by:

etInput.Spacing = true;

Note: Spacing is false by default.

Delimeter

The delimeter attribute allows the addition of a . symbol after displaying the currency.

Rs.100

Rp.100

Note: Delimeter is false by default.

Decimals

Decimals can be turned off for the EditText using:

etInput.Decimals = false;

This outputs the following:

$100,000

Separator

The Thousands Separator can be customized as required with any custom symbol to suit the currency formats of different countries. Example: Indonesia -> 12.000.000 (Using . instead of , as the separator)

NOTE: Decimals must be set as false in order avoid conflicts in getting a clean Double or Integer output

Getting Clean Output

A Double value without Commas, Currency and Decimal places can be retrieved using:

double cleanOutput = etInput.getCleanDoubleValue();

An Integer value without Commas, Currency and Decimal places can be retrieved using:

int cleanOutput = etInput.getCleanIntValue();

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].