use of net.iGap.adapter.payment.AdapterChargeAmount in project iGap-Android by KianIranian-STDG.
the class ChargeFragment method choosePriceButtonClicked.
private void choosePriceButtonClicked() {
if (currentOperator != null) {
MaterialDialog dialog = new MaterialDialog.Builder(requireContext()).customView(R.layout.popup_paymet_amount, false).build();
View amountDialogView = dialog.getCustomView();
if (amountDialogView != null) {
RecyclerViewAmount = amountDialogView.findViewById(R.id.rv_amount);
RecyclerViewAmount.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false));
RecyclerViewAmount.setAdapter(new AdapterChargeAmount(faceValueList, amountSelectedIndex != -1 ? amountSelectedIndex : amountDefaultIndex));
amountDialogView.findViewById(R.id.close_view3).setOnClickListener(v12 -> dialog.dismiss());
amountDialogView.findViewById(R.id.btn_dialog3).setOnClickListener(v1 -> {
AdapterChargeAmount adapterAmount = (AdapterChargeAmount) RecyclerViewAmount.getAdapter();
if (adapterAmount != null) {
if (adapterAmount.getSelectedPosition() == -1) {
return;
}
amountSelectedIndex = adapterAmount.getSelectedPosition();
currentAmount = faceValueList.get(amountSelectedIndex);
buttonAmount.setText(currentAmount.getTextAmount());
dialog.dismiss();
}
});
}
dialog.show();
} else {
showError(getContext().getResources().getString(R.string.please_select_operator));
}
}
Aggregations