public void setData(int position, AccountsModel mAccountsModel) { this.position = position; this.mAccountsModel = mAccountsModel; if (mAccountsModel.getAccountAlias() != null) { name_tv.setText(mAccountsModel.getAccountAlias()); } else { name_tv.setText(""); } if (mAccountsModel.getCardHolder() != null) { iban.setText(mAccountsModel.getCardHolder()); } else { iban.setText(""); } String cardNumber = mAccountsModel.getCardNumber(); if (cardNumber == null) { cardNumber = ""; } avilable_banlence_tv.setText(cardNumber); if (mAccountsModel.getIsPreferred()) { isPreferredStar.setVisibility(View.VISIBLE); } else { isPreferredStar.setVisibility(View.GONE); } if (disAblePosition == position) { onEnable(false); } else { rbtn.setChecked(selectedPosition == position); name_tv.setTextColor(name_tv.getResources().getColor(R.color.black)); itemView.setEnabled(true); rbtn.setEnabled(true); } }
@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(); }
public void setAccountsModel(AccountsModel mAccountsModel) { mAccountInfoTitle.accountName.setText(mAccountsModel.getAccountAlias()); String money = Utils.generateFormatMoney( contentView.getContext().getResources().getString(R.string.eur), mAccountsModel.getAccountBalance()); mAccountInfoTitle.account_balance_value.setText(money); money = Utils.generateFormatMoney( contentView.getContext().getResources().getString(R.string.eur), mAccountsModel.getAvailableBalance()); mAccountInfoTitle.available_balance_value.setText(money); if (mAccountsModel.getIsPreferred()) { mAccountInfoTitle.setPerferredStar(AccountInfoTitle.PAYMENT); } else { mAccountInfoTitle.isPerferredStar.setVisibility(View.GONE); } }
/** * 此方法别删除,现在搞不大清楚transfer entry里的account是从哪来的 * * @param accountsForServiceModels * @param selectedAccountsModel */ public void createAccountsUI( final List<AccountsForServiceModel> accountsForServiceModels, final AccountsModel selectedAccountsModel) { this.selectedAccountsModel = selectedAccountsModel; boolean accountbyservicemode = false; if (BaseActivity.isOffline) { return; } if (this.accountsForServiceModels == accountsForServiceModels) { } else { this.accountsForServiceModels = accountsForServiceModels; } for (int index = 0; index < tranGroup.getChildCount(); index++) { RadioButton child = (RadioButton) tranGroup.getChildAt(index); child.setOnCheckedChangeListener(null); } tranGroup.removeAllViews(); if (accountbyservicemode) { for (int i = 0; i < accountsForServiceModels.size(); i++) { AccountsForServiceModel accountsForServiceModel = accountsForServiceModels.get(i); LogManager.d(accountsForServiceModel.getServiceCode()); for (AccountsModel accountsModel : accountsForServiceModel.getAccounts()) { // LogManager.d(accountsModel.getAccountAlias()); LayoutInflater layoutInflater = LayoutInflater.from(getContext()); RadioButton radioButton = (RadioButton) layoutInflater.inflate(R.layout.bank_radio_button_item, null); radioButton.setText(accountsModel.getAccountAlias()); if (accountsModel == selectedAccountsModel) { radioButton.setEnabled(false); } radioButton.setTag(accountsModel); radioButton.setOnCheckedChangeListener(PayeeExpandedLayout.this); tranGroup.addView(radioButton); } } } else { LogManager.d("owner is get"); PaymentConfirmLayout paymentConfirmLayout = (PaymentConfirmLayout) expandBarResultListener.getOwener(); List<Account> bankRecipients = paymentConfirmLayout.getRecipientListModel.getBankRecipientList(); if (bankRecipients != null) { for (AccountsForServiceModel bankRecipient : accountsForServiceModels) { List<AccountsModel> accounts = bankRecipient.getAccounts(); for (AccountsModel account : accounts) { LayoutInflater layoutInflater = LayoutInflater.from(getContext()); RadioButton radioButton = (RadioButton) layoutInflater.inflate(R.layout.bank_radio_button_item, null); radioButton.setText(account.getAccountAlias()); if (selectedAccountsModel.getAccountAlias() == account.getAccountAlias()) { radioButton.setEnabled(false); } radioButton.setTag(account); radioButton.setOnCheckedChangeListener(PayeeExpandedLayout.this); tranGroup.addView(radioButton); } } } } if (currentTypeCode.equals(ServiceCode.TRANSFER_ENTRY_PAYMENT)) { expandFocusResultChange(""); } }