@Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   switch (getMainAction()) {
     case EDIT:
       setTitle(R.string.menu_item_edit_Buchung);
       setSubTitle(Account.getAccountName(mUmsatz.getAccountID()));
       break;
     case ADD:
       setTitle(R.string.menu_item_add_Buchung);
       setSubTitle(Account.getAccountName(mUmsatz.getAccountID()));
       break;
     default:
       setTitle(Account.getAccountName(mUmsatz.getAccountID()));
   }
 }
Beispiel #2
0
 @Override
 public void onRecyclerItemClick(
     RecyclerView parent, View view, int position, long id, int viewHolderLayoutID) {
   Intent intent = new Intent();
   int accountID = (int) id;
   switch (viewHolderLayoutID) {
     case R.layout.finanzuebersicht_item:
       if (id == -1) {
         return;
       }
       Account acc = Account.getAccount(accountID);
       intent.putExtra(ACTION, (Parcelable) Action.ShowBuchungen);
       intent.putExtra(ACCOUNTID, accountID);
       switch (acc.getAccountTyp()) {
         case Port:
           intent.setClass(this, ActivityWertpapiere.class);
           break;
         default:
           intent.setClass(this, ActivityCash.class);
           break;
       }
       startActivity(intent);
       break;
     case R.layout.hbcipassport_item:
       intent.setClass(this, ActivityHBCIActions.class);
       intent.putExtra(ACTION, (Parcelable) Action.ShowPassportAccounts);
       intent.putExtra(ID, id);
       startActivity(intent);
       break;
     case R.layout.reportlist_item:
       intent.setClass(this, ActivityReports.class);
       intent.putExtra(REPORTID, id);
       startActivity(intent);
       break;
     case R.layout.depotuebersicht_item:
       intent.setClass(this, ActivityWertpapiere.class);
       intent.putExtra(ACCOUNTID, accountID);
       intent.putExtra(ACTION, (Parcelable) Action.ShowWPUebersicht);
       startActivity(intent);
       break;
   }
 }
Beispiel #3
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);
   }
 }