Exemplo n.º 1
0
 public void setRecentTransferModels(
     List<TransferObjectCard> recentTransferModel,
     OnSlideItemClickListener mOnSlideItemClickListener) {
   mItemSlideTouchListener.setOnSlideItemClickListener(mOnSlideItemClickListener);
   this.recentTransferModel = recentTransferModel;
   recent_content.removeAllViews();
   {
     View rowItem = (View) mLayoutInflater.inflate(R.layout.bper_recent_slidelist_items, null);
     TextView textView1 = (TextView) rowItem.findViewById(R.id.textView1);
     textView1.setText(R.string.data);
     TextView textView2 = (TextView) rowItem.findViewById(R.id.textView2);
     textView2.setText(R.string.beneficiary_tilte);
     TextView textView4 = (TextView) rowItem.findViewById(R.id.textView4);
     textView4.setText(R.string.amount_h);
     ImageView imageView = (ImageView) rowItem.findViewById(R.id.imageView1);
     imageView.setVisibility(View.INVISIBLE);
     recent_content.addView(rowItem);
     ImageView divider = new ImageView(context);
     divider.setImageResource(R.drawable.upper_shading);
     recent_content.addView(divider);
   }
   if (recentTransferModel == null || recentTransferModel.size() <= 0) {
     return;
   }
   String currency = contentView.getContext().getResources().getString(R.string.eur);
   int size = recentTransferModel.size();
   for (int i = 0; i < size; i++) {
     TransferObjectCard accountsModel = recentTransferModel.get(i);
     View rowItem = (View) mLayoutInflater.inflate(R.layout.bper_recent_slidelist_items, null);
     TextView textView1 = (TextView) rowItem.findViewById(R.id.textView1);
     String operationDate = TimeUtil.getDateString(accountsModel.getDate(), TimeUtil.dateFormat5);
     textView1.setText(operationDate);
     TextView textView2 = (TextView) rowItem.findViewById(R.id.textView2);
     String beneficiary = accountsModel.getBeneficiaryName();
     if (beneficiary == null) {
       beneficiary = "";
     }
     textView2.setText(beneficiary);
     TextView textView4 = (TextView) rowItem.findViewById(R.id.textView4);
     textView4.setText(Utils.notPlusGenerateFormatMoney(currency, accountsModel.getAmount()));
     recent_content.addView(rowItem);
     if (i < size - 1) {
       recent_content.addView(mLayoutInflater.inflate(R.layout.separation_line_divider, null));
     }
     ViewHolder mViewHolder = new ViewHolder();
     mViewHolder.init(rowItem);
     mViewHolder.position = i;
     rowItem.setTag(mViewHolder);
     rowItem.setOnTouchListener(mItemSlideTouchListener);
   }
 }
 /**
  * @param mAccountsModel
  * @param mTransferObject
  */
 public void show(AccountsModel mAccountsModel, TransferObject mTransferObject, int newPayment) {
   content_tl.removeAllViews();
   if (mTransferObject == null) {
     return;
   }
   setAccountsModel(mAccountsModel);
   if (mTransferObject instanceof TransferObjectTransfer) {
     TransferObjectTransfer mRecentTransferModel = (TransferObjectTransfer) mTransferObject;
     showBankTranser(
         mAccountsModel,
         mRecentTransferModel.getBeneficiaryName(),
         mRecentTransferModel.getBeneficiaryIban(),
         mRecentTransferModel.getBeneficiaryBic(),
         mRecentTransferModel.getBeneficiaryCUP(),
         mRecentTransferModel.getBeneficiaryCIG(),
         mRecentTransferModel.getAmount(),
         mRecentTransferModel.getDescription(),
         mRecentTransferModel.getPurposeCurrency(),
         mRecentTransferModel.getDate(),
         newPayment);
   } else if (mTransferObject instanceof TransferObjectEntry) {
     TransferObjectEntry mRecentTransferModel = (TransferObjectEntry) mTransferObject;
     showTranserEntry(
         mAccountsModel,
         mRecentTransferModel.getBeneficiaryName(),
         mRecentTransferModel.getBeneficiaryIban(),
         mRecentTransferModel.getAmount(),
         mRecentTransferModel.getDescription(),
         mRecentTransferModel.getDate(),
         newPayment);
   } else if (mTransferObject instanceof TransferObjectSim) {
     TransferObjectSim mRecentTransferModel = (TransferObjectSim) mTransferObject;
     showPhoneTopUp(
         mAccountsModel,
         mRecentTransferModel.getBeneficiaryName(),
         mRecentTransferModel.getBeneficiaryNumber(),
         mRecentTransferModel.getBeneficiaryProviderName(),
         mRecentTransferModel.getAmount(),
         newPayment);
   } else if (mTransferObject instanceof TransferObjectCard) {
     TransferObjectCard mRecentTransferModel = (TransferObjectCard) mTransferObject;
     showCardTopUp(
         mAccountsModel,
         mRecentTransferModel.getBeneficiaryName(),
         mRecentTransferModel.getBeneficiaryCardNumber(),
         mRecentTransferModel.getAmount(),
         mRecentTransferModel.getDescription(),
         newPayment);
   }
 }