@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()); } }
@Override protected void onRecover(Object object) { resetResult(); if (object != null) { BeneficiaryValue beneficiary = (BeneficiaryValue) object; if (currentTypeCode.equals(ServiceCode.BANK_TRANSFER_PAYMENT) || beneficiary.serviceType.equals(Contants.BANK_TRANSFER)) { bankTransferNameEditText.setText(beneficiary.beneficiaryName); expandFocusResultChange(bankTransferNameEditText.getText().toString()); ibanEdtiText.setText(beneficiary.beneficiaryIban); iban = beneficiary.beneficiaryIban; } else if (currentTypeCode.equals(ServiceCode.TRANSFER_ENTRY_PAYMENT) || beneficiary.serviceType.equals(Contants.TRANSFER_ENTRY)) { for (int i = 0; i < tranGroup.getChildCount(); i++) { RadioButton radioButton = (RadioButton) tranGroup.getChildAt(i); if (radioButton.getText().equals(beneficiary.beneficiaryName)) { radioButton.setChecked(true); } if (radioButton.getText().equals(selectedAccountsModel.getAccountAlias())) { radioButton.setEnabled(false); } } } else if (currentTypeCode.equals(ServiceCode.SIM_TOP_UP) || beneficiary.serviceType.equals(Contants.SIM_TOP_UP)) { simTopUpNameEdit.setText(beneficiary.beneficiaryName); phoneNumberEdit.setText(beneficiary.beneficiaryPhoneNumber); String destProvider = DestProvider.getDsstProvider(beneficiary.operator); operatorText.setText(destProvider); if (!simTopUpNameEdit.getText().toString().equals("")) { expandFocusResultChange(simTopUpNameEdit.getText().toString()); } else { expandFocusResultChange(phoneNumberEdit.getText().toString()); } } else if (currentTypeCode.equals(ServiceCode.CARD_RECHARGE_PAYMENT) || beneficiary.serviceType.equals(Contants.PREPAID_CARD_RELOAD)) { beneficiaryNameEditText.setText(beneficiary.beneficiaryName); String cardNum = beneficiary.beneficiaryCardNumber.substring( beneficiary.beneficiaryCardNumber.length() - 4, beneficiary.beneficiaryCardNumber.length()); cardNumberEditText.setText(cardNum); expandFocusResultChange(beneficiaryNameEditText.getText().toString()); } } else { // 如果是显示的,就屏蔽一下 for (int i = 0; i < tranGroup.getChildCount(); i++) { RadioButton radioButton = (RadioButton) tranGroup.getChildAt(i); if (radioButton.getText().equals(selectedAccountsModel.getAccountAlias())) { radioButton.setEnabled(false); } } } payees_layout.removeAllViews(); }
@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(); } }