The widgets (EditText and TextView) for support of money requirements like currency, number formatting, comma formatting etc.

Overview

EasyMoney-Widgets

Build Status Download Android Arsenal API API

The widgets (EditText and TextView) for support of money requirements like currency, number formatting, comma formatting etc.

NOTE: This library support ALL and ANY kind of currency. The currencies in the demo are just for example. The library is NOT limited to those currencies.

Features

  • EasyMoneyEditText and EasyMoneyTextView widgets
  • Custom currency support added through string symbol, Locales, or Currency objects
  • Commas formatting support added
  • Show/hide currency symbol
  • Show/hide commas in the widgets
  • Get raw value in string or formatted value in string

Demo

Install Demo app or APK from Releases on your device and play with the values of EasyMoneyEditText and EasyMoneyTextView!

Changelog

Changes exist in the releases tab.

Installation

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

dependencies {
  compile 'com.wajahatkarim3.EasyMoney-Widgets:EasyMoney-Widgets:1.0.0'
}

Or add EasyMoney-Widgets as a new dependency inside your pom.xml

<dependency>
  <groupId>com.wajahatkarim3.EasyMoney-Widgets</groupId>
  <artifactId>EasyMoney-Widgets</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Usage

XML

EasyMoneyEditText in xml layouts (output will be $ 123,456,234)

 <com.wajahatkarim3.easymoneywidgets.EasyMoneyEditText
        android:id="@+id/moneyEditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="123456234"
        android:inputType="numberDecimal"
        app:show_currency="true"
        app:show_commas="true"
        app:currency_symbol="$"
        />

EasyMoneyTextView in xml layouts (output will be $ 123,456,234)

 <com.wajahatkarim3.easymoneywidgets.EasyMoneyTextView
        android:id="@+id/moneyTextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="123456234"
        app:show_currency="true"
        app:show_commas="true"
        app:currency_symbol="$"
        />

Customization in XML

All customizable attributes for EasyMoneyWidgets

Attribute Name Default Value Description
app:currency_symbol="$" US Dollar $ The currency symbol for the widgets
app:show_currency="true" true Whether to show the currency symbol in the widgets
app:show_commas="true" true Whether to show the commas between numbers in the widgets

In Code (Java)

// Set the value for money widgets
moneyEditText.setText("23456.01");                          // $ 23,456.01
moneyTextView.setText("1234");                              // $ 1,234

// Get the value from money widgets
String valForm = moneyView.getFormattedString();            // $ 23,456.01
String valRaw = moneyView.getValueString();                 // 23456.01

// Set the currency of the money widgets
moneyView.setCurrency("");                                 // € 23,456.01
moneyView.setCurrency(Locale.UK);                           // £ 23,456.01
moneyView.setCurrency(Currency.getInstance(Locale.US));     // $ 23,456.01

// Show/hide currency of the money widgets
moneyView.showCurrencySymbol();                             // $ 23,456.01
moneyView.hideCurrencySymbol();                             // 23,456.01
boolean curr = moneyView.isShowCurrency();                  // true if currency is shown

// Show/hide commas of the money widgets
moneyView.showCommas();                                     // $ 23,456.01
moneyView.hideCommas();                                     // $ 23456.01

Donations

This project needs you! If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, feel free to donate. Your donation is highly appreciated (and I love food, coffee and beer). Thank you!

PayPal

  • Donate $5: Thank's for creating this project, here's a tea (or some juice) for you!
  • Donate $10: Wow, I am stunned. Let me take you to the movies!
  • Donate $15: I really appreciate your work, let's grab some lunch!
  • Donate $25: That's some awesome stuff you did right there, dinner is on me!
  • Donate $50: I really really want to support this project, great job!
  • Donate $100: You are the man! This project saved me hours (if not days) of struggle and hard work, simply awesome!
  • Donate $2799: Go buddy, buy Macbook Pro for yourself!

Of course, you can also choose what you want to donate, all donations are awesome!

Developed By

Wajahat Karim

How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Copyright 2016 Wajahat Karim

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Wrapper of FusedLocationProviderClient for Android to support modern usage like LiveData and Flow

FancyLocationProvider Wrapper of FusedLocationProviderClient for Android to support modern usage like LiveData or Flow. Install Add Jitpack repository

A beautiful Fashion Store like Android App Mock built on Jetpack Compose with compose navigation, hilt, dark theme support and google's app architecture found on uplabs Here
A beautiful Fashion Store like Android App Mock built on Jetpack Compose with compose navigation, hilt, dark theme support and google's app architecture found on uplabs Here

A beautiful Fashion Store like Android App Mock built on Jetpack Compose with compose navigation, hilt, dark theme support and google's app architecture found on uplabs Here

Guess The Number With Kotlin
Guess The Number With Kotlin

GUESS THE NUMBER KOTLIN App Content https://streamable.com/w6t0d4 App code (Main

Com.hhvvg.anytext - An application provides features to modify any TextView in any other applications

AnyText What's this This application provides features to modify any TextView in

Sample app that implements MVVM architecture using Kotlin, ViewModel, LiveData, and etc.

TheShard is a project to showcase different architectural approaches to developing Android apps. In its different branches you will find the same app (A movie Listing and detail page) implemented with small differences.

Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing functionality and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.), inspired by Badoos RIBs fork of the Uber RIBs framework
Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing functionality and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.), inspired by Badoos RIBs fork of the Uber RIBs framework

Decompose Please see the project website for documentation and APIs. Decompose is a Kotlin Multiplatform library for breaking down your code into life

Sample application to demonstrate Multi-module Clean MVVM Architecture and usage of Android Hilt, Kotlin Flow, Navigation Graph, Unit tests etc.
Sample application to demonstrate Multi-module Clean MVVM Architecture and usage of Android Hilt, Kotlin Flow, Navigation Graph, Unit tests etc.

MoneyHeist-Chars Sample application to demonstrate Multi-module Clean MVVM Architecture and usage of Android Hilt, Kotlin Flow, Navigation Graph, Room

Anime quotes rest api app with mvvm, LiveData, Coroutines, Navigation Component etc

AnimeQuote Anime quotes image rest api app with mvvm, LiveData, Coroutines, Navigation Component, clean achitecture etc An app created during mentorin

FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language
FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

This repository contains a FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

Comments
  • small bug

    small bug

    if you move your selection on top(behine CurrencySymbol) then enter point("."),it will break; so,i temporary do this.

    code: else { // Some decimal number if (valStr.contains(".")) { try { if (valStr.indexOf(".") == valStr.length()-1) { // decimal has been currently put String front = getDecoratedStringFromNumber(Long.parseLong(valStr.substring(0, valStr.length()-1))); setText(front + "."); } else { String[] nums = getValueString().split("\."); String front = getDecoratedStringFromNumber(Long.parseLong(nums[0])); setText(front+"."+nums[1]); } }catch (Exception e){ setText("0"+valStr); } } }

    ps:this way is not good...

    opened by SuzutsukiKagami 2
  • suggestions and ideas

    suggestions and ideas

    adding complete supporting symbols and currency name here are the suggesting list: SEK,SGD,THB,TRY,TWD,UAH,UYU,VND,ZAR,SAR,RUB,RON,PLN,PHP,PEN,NZD,NOK,MYR,MXN,MAD,KRW,JPY,INR,ILS,IDR,HUF,HRK,HKD,BGP,EUR,DKK,CZK,CRC,COP,CNY,CHF,CAD,BRL,BGN,AUD,ARS,AED

    let the module to allow currency output to type LONG and using cent base.

    opened by jjhesk 1
  • Not able to enter -ve value

    Not able to enter -ve value

    I'm not able to enter negative value! I have set input type as number signed, still not able to enter -ve sign. android:inputType="numberSigned"

    opened by SameerMB 0
Releases(1.0.0)
Owner
Wajahat Karim
🧑🏽‍💻 Lead Android @AirliftTech 🔥 Google Dev Expert (GDE). 📱 Android Developer . 💻 Open Source . 📕 Books x2 Author 📝 Blogger 🎤 Public Speaker
Wajahat Karim
Android library to calculate sun phases like golden hour, blue hour, sunrise, sunset etc

Solarized This is Android library to calculate sun phases like golden hour, blue hour, sunrise, sunset etc Features first / last light golden hour blu

null 8 Nov 29, 2022
A minimal notes application in Jetpack Compose with MVVM architecture. Built with components like DataStore, Coroutines, ViewModel, LiveData, Room, Navigation-Compose, Coil, koin etc.

Paper - A Minimal Notes App A minimal notes application in Jetpack Compose with MVVM architecture. Built with components like DataStore, Coroutines, V

Akshay Sharma 139 Jan 2, 2023
Open source Crypto Currency Tracker Android App made fully in Kotlin

CoinBit CoinBit is a beautiful CryptoCurrency app, completely open sourced and 100% in kotlin. It supports following features Track prices of over 300

Pranay Airan 50 Dec 5, 2022
An example of a test task for creating a simple currency converter application for the Android platform. The app is developed using Kotlin, MVI, Dagger Hilt, Retrofit, Jetpack Compose.

Simple Currency Converter Simple Currency Converter Android App by Isaev Semyon An example of a test task for creating a simple currency converter app

Semyon Isaev 1 Nov 8, 2021
Coin Stalker App is an android application that displays current crypto currency rates.

Coin-Stalker Coin Stalker App is an android application that displays current crypto currency rates based on modern Android application tech-stacks an

Barış Sağlam 1 Aug 16, 2022
An application for tracking the value of crypto currency

CriptoApp an application for tracking the value of crypto currency API https://m

Alex92w 0 Dec 19, 2021
AppConversorMoedas - The currency conversion using an API to bring the data up to date

LAB - Criando um app de conversor moedas/cambio com Kotlin. O curso pode ser ace

Davi Braga 0 Jan 1, 2022
Crypto currency tracker with jetpack compose & clean architecture

Dash Coin DashCoin is a crypto currency tracker with jetpack compose and clean architecture This project is developed by MathRoda for more projects Gi

MathRoda 84 Dec 25, 2022
A simple library that can connect your autocomplete edittext to Google places api

Google Places AutoComplete EditText A simple library that can connect your autocomplete edittext to Google's places api Supporting Places AutoComplete

Mukesh Solanki 71 Dec 28, 2022
An extension of EditText with pin style written in Kotlin

pin-edittext An extension of EditText with pin style Usage Include PinCodeEditText in your layout XML <com.oakkub.android.PinEditText android:layo

Metas Kerdwat 15 May 28, 2021