BlacKCaT27 / CurrencyEditText

A module designed to encapsulate the use of an Android EditText field for gathering currency information from a user. Supports all ISO-3166 compliant locales/currencies.
Apache License 2.0
339 stars 79 forks source link

CurrencyTextView #26

Closed aandis closed 7 years ago

aandis commented 7 years ago

Is there a TextView exposed by this lib which handles all currency related functionalities just like the EditText does? I am looking to display currency stored in long in a TextView.

BlacKCaT27 commented 7 years ago

Hello!

No, not directly. But what you can do is use the CurrencyTextFormatter.FormatText() method to format the value you want, then put it into a TextView yourself.

On Sun, Mar 12, 2017 at 6:48 AM, Abhishek notifications@github.com wrote:

Is there a TextView exposed by this lib which handles all currency related functionalities just like the EditText does? I am looking to display currency stored in long in a TextView.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BlacKCaT27/CurrencyEditText/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_54SRLm_5VLO5HoV2W3iA2dH57qr74ks5rk81ngaJpZM4MagQR .

aandis commented 7 years ago

Thanks, got it working. Would you be open to accepting a pr for this if I made one? I think it could be a useful feature in this lib.

BlacKCaT27 commented 7 years ago

I'll certainly consider it. I agree it's handy, but it's also pretty straightforward to do on your own since we expose the formatter, and I'm not sure about adding additional code to maintain for something that isn't core to the original intent of the library. Not just the code of populating a TextView, but also ensuring the formatter plays nice with various fonts, scales, etc.

But I'll certainly mull it over. If you do submit a PR, please include unit tests covering any new code, and perhaps add one of the new TextViews to the test app so there's an example handy. I'll handle updating the readme if I end up accepting it.

Glad the library was able to help you out, regardless!

BlacKCaT27 commented 7 years ago

After further consideration, I don't think this is necessarily an appropriate addition to this library specifically. If you wish to make a second library which depends on this one for formatting, by all means.