@Override public void onPayeeSelected(int index) { // getRecipientListModel if (currentTypeCode.equals(ServiceCode.BANK_TRANSFER_PAYMENT)) { List<Account> list1 = getRecipientListModel.getBankRecipientList(); BankRecipient resultBankRecipient = (BankRecipient) list1.get(index); // 这里通过resultBankRecipient更新ui beneficiary = resultBankRecipient.getName(); iban = resultBankRecipient.getIbanCode(); bic = resultBankRecipient.getBic(); bankTransferNameEditText.setText(resultBankRecipient.getName()); ibanEdtiText.setText(resultBankRecipient.getIbanCode()); payee.setText(resultBankRecipient.getName() + "-" + resultBankRecipient.getIbanCode()); } else if (currentTypeCode.equals(ServiceCode.SIM_TOP_UP)) { List<PhoneRecipient> list1 = getRecipientListModel.getPhoneRecipientList(); PhoneRecipient resultBankRecipient = list1.get(index); // 这里通过resultBankRecipient更新ui beneficiary = resultBankRecipient.getPhoneNumber(); simTopUpNameEdit.setText(resultBankRecipient.getName()); phoneNumberEdit.setText(resultBankRecipient.getPhoneNumber()); String destProvider = DestProvider.getDsstProvider(resultBankRecipient.getProvider()); operatorText.setText(destProvider); payee.setText(resultBankRecipient.getName() + ":" + resultBankRecipient.getPhoneNumber()); } else if (currentTypeCode.equals(ServiceCode.CARD_RECHARGE_PAYMENT)) { List<CardRecipient> list1 = getRecipientListModel.getCardRecipientList(); CardRecipient resultBankRecipient = list1.get(index); // 这里通过resultBankRecipient更新ui beneficiary = resultBankRecipient.getName(); beneficiaryNameEditText.setText(resultBankRecipient.getName()); cardNumberEditText.setText(resultBankRecipient.getCardNumber()); payee.setText(resultBankRecipient.getName() + "-" + resultBankRecipient.getCardNumber()); } }
void createPayeeListButton(String key) { if (key.length() <= 0) { payees_layout.removeAllViews(); return; } payees_layout.removeAllViews(); if (currentTypeCode.equals(ServiceCode.BANK_TRANSFER_PAYMENT)) { List<Account> list1 = getRecipientListModel.getBankRecipientList(); for (Account str : list1) { String name = ((BankRecipient) str).getName(); generateButton((BankRecipient) str, name, key); } } else if (currentTypeCode.equals(ServiceCode.SIM_TOP_UP)) { List<PhoneRecipient> list1 = getRecipientListModel.getPhoneRecipientList(); for (PhoneRecipient str : list1) { String name = str.getName(); generateButton(str, name, key); } } else if (currentTypeCode.equals(ServiceCode.CARD_RECHARGE_PAYMENT)) { List<CardRecipient> list1 = getRecipientListModel.getCardRecipientList(); for (CardRecipient str : list1) { String name = str.getName(); generateButton(str, name, key); } } }
@Override public void onClick(View v) { if (v == operatorText) { lists.clear(); lists.add(AvailableOperator.TIM_NAME); lists.add(AvailableOperator.VODAFONE_NAME); lists.add(AvailableOperator.TISCALI_NAME); lists.add(AvailableOperator.WIND_NAME); lists.add(AvailableOperator.TRE_NAME); alertDialog = DialogManager.createOperatorDialog(this, lists); alertDialog.show(); } else if (v == myCardBtn) { // DialogManager.createMessageDialog("transfer success!", // getContext()).show(); if (prepareCard()) { DialogManager.createMyCardDialog(this, myCardAccounts).show(); } else { BaseActivity baseActivity = (BaseActivity) getContext(); baseActivity.displayErrorMessage("No available card"); } } else if (v == vertifyBtn) { ProgressOverlay progressOverlay = new ProgressOverlay(getContext()); progressOverlay.show( "verify...", new OnProgressEvent() { @Override public void onProgress() { PaymentConfirmLayout paymentConfirmLayout = (PaymentConfirmLayout) expandBarResultListener.getOwener(); AccountsModel accountsModel = paymentConfirmLayout.generateAccountModel(); String postData = GetCardsJson.GetCardsReportProtocal( Contants.publicModel, beneficiaryNameEditText.getText().toString(), cardNumberEditText.getText().toString(), accountsModel.getAccountCode()); HttpConnector httpConnector = new HttpConnector(); String httpResult = httpConnector.requestByHttpPost(Contants.mobile_url, postData, getContext()); GetCardsResponseModel getCards = GetCardsJson.parseGetCardResponse(httpResult); List<InfoCardsModel> list = getCards.getInfoCardListModel(); BaseActivity baseActivity = (BaseActivity) getContext(); if (list != null && list.size() > 0) { setCardHash(list.get(0).getCardHash()); isVerifyCard = true; title = list.get(0).getTitle(); name = list.get(0).getName(); baseActivity.displayErrorMessage("verify success!"); } else { baseActivity.displayErrorMessage("verify fail!"); } } }); } else if (v == payee) { // 这里写 showDialog DialogManager.createPayeeDialog(this, getRecipientListModel, currentTypeCode).show(); } else if (v.getParent() == payees_layout) { Object o = v.getTag(); if (o instanceof CardRecipient) { CardRecipient resultBankRecipient = (CardRecipient) o; beneficiary = resultBankRecipient.getName(); beneficiaryNameEditText.setText(resultBankRecipient.getName()); cardNumberEditText.setText(resultBankRecipient.getCardNumber()); } else if (o instanceof PhoneRecipient) { PhoneRecipient resultBankRecipient = (PhoneRecipient) o; beneficiary = resultBankRecipient.getPhoneNumber(); simTopUpNameEdit.setText(resultBankRecipient.getName()); phoneNumberEdit.setText(resultBankRecipient.getPhoneNumber()); String destProvider = DestProvider.getDsstProvider(resultBankRecipient.getProvider()); operatorText.setText(destProvider); } else if (o instanceof BankRecipient) { BankRecipient resultBankRecipient = (BankRecipient) o; beneficiary = resultBankRecipient.getName(); iban = resultBankRecipient.getIbanCode(); bic = resultBankRecipient.getBic(); bankTransferNameEditText.setText(resultBankRecipient.getName()); ibanEdtiText.setText(resultBankRecipient.getIbanCode()); } payees_layout.removeAllViews(); } }