EMMA Coverage Report (generated Thu Mar 30 10:34:17 CEST 2017)
[all classes][net.mandaria.tippytipper.activities]

COVERAGE SUMMARY FOR SOURCE FILE [SplitBill.java]

nameclass, %method, %block, %line, %
SplitBill.java100% (3/3)88%  (14/16)91%  (286/313)89%  (73/82)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SplitBill100% (1/1)83%  (10/12)91%  (262/289)88%  (65/74)
onCreateOptionsMenu (Menu): boolean 0%   (0/1)0%   (0/8)0%   (0/3)
onOptionsItemSelected (MenuItem): boolean 0%   (0/1)0%   (0/16)0%   (0/5)
bindData (): void 100% (1/1)98%  (147/150)97%  (32/33)
SplitBill (): void 100% (1/1)100% (3/3)100% (1/1)
access$000 (SplitBill): void 100% (1/1)100% (3/3)100% (1/1)
access$100 (SplitBill): void 100% (1/1)100% (3/3)100% (1/1)
addPerson (): void 100% (1/1)100% (14/14)100% (4/4)
onCreate (Bundle): void 100% (1/1)100% (36/36)100% (9/9)
onStart (): void 100% (1/1)100% (23/23)100% (7/7)
onStop (): void 100% (1/1)100% (5/5)100% (3/3)
removePerson (): void 100% (1/1)100% (17/17)100% (5/5)
splitBill (int): void 100% (1/1)100% (11/11)100% (4/4)
     
class SplitBill$1100% (1/1)100% (2/2)100% (12/12)100% (4/4)
SplitBill$1 (SplitBill): void 100% (1/1)100% (6/6)100% (1/1)
onClick (View): void 100% (1/1)100% (6/6)100% (3/3)
     
class SplitBill$2100% (1/1)100% (2/2)100% (12/12)100% (4/4)
SplitBill$2 (SplitBill): void 100% (1/1)100% (6/6)100% (1/1)
onClick (View): void 100% (1/1)100% (6/6)100% (3/3)

1package net.mandaria.tippytipper.activities;
2 
3import java.util.HashMap;
4import java.util.Map;
5 
6import com.flurry.android.FlurryAgent;
7 
8import net.mandaria.tippytipper.R;
9import net.mandaria.tippytipper.TippyTipperApplication;
10import android.app.Activity;
11import android.content.Intent;
12import android.net.ParseException;
13import android.os.Bundle;
14 
15 
16import android.view.*;
17import android.view.View.OnClickListener;
18import android.view.View.OnKeyListener;
19import android.widget.*;
20 
21public class SplitBill extends Activity {
22 
23 
24        /** Called when the activity is first created. */
25        @Override
26        public void onCreate(Bundle savedInstanceState) {
27                super.onCreate(savedInstanceState);
28                setContentView(R.layout.splitbill);  
29 
30                TippyTipperApplication appState = ((TippyTipperApplication)this.getApplication());
31 
32                splitBill(appState.service.getNumberOfPeople());
33 
34                View btn_add_person = findViewById(R.id.btn_add_person);
35                btn_add_person.setOnClickListener(new OnClickListener() 
36                {
37                        public void onClick(View v) 
38                        {
39                                addPerson();
40                                FlurryAgent.onEvent("Add Person Button");
41                        }
42                });
43 
44                View btn_remove_person = findViewById(R.id.btn_remove_person);
45                btn_remove_person.setOnClickListener(new OnClickListener() 
46                {
47                        public void onClick(View v) 
48                        {
49                                removePerson();
50                                FlurryAgent.onEvent("Remove Person Button");
51                        }
52                });
53 
54        }
55 
56        @Override
57        public void onStart()
58        {
59                super.onStart();
60                boolean enableErrorLogging = Settings.getEnableErrorLogging(getBaseContext());
61                String API = getString(R.string.flurrykey);
62                if(!API.equals("") && enableErrorLogging == true)
63                {
64                        FlurryAgent.setContinueSessionMillis(30000);
65                        FlurryAgent.onStartSession(this, API);
66                }
67        }
68 
69        @Override
70        public void onStop()
71        {
72                super.onStop();
73                FlurryAgent.onEndSession(this);
74        }
75 
76        @Override
77        public boolean onCreateOptionsMenu(Menu menu)
78        {
79                super.onCreateOptionsMenu(menu);
80 
81                //MenuInflater inflater = getMenuInflater();
82                //inflater.inflate(R.menu.menu, menu);
83                FlurryAgent.onEvent("Disabled Menu Button");
84                return true;
85        }
86 
87        @Override
88        public boolean onOptionsItemSelected(MenuItem item)
89        {
90                switch(item.getItemId())
91                {
92                case R.id.settings:
93                        startActivity(new Intent(this, Settings.class));
94                        FlurryAgent.onEvent("Settings Button");
95                        return true;
96                }
97                return false;
98        }
99 
100        private void addPerson()
101        {
102                TippyTipperApplication appState = ((TippyTipperApplication)this.getApplication());
103                int people = appState.service.getNumberOfPeople() + 1;
104 
105                splitBill(people);         
106 
107 
108        }
109 
110        private void removePerson()
111        {
112                TippyTipperApplication appState = ((TippyTipperApplication)this.getApplication());
113                int people = appState.service.getNumberOfPeople() - 1;
114 
115                if(people > 1)
116                        splitBill(people);
117        }
118 
119        private void splitBill(int people)
120        {
121                TippyTipperApplication appState = ((TippyTipperApplication)this.getApplication());
122                appState.service.splitBill(people);
123 
124                bindData();
125        }
126 
127        private void bindData()
128        {
129                TippyTipperApplication appState = ((TippyTipperApplication)this.getApplication());
130 
131                TextView lbl_split_amount = (TextView)findViewById(R.id.lbl_split_amount);
132                TextView lbl_split_tip = (TextView)findViewById(R.id.lbl_split_tip);
133                TextView lbl_split_adjustment = (TextView)findViewById(R.id.lbl_split_adjustment);
134                TextView lbl_split_total = (TextView)findViewById(R.id.lbl_split_total);
135                TextView lbl_NumberOfPeople = (TextView)findViewById(R.id.lbl_NumberOfPeople);
136 
137                View inflated_splitTax = findViewById(R.id.inflated_splitTax);
138 
139                float excludeTaxRate = Settings.getExcludeTaxRate(getBaseContext());
140                if(excludeTaxRate != 0)
141                {
142                        ViewStub stub_splitTax = (ViewStub)findViewById(R.id.stub_splitTax);
143                        if(stub_splitTax != null)
144                                stub_splitTax.setVisibility(View.VISIBLE);
145                        else if(inflated_splitTax != null)
146                                inflated_splitTax.setVisibility(View.VISIBLE);
147                        TextView lbl_split_tax = (TextView)findViewById(R.id.lbl_split_tax);
148                        lbl_split_tax.setText(appState.service.getSplitTaxAmount());
149                }
150                else
151                {
152                        if(inflated_splitTax != null)
153                                inflated_splitTax.setVisibility(View.GONE);
154                }
155 
156                lbl_split_amount.setText(appState.service.getSplitBillAmount());
157                lbl_split_tip.setText(appState.service.getSplitTipAmount());
158                lbl_split_adjustment.setText(appState.service.getSplitAdjustment());
159                lbl_split_total.setText(appState.service.getSplitTotalAmount());
160                lbl_NumberOfPeople.setText(Integer.toString(appState.service.getNumberOfPeople()));
161 
162                Map<String, String> params = new HashMap<String, String>();
163                params.put("Number of People", String.valueOf(appState.service.getNumberOfPeople()));
164                params.put("Split Bill Amount", appState.service.getSplitBillAmount());
165                params.put("Split Tax Amount", appState.service.getSplitTaxAmount());
166                params.put("Split Tip Amount", appState.service.getSplitTipAmount());
167                params.put("Split Adjustment Amount", appState.service.getSplitAdjustment());
168                params.put("Split Total Amount", appState.service.getSplitTotalAmount());
169                FlurryAgent.onEvent("Split Bill Bind Data", params);
170 
171        }
172}

[all classes][net.mandaria.tippytipper.activities]
EMMA 2.0.5312 (C) Vladimir Roubtsov