CurrencyEditText v2.0.0 Release Notes

Release Date: 2017-07-09 // almost 7 years ago
  • CurrencyEditText 2.0 is here!

    ๐Ÿ”จ 2.0 contains some significant refactoring to the existing solution, including some breaking changes (hence the new major version). Some of the biggest changes include:

    • setLocale will no longer override a caller-specified hint if one was provided

    โœ‚ get/setCurrency removed - Exposing currency was exposing too much implementation detail for not enough gain. The currency class is only used by the formatter to obtain the decimal digit location. Therefore, this information is now exposed directly through a new API.

    ๐Ÿ†• new API int getDecimalDigits() and setDecimalDigits(int digits)` - Allows the user to specify how many decimal digits should be shown, overriding the users locale formatting. This is primarily useful for showing only whole-number values (e.g. $100 instead of $100.00). This value can also be set via an XML layout attribute.

    ๐Ÿ†• new API configureViewForLocale(Locale locale) - This is the new primary mechanism for overriding the users device locale should you need to do so. While you can still manually set the locale via setLocale(), this method will also handle decimal digit calculations, hint updates, refresh the view, etc.

    ๐Ÿ†• new API setValue(long value) - takes a long and handles formatting and populating the view, rather than callers having to call formatCurrency() and setText() themselves.

    โšก๏ธ max length restriction lifted - The old limit of 15 characters is gone thanks to updates in how the formatter is set up.

    ๐Ÿ‘ better test coverage - Additional tests to provide better code coverage, as well as new testing libraries to facilitate additional testing moving forward.

    โœ… test app greatly enhanced to showcase more features - Several new views have been added to the Test app to allow developers to get a better idea of how CurrencyEditText works and what's going on 'under the hood'.

    โž• Additionally, several open issues were closed out.

    My apologies for allowing this library to sit idle for so long. I'm going to make a conscious effort to give this tool more attention moving forward. Thanks to everyone that uses it and provides feedback.

    Enjoy!