Пример #1
0
 @Override
 protected boolean onBindView(
     AWLibViewHolder holder, View view, int resID, Cursor cursor, int cursorPosition) {
   switch (resID) {
     case R.id.tcSummePayee:
       AWTextCurrency tc = (AWTextCurrency) view;
       tc.setValue(cursor.getLong(cursorPosition));
       return true;
     case R.id.tvPayeeName:
       String value = cursor.getString(cursorPosition);
       if (TextUtils.isEmpty(value)) {
         TextView tv = (TextView) view;
         tv.setText(R.string.NoPayee);
         return true;
       }
   }
   return super.onBindView(holder, view, resID, cursor, cursorPosition);
 }
Пример #2
0
 @Override
 protected boolean onBindView(
     AWLibViewHolder holder, View view, int resID, Cursor cursor, int cursorPosition) {
   switch (resID) {
     case R.id.tvEinstandsPreis:
       mEinstand = cursor.getLong(cursorPosition);
       AWTextCurrency tc = (AWTextCurrency) view;
       tc.setValue(mEinstand);
       return true;
     case R.id.tvGewinnVerlust:
       mGewinn = cursor.getLong(cursorPosition);
       tc = (AWTextCurrency) view;
       tc.setValue(mGewinn);
       return true;
     case R.id.tvUebersichtSaldo:
     case R.id.tvGewinnSteuerfrei:
       tc = (AWTextCurrency) view;
       tc.setValue(cursor.getLong(cursorPosition));
       return true;
     case R.id.tvGewinnVerlustProzent:
       TextView tv = (TextView) view;
       if (mEinstand != 0) {
         long mGewinnPercent = mGewinn * 10000 / mEinstand;
         tv.setText(DBConvert.convertPercent(mGewinnPercent));
       }
       return true;
     case R.id.tvUebersichtName:
       int mAccountID;
       tv = (TextView) view;
       mAccountID = cursor.getInt(columnAccountID);
       if (mAccountID == NOID) {
         tv.setText(getString(R.string.tvMarktwert));
       } else {
         tv.setText(Account.getAccountName(mAccountID));
       }
       return true;
     default:
       return super.onBindView(holder, view, resID, cursor, cursorPosition);
   }
 }