/**<pre/>
   * * Beneficiario(beneficiary value)
   * * Numero di telefono         (phone number)
   * * Operatore (provider)
   * * Taglio ricarica (recharge amount)
   *
   * @param mAccountsModel
   * @param beneficiary
   * @param phoneNumber
   * @param provider
   * @param amount
   */
  public void showPhoneTopUp(
      AccountsModel mAccountsModel,
      String beneficiary,
      String phoneNumber,
      String provider,
      double amount,
      int newPayment) {
    setPageTitle(TransferType.PHONE_TOP_UP.getPageTitleId(newPayment));
    setAccountsModel(mAccountsModel);
    content_tl.removeAllViews();
    setText(R.string.beneficiary_tilte, beneficiary);

    if (BaseActivity.isOffline) {
      setText(R.string.phone_number, phoneNumber);
    } else {
      String certifiedNumber = Contants.getUserInfo.getUserprofileHb().getContactPhone();
      if (certifiedNumber != null && phoneNumber.equals(certifiedNumber)) {
        setText(R.string.phone_number, Utils.maskCertifiedNumber(phoneNumber));
      } else {
        setText(R.string.phone_number, phoneNumber);
      }
    }

    setText(R.string.provider_fs, provider);
    setText(
        R.string.recharge_amount,
        Utils.notPlusGenerateFormatMoney(
            contentView.getContext().getResources().getString(R.string.eur), amount));
  }
示例#2
0
 private void initYValues(double max, double min) {
   yValues.clear();
   if (min >= 0) {
     double yCell = getYCell(max, NO_SIGN_SIZE);
     for (int i = 0; i <= NO_SIGN_SIZE; i++) {
       yValues.add(Utils.generateFormatMoney(dollar, i * yCell));
     }
     yCellLength = (int) ((float) (yAxisEndYPosition - yAxisStartYPosition) / NO_SIGN_SIZE);
     xAxisYPosition = yAxisEndYPosition;
     maximumWithdrawal = NO_SIGN_SIZE * yCell;
     minimumWithdrawal = 0;
   } else if (min < 0 && max > 0) {
     double mm = Math.max(Math.abs(min), Math.abs(max));
     double yCell = getYCell(mm, SIGN_SIZE / 2);
     for (int i = -SIGN_SIZE / 2; i <= SIGN_SIZE / 2; i++) {
       yValues.add(Utils.generateFormatMoney(dollar, i * yCell));
     }
     yCellLength = (int) ((float) (yAxisEndYPosition - yAxisStartYPosition) / SIGN_SIZE);
     xAxisYPosition = yAxisEndYPosition - yCellLength * (SIGN_SIZE / 2);
     maximumWithdrawal = SIGN_SIZE / 2 * yCell;
     minimumWithdrawal = -SIGN_SIZE / 2 * yCell;
   } else {
     double mm = Math.abs(min);
     double yCell = getYCell(mm, NO_SIGN_SIZE);
     for (int i = -NO_SIGN_SIZE; i <= 0; i++) {
       yValues.add(Utils.generateFormatMoney(dollar, i * yCell));
     }
     yCellLength = (int) ((float) (yAxisEndYPosition - yAxisStartYPosition) / NO_SIGN_SIZE);
     xAxisYPosition = yAxisStartYPosition;
     maximumWithdrawal = 0;
     minimumWithdrawal = -NO_SIGN_SIZE * yCell;
   }
 }
  @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    paint.setTypeface(Typeface.create("", Typeface.BOLD));

    paint.setTextSize((int) (textSize * BaseActivity.screen_width));
    paint.setAntiAlias(true);
    paint.setColor(Color.rgb(100, 100, 100));

    float x = Utils.measureX(paint, AVAILABLE_BALANCE_TITLE, maxwidth);
    canvas.drawText(AVAILABLE_BALANCE_TITLE, x, (float) (availableY * maxHeight), paint);

    x = Utils.measureX(paint, ACCOUNT_BALANCE_TITLE, maxwidth);
    canvas.drawText(ACCOUNT_BALANCE_TITLE, x, (float) ((accountY) * maxHeight), paint);
    x = Utils.measureX(paint, ACCOUNT_BALANCE_TITLE, maxwidth);
    canvas.drawText(ACCOUNT_BALANCE_TITLE, x, (float) ((accountY) * maxHeight), paint);

    paint.setColor(Color.BLACK);
    x = Utils.measureX(paint, getAvailableBalanceValue(), maxwidth);
    canvas.drawText(
        getAvailableBalanceValue(), x, (float) ((availableY + line) * maxHeight), paint);

    x = Utils.measureX(paint, getAccountBalanceValue(), maxwidth);
    canvas.drawText(getAccountBalanceValue(), x, (float) ((accountY + line) * maxHeight), paint);

    x = (float) (maxwidth / 2 - paint.measureText(DEPOSIT_TITLE) - placeholderLineDrawableWidth);
    canvas.drawText(DEPOSIT_TITLE, x, (float) ((depositY) * maxHeight), paint);

    x = (float) (maxwidth / 2 + placeholderLineDrawableWidth);
    canvas.drawText(WITHDRAWALS_TITLE, x, (float) ((depositY) * maxHeight), paint);

    x =
        (float)
            (maxwidth / 2 - paint.measureText(getDepositValue()) - placeholderLineDrawableWidth);
    canvas.drawText(getDepositValue(), x, (float) ((depositY + line) * maxHeight), paint);

    x = (float) (maxwidth / 2 + placeholderLineDrawableWidth);

    canvas.drawText(getWidthdrawalsValue(), x, (float) ((depositY + line) * maxHeight), paint);

    if (placeholderLineDrawable != null) {
      canvas.save();
      // canvas.scale((float)xx, (float)xx);
      canvas.translate((float) (o_x), (float) ((depositY) * maxHeight) - paint.getTextSize());
      placeholderLineDrawable.draw(canvas);
      canvas.restore();
    }
  }
示例#4
0
 private void generateBarList() {
   int x = yAxisXPosition + xCellLength;
   mPaint.setColor(Color.GRAY);
   barList.clear();
   int top;
   int bottom;
   for (int count = dataList.size(), i = count - 1; i >= 0; i--) {
     DashboardDataModel model = dataList.get(i);
     int y =
         (int)
             (model.getWithdrawals()
                 / (maximumWithdrawal - minimumWithdrawal)
                 * (yAxisEndYPosition - yAxisStartYPosition));
     if (y >= 0) {
       top = xAxisYPosition - y;
       bottom = xAxisYPosition;
     } else {
       top = xAxisYPosition;
       bottom = xAxisYPosition - y;
     }
     Bar bar = new Bar(x, top, bottom);
     bar.withdrawal = model.getWithdrawals();
     bar.xValue = convertDateFormat(model.getLastUpdate());
     bar.yValue = Utils.generateFormatMoney(dollar, model.getWithdrawals());
     barList.add(bar);
     x += xCellLength;
   }
 }
 /***<pre>
  * Beneficiario Beneficiary name
  *
  * Codice IBAN IBAN code
  *
  * Codice BIC BIC code (optional, show only if present)
  *
  * Codice CUP CUP (optional, show only if present)
  *
  * Codice CIG CIG (optional, show only if present)
  *
  * Importo amount
  *
  * Causale description
  *
  * Data date
  *
  * Causale valutaria Purpose currency (optional, show only if present)
  *
  *
  * @param mAccountsModel
  * @param beneficiary
  * @param iban
  * @param bic
  * @param cup
  * @param cig
  * @param amount
  * @param description
  * @param purposeCurrency
  * @param date
  */
 public void showBankTranser(
     AccountsModel mAccountsModel,
     String beneficiary,
     String iban,
     String bic,
     String cup,
     String cig,
     double amount,
     String description,
     String purposeCurrency,
     long date,
     int newPayment) {
   setPageTitle(TransferType.BANK_TRANSFER.getPageTitleId(newPayment));
   setAccountsModel(mAccountsModel);
   content_tl.removeAllViews();
   setText(R.string.beneficiary_tilte, beneficiary);
   setText(R.string.iban_tilte, iban);
   setText(R.string.bic_tilte, bic);
   setText(R.string.cup_tilte, cup);
   setText(R.string.cig_tilte, cig);
   setText(
       R.string.amount_tilte,
       Utils.notPlusGenerateFormatMoney(
           contentView.getContext().getResources().getString(R.string.eur), amount));
   setText(R.string.description_tilte, description);
   if (!TextUtils.isEmpty(purposeCurrency)) {
     setText(R.string.purpose_currency_tilte, purposeCurrency);
   }
   setText(R.string.date_tilte, TimeUtil.getDateString(date, TimeUtil.dateFormat5));
 }
 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() {

    if (getDepositInfo != null) {
      String present = Utils.generateMoney(getDepositInfo.getShares().getPercentage());
      String value = Utils.generateMoney(getDepositInfo.getShares().getValue());
      if (getDepositInfo.getShares().getValue() > 0) {}

      value =
          Utils.generateFormatMoney(
              getContext().getResources().getString(R.string.dollar),
              getDepositInfo.getShares().getValue());
      shares.setText(value + "(" + present + "%)");

      present = Utils.generateMoney(getDepositInfo.getBonds().getPercentage());
      value =
          Utils.generateFormatMoney(
              getContext().getResources().getString(R.string.dollar),
              getDepositInfo.getBonds().getValue());
      bonds.setText(value + "(" + present + "%)");

      present = Utils.generateMoney(getDepositInfo.getFunds().getPercentage());
      value =
          Utils.generateFormatMoney(
              getContext().getResources().getString(R.string.dollar),
              getDepositInfo.getFunds().getValue());
      funds.setText(value + "(" + present + "%)");

      present = Utils.generateMoney(getDepositInfo.getOtherSecurities().getPercentage());
      value =
          Utils.generateFormatMoney(
              getContext().getResources().getString(R.string.dollar),
              getDepositInfo.getOtherSecurities().getValue());
      more.setText(value + "(" + present + "%)");

      value =
          Utils.generateFormatMoney(
              getContext().getResources().getString(R.string.dollar),
              getDepositInfo.getPortfolioValue());
      port.setText(value);
    }
  }
示例#8
0
 @Override
 public void onClick(View v) {
   if (v == date) {
     if (editAble) {
       if (Utils.isFastDoubleClick()) {
         return;
       } else {
         DatePickerDialog.getInstance().showDateDialog(getContext(), this);
       }
     }
   }
 }
 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);
   }
 }
示例#10
0
  @Override
  protected void initPosition() {
    super.initPosition();
    screen_height = getMeasuredHeight();
    screen_width = getMeasuredWidth();
    int count = dataList.size();

    double sum = 0;
    double withdrawal = 0;
    double min = Integer.MAX_VALUE;
    double max = -Integer.MAX_VALUE;
    for (int i = 0; i < count; i++) {
      withdrawal = dataList.get(i).getWithdrawals();
      sum += withdrawal;
      if (withdrawal > max) {
        max = withdrawal;
      }
      if (withdrawal < min) {
        min = withdrawal;
      }
    }
    averageWithdrawal = (int) sum / count;

    averageText =
        "Average Expenditure on Card: " + Utils.generateFormatMoney(dollar, averageWithdrawal);

    xPaintScale = (int) (screen_height * x_paint_scale);
    yPaintScale = (int) (screen_height * y_paint_scale);

    detailText1Size = (int) (detail_text_1_size * screen_height);
    detailText2Size = (int) (detail_text_2_size * screen_height);
    titleSecondSize = (int) (title_second_size * screen_height);
    titleSecondY = titleLineY + (int) (titleSecondSize * 1.2F);

    yAxisStartYPosition = titleSecondY + padding;
    yAxisEndYPosition = screen_height - padding - 2 * yPaintScale;

    initYValues(max, min);

    yAxisXPosition = getMaxYValueLen() + padding;

    xAxisStartXPosition = yAxisXPosition;
    xAxisEndXPosition = screen_width - padding;

    xCellLength = (int) ((float) (xAxisEndXPosition - xAxisStartXPosition) / (count + 1));

    detailRoundR = (int) (detail_round_r * screen_height);

    generateBarList();
  }
 /**<pre/>
  * * Beneficiario(beneficiary value)
  * * Carta numero (card number)
  * * Importo (amount)
  * * Causale (description only if is present)
  *
  * @param mAccountsModel
  * @param beneficiary
  * @param cardNumber
  * @param amount
  * @param description
  * @param fees
  */
 public void showCardTopUp(
     AccountsModel mAccountsModel,
     String beneficiary,
     String cardNumber,
     double amount,
     String description,
     int newPayment) {
   setPageTitle(TransferType.CARD_TOP_UP.getPageTitleId(newPayment));
   setAccountsModel(mAccountsModel);
   content_tl.removeAllViews();
   setText(R.string.beneficiary_tilte, beneficiary);
   setText(R.string.fs_card_number, cardNumber);
   setText(
       R.string.amount_tilte,
       Utils.notPlusGenerateFormatMoney(
           contentView.getContext().getResources().getString(R.string.eur), amount));
   if (!TextUtils.isEmpty(description)) {
     setText(R.string.description_tilte, description);
   }
 }
 /**<pre/>
  * Beneficiario Beneficiary name
  *
  * Codice IBAN IBAN code
  *
  * Importo amount
  *
  * Causale description
  *
  * Data date
  *
  *
  * @param mAccountsModel
  * @param beneficiary
  * @param iban
  * @param amount
  * @param description
  * @param date
  */
 public void showTranserEntry(
     AccountsModel mAccountsModel,
     String beneficiary,
     String iban,
     double amount,
     String description,
     long date,
     int newPayment) {
   setPageTitle(TransferType.TRANSFER_ENTRY.getPageTitleId(newPayment));
   setAccountsModel(mAccountsModel);
   content_tl.removeAllViews();
   setText(R.string.beneficiary_tilte, beneficiary);
   setText(R.string.iban_tilte, iban);
   setText(
       R.string.amount_tilte,
       Utils.notPlusGenerateFormatMoney(
           contentView.getContext().getResources().getString(R.string.eur), amount));
   if (!TextUtils.isEmpty(description)) {
     setText(R.string.description_tilte, description);
   }
   setText(R.string.date_tilte, TimeUtil.getDateString(date, TimeUtil.dateFormat5));
 }