Clover Coverage Report - SaveApp Coverage Report
Coverage timestamp: mar dic 23 2014 15:53:11 EST
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
51   110   10   7,29
6   95   0,2   7
7     1,43  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  AccountDetailActivity       Line # 15 51 10 98,4% 0.984375
 
No Tests
 
1    package com.loopback.androidapps.saveapp;
2   
3    import android.app.Activity;
4    import android.app.AlertDialog;
5    import android.content.DialogInterface;
6    import android.content.Intent;
7    import android.os.Bundle;
8    import android.util.Log;
9    import android.view.View;
10    import android.widget.Button;
11    import android.widget.ImageButton;
12    import android.widget.TextView;
13    import android.widget.Toast;
14   
 
15    public class AccountDetailActivity extends Activity implements
16    View.OnClickListener {
17   
18    private TextView txtNameValue, txtPeriodValue, txtBudgetValue,
19    txtStartDateValue, txtEndDateValue, txtCurrencyValue,txtAccountSelection;
20    private Button btnEditAccount, btnNewAccount;
21    private ImageButton btnAccountSelection;
22    public boolean isEuropeanCalendar = true;
23    public Account account;
24    public Currency currency;
25   
26    private SaveApp saveApp;
27   
 
28  3 toggle public void onCreate(Bundle savedInstanceState) {
29  3 Log.i("AD", "Init");
30  3 super.onCreate(savedInstanceState);
31  3 setContentView(R.layout.accountdetail);
32   
33  3 loadActivity();
34    }
35   
 
36  3 toggle public void loadActivity() {
37  3 Log.i("AD", "Loading...");
38  3 saveApp = ((SaveApp)getApplicationContext());
39   
40  3 txtNameValue = (TextView) findViewById(R.id.txtNameValue);
41  3 txtBudgetValue = (TextView) findViewById(R.id.txtBudgetValue);
42  3 txtPeriodValue = (TextView) findViewById(R.id.txtPeriodValue);
43  3 txtStartDateValue = (TextView) findViewById(R.id.txtStartDateValue);
44  3 txtEndDateValue = (TextView) findViewById(R.id.txtEndDateValue);
45  3 txtCurrencyValue = (TextView) findViewById(R.id.txtCurrencyValue);
46  3 txtAccountSelection= (TextView) findViewById(R.id.txtAccountSelection);
47  3 btnNewAccount = (Button) findViewById(R.id.btnNewAccount);
48  3 btnAccountSelection = (ImageButton) findViewById(R.id.btnAccountSelection);
49  3 btnEditAccount = (Button) findViewById(R.id.btnEditAccount);
50   
51  3 btnNewAccount.setOnClickListener(this);
52  3 btnAccountSelection.setOnClickListener(this);
53  3 btnEditAccount.setOnClickListener(this);
54    }
55   
 
56  3 toggle public void onResume(){
57  3 super.onResume();
58  3 loadAccount();
59    }
 
60  3 toggle public void loadAccount(){
61  3 Log.i("AD", "Loading Account...");
62  3 account = new Account(saveApp.getAccountId());
63  3 txtAccountSelection.setText(getString(R.string.strAccount)
64    + ": " + saveApp.getAccountDesc());
65  3 txtNameValue.setText(saveApp.getAccountDesc());
66  3 txtBudgetValue.setText(String.valueOf(account.getBudget()));
67  3 txtPeriodValue.setText(account.getPeriod());
68  3 txtStartDateValue.setText(account.getStartDate());
69  3 txtEndDateValue.setText(account.getEndDate());
70   
71  3 currency= new Currency(saveApp.getCurrencyId());
72  3 txtCurrencyValue.setText(currency.getDescription() + ": "+ saveApp.getCurrencySymbol());
73   
74  3 Log.i("AD", "Loaded");
75    }
 
76  1 toggle public void onBackPressed() {
77  1 Intent intent = new Intent(this.getApplicationContext(),
78    HomeActivity.class);
79  1 startActivity(intent);
80    }
 
81  7 toggle public void onClick(View v) {
82  7 if (v == btnEditAccount) {
83  2 Log.i("AD", "Edit Account");
84  2 Intent intent = new Intent(this.getApplicationContext(),
85    AccountEditActivity.class);
86  2 startActivity(intent);
87  5 } else if (v == btnAccountSelection) {
88  1 final CharSequence[] accounts;
89  1 Account account = new Account();
90  1 accounts = account.selectAccounts();
91  1 AlertDialog.Builder builder = new AlertDialog.Builder(this);
92  1 builder.setTitle("Chooese Account");
93  1 builder.setItems(accounts, new DialogInterface.OnClickListener() {
 
94  1 toggle public void onClick(DialogInterface dialog, int _item) {
95  1 saveApp.setAccountId(_item + 1);
96    }
97    });
98  1 AlertDialog dropdown = builder.create();
99  1 dropdown.show();
100  1 Toast.makeText(this, "More than one account is not allowed in this version",
101    Toast.LENGTH_LONG).show();
102  4 } else if (v == btnNewAccount) {
103  4 Toast.makeText(this, "More than one account is not allowed in this version",
104    Toast.LENGTH_LONG).show();
105    }
106   
107    }
108   
109    }
110