public void onDisable(int accountPos) {
   if (beneficiary_rg.getVisibility() != View.VISIBLE) {
     return;
   }
   AccountsModel mAccountsModel = getAccountsModel();
   String accountCode = null;
   if (mAccountsModel != null) {
     accountCode = mAccountsModel.getAccountCode();
   }
   accountPos = -1;
   if (accountCode != null && iBanCardaccounts != null) {
     int size = iBanCardaccounts.size();
     for (int i = 0; i < size; i++) {
       if (accountCode.equals(iBanCardaccounts.get(i).getAccountCode())) {
         accountPos = i;
         break;
       }
     }
   }
   if (disAblePosition == accountPos) {
     return;
   }
   if (disAblePosition >= 0) {
     Holder mHolder = (Holder) beneficiary_rg.getChildAt(disAblePosition).getTag();
     mHolder.onEnable(true);
   }
   disAblePosition = accountPos;
   if (disAblePosition >= 0) {
     Holder mHolder = (Holder) beneficiary_rg.getChildAt(disAblePosition).getTag();
     mHolder.onEnable(false);
   }
 }
 @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();
 }
Example #3
0
  public CardsBarGraphic(Context context, DashBoardModel model) {
    super(context);
    this.dataList = model.getDashboardDataList();
    setTextLeft("WITHDRAWALS");

    String num = "";
    for (AccountsModel accountsModel : Contants.cardAccounts) {

      if (model.getAccountCode().equals(accountsModel.getAccountCode())) {
        num = accountsModel.getCardNumber();
      }
    }
    setTextRight("Card XXXX XXXX XXXX " + num);
  }
 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);
   }
 }
      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);
        }
      }
 public void setAccounts(List<AccountsModel> accounts) {
   iBanCardaccounts = accounts;
   user_my_card_sbtn.setEnabled(accounts != null && accounts.size() > 0);
   selectedPosition = -1;
   disAblePosition = -1;
   AccountsModel payer = getAccountsModel();
   if (accounts != null) {
     int length = accounts.size();
     for (int i = 0; i < length; i++) {
       Holder mHolder;
       if (i + 1 < beneficiary_rg.getChildCount() - 1) {
         mHolder = (Holder) beneficiary_rg.getChildAt(i + 1).getTag();
       } else {
         View itemView =
             mLayoutInflater.inflate(R.layout.bper_payment_entry_beneficiary_item, null);
         itemView.setOnClickListener(mItemOnClickListener);
         beneficiary_rg.addView(itemView);
         mHolder = new Holder(itemView);
       }
       AccountsModel mAccountsModel = accounts.get(i);
       if (payer != null && payer.getAccountCode().equals(mAccountsModel.getAccountCode())) {
         disAblePosition = i;
       }
       mHolder.setData(i, mAccountsModel);
       if (i == length - 1) {
         mHolder.divider.setVisibility(View.GONE);
       } else {
         mHolder.divider.setVisibility(View.VISIBLE);
       }
     }
     for (int i = beneficiary_rg.getChildCount() - 1; i > length; i--) {
       beneficiary_rg.getChildAt(i).setVisibility(View.GONE);
     }
   }
   mPaymentStepViewUtils.view.setFocusable(true);
   mPaymentStepViewUtils.view.requestFocusFromTouch();
 }
  private boolean prepareCard() {
    boolean result = false;
    List<AccountsModel> accounts = Contants.getUserInfo.getAccountList();

    if (myCardAccounts == null) {
      myCardAccounts = new ArrayList<AccountsModel>();
    }
    myCardAccounts.clear();
    for (AccountsModel accountsModel : accounts) {
      String serviceCode = accountsModel.getBankServiceType().getBankServiceCode();
      if (serviceCode == null || serviceCode.equals("")) {

        continue;
      } else {
        if (serviceCode.equals("867") || serviceCode.equals("887")) {
          // baseActivity.displayErrorMessage("find 867 or 887");

          myCardAccounts.add(accountsModel);
          result = true;
        }
      }
    }
    return result;
  }
  public void onMyCardSelected(AccountsModel accountsModel) {

    beneficiaryNameEditText.setText(accountsModel.getCardHolder());
    cardNumberEditText.setText(accountsModel.getCardNumber());
    isVerifyCard = false;
  }
  /**
   * 此方法别删除,现在搞不大清楚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("");
    }
  }