preyearegmi
6 years ago
15 changed files with 168 additions and 71 deletions
-
32app/src/main/AndroidManifest.xml
-
45app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/CurrencyFormatterTextWatcher.java
-
35app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java
-
1app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/presenter/KYCV2Presenter.java
-
2app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/presenter/KYCV2PresenterInterface.java
-
11app/src/main/java/com/gmeremit/online/gmeremittance_native/kycV2/view/KYCFormV2Activity.java
-
2app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientadd/RecipientAddV2Presenter.java
-
4app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV2/presenter/recipientlisting/RecipientListingV2Presenter.java
-
4app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/presenter/SendMoneyV2Presenter.java
-
24app/src/main/java/com/gmeremit/online/gmeremittance_native/sendmoneyV2/view/amountdetail/AmountDetailSendMoneyFragment.java
-
45app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Utils.java
-
17app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/other/PersistenceStorageManager.java
-
8app/src/main/res/layout/activity_exchange_method_v2.xml
-
1app/src/main/res/layout/dummykyc.xml
-
8app/src/main/res/layout/fragment_amount_detail_send_money_v2.xml
@ -0,0 +1,45 @@ |
|||||
|
package com.gmeremit.online.gmeremittance_native.customwidgets; |
||||
|
|
||||
|
import android.text.Editable; |
||||
|
import android.text.TextWatcher; |
||||
|
import android.widget.EditText; |
||||
|
|
||||
|
import com.gmeremit.online.gmeremittance_native.utils.Utils; |
||||
|
|
||||
|
import java.lang.ref.WeakReference; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.text.DecimalFormat; |
||||
|
import java.text.NumberFormat; |
||||
|
import java.util.Locale; |
||||
|
|
||||
|
public class CurrencyFormatterTextWatcher implements TextWatcher { |
||||
|
|
||||
|
private final EditText editTextWeakReference; |
||||
|
|
||||
|
public CurrencyFormatterTextWatcher(EditText editText) { |
||||
|
editTextWeakReference = editText; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) { |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterTextChanged(Editable editable) { |
||||
|
EditText editText = editTextWeakReference; |
||||
|
if (editText == null) return; |
||||
|
String s = editable.toString(); |
||||
|
if (s.isEmpty()) return; |
||||
|
editText.removeTextChangedListener(this); |
||||
|
String originalString = s.toString(); |
||||
|
//setting text after format to EditText |
||||
|
editText.setText(Utils.formatCurrency(originalString)); |
||||
|
editText.setSelection(editText.getText().length()); |
||||
|
|
||||
|
editText.addTextChangedListener(this); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue