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

Can't not input "." and "," japanese #14

Closed thangluutitan closed 7 years ago

thangluutitan commented 8 years ago

"," can auto, but must allow input "."

nazarcybulskij commented 8 years ago

Locale locale = new Locale("us", "JP"); mCurrencyEditText.setLocale(locale);

This should help , but I not sure. Try instead "us" to choose another language. Сlass Locale is final to not be able to extends your

sorry for my english

Praween commented 8 years ago

Trying to reset the value on certain condition, but unfortunately its not working . CurrencyEditText mText; mText.setText("")

Please let me know, how to set this value.

BlacKCaT27 commented 8 years ago

You should be able to just pass in whatever value you want to setText (cast as a string) and the formatter will take care of it. So for example:

int amount = 1000;
CurrencyEditText cet = (CurrencyEditText) findViewById(R.id.myCET);
cet.setText(amount.toString());

Make sure you're obtaining a reference to the actual view. If the example you posted is out how you're trying to do it, you're going to get a null pointer exception every time as mText hasn't been initialized.

Praween commented 8 years ago

I have switch mode for two different tab. Whenever I switch mode, I use to clear the text as, private CurrencyTextEdit mAddValue; mAddValue = = (CurrencyTextEdit)findViewById(R.id.add_value); ...... switchMode(int mode) { mAddValue.requestFocus(); mAddValue.setText(""); ........ }

I am not able to get any success with any EditText call to clear the text such as , mAddValue.getText().clear() OR mAddValue.setText(""). I tried with to put this work under runnable to execute in separate thread as well, but no success.

BlacKCaT27 commented 7 years ago

Closing this as the outstanding issue of setting an empty value to reset the view is a duplicate of issue #24