use of net.iGap.model.paymentPackage.FaceValue in project iGap-Android by KianIranian-STDG.
the class ChargeFragment method detectOperatorByNumber.
private void detectOperatorByNumber(String editText) {
if (editText.length() == 10 && editText.charAt(0) != '0')
editTextNumber.setText("0".concat(Objects.requireNonNull(editTextNumber.getText()).toString()));
if (editText.length() == 11 || iconRemove.getText().toString().equals(getResources().getString(R.string.icon_edit))) {
operators.clear();
for (ConfigData configData : config.getData()) {
operators.add(configData.getOperator());
if (iconRemove.getText().toString().equals(getResources().getString(R.string.icon_edit))) {
currentConfigData = null;
} else {
for (String preNumber : configData.getPreNumbers()) {
if (preNumber.equals(editText.substring(0, 4))) {
currentConfigData = configData;
break;
}
}
}
}
}
if (currentConfigData != null) {
faceValueList.clear();
for (FaceValue faceValue : currentConfigData.getFaceValues()) {
faceValueList.add(new Amount(faceValue.getKey()));
if (faceValue.getSelected())
amountDefaultIndex = faceValueList.size() - 1;
}
chargeTypesList.clear();
chargeTypesList.addAll(currentConfigData.getTopupChargeTypes());
if (currentConfigData != null)
changeOperator(currentConfigData.getOperator());
} else {
faceValueList.clear();
chargeTypesList.clear();
}
}
Aggregations