Clover Coverage Report - HeartsSkyThread Coverage Report
Coverage timestamp: gio dic 18 2014 15:52:24 EST
../../../../img/srcFileCovDistChart7.png 38% of files have more coverage
62   195   14   12,4
18   111   0,23   5
5     2,8  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
Line # 27 62 14 67,1% 0.67058825
 
No Tests
 
1    package game.shad.tempus.hearts;
2   
3   
4    import game.shad.tempus.hearts.GameThread.State;
5    import android.R.integer;
6    import android.app.Activity;
7    import android.content.Context;
8    import android.content.Intent;
9    import android.hardware.Sensor;
10    import android.hardware.SensorManager;
11    import android.media.AudioManager;
12    import android.os.AsyncTask;
13    import android.os.Bundle;
14    import android.os.Handler;
15    import android.os.PowerManager;
16    import android.util.Log;
17    import android.view.Display;
18    import android.view.View;
19    import android.widget.CheckBox;
20    import android.widget.EditText;
21    import android.widget.ProgressBar;
22    import android.widget.RadioButton;
23    import android.widget.TextView;
24    import android.widget.Toast;
25    import android.widget.ViewSwitcher;
26   
 
27    public class MainMenu extends Activity{
28    public static final String TAG = "Hearts--Main";
29   
30    EditText et;
31    public Game game;
32    public GameThread gt;
33    public GameView gameView;
34    public Handler handler; //Handler to UI thread to post tasks to.
35   
36   
 
37  1 toggle public void onCreate(Bundle savedInstanceState) {
38  1 super.onCreate(savedInstanceState);
39  1 setContentView(R.layout.main);
40   
41  1 et = (EditText) findViewById(R.id.playerName);
42  1 et.setText("Your name");
43   
44    }
45   
46   
47   
 
48  8 toggle public void onStartPressed(View v){
49  8 Intent gameIntent =new Intent(this, game.shad.tempus.hearts.MainActivity.class);
50  8 Bundle gameBundle = new Bundle();
51  8 et = (EditText) findViewById(R.id.playerName);
52  8 String s = et.getText().toString();
53  8 System.out.println(s);
54  8 gameBundle.putString("name", s);
55  8 gameBundle.putBoolean("restart", true);
56  8 RadioButton easy = (RadioButton) findViewById(R.id.easy);
57  8 RadioButton medium = (RadioButton) findViewById(R.id.medium);
58  8 RadioButton hard = (RadioButton) findViewById(R.id.hard);
59   
60  8 if(easy.isChecked()){
61  1 gameBundle.putInt("diff", 1);
62    }
63  7 else if(medium.isChecked()){
64  1 gameBundle.putInt("diff", 2);
65    }
66  6 else if(hard.isChecked()){
67  6 gameBundle.putInt("diff", 3);
68    }
69   
70  8 RadioButton shuffleDrop = (RadioButton) findViewById(R.id.dropShuffle);
71  8 RadioButton shuffleSwap = (RadioButton) findViewById(R.id.randomSwap);
72  8 RadioButton mixShuffle = (RadioButton) findViewById(R.id.mixShuffle);
73   
74  8 if(shuffleDrop.isChecked()){
75  3 gameBundle.putInt("shuffle", 1);
76    }
77  5 else if(shuffleSwap.isChecked()){
78  1 gameBundle.putInt("shuffle", 2);
79    }
80  4 else if(mixShuffle.isChecked()){
81  4 gameBundle.putInt("shuffle", 3);
82    }
83  8 CheckBox playerHelper = (CheckBox) findViewById(R.id.playerHelper);
84  8 boolean ph = playerHelper.isChecked();
85  8 gameBundle.putBoolean("playerHelper", ph);
86  8 CheckBox voidHelper = (CheckBox) findViewById(R.id.trackVoidsBox);
87  8 boolean vh = voidHelper.isChecked();
88  8 gameBundle.putBoolean("voidHelper", vh);
89  8 Display display = getWindowManager().getDefaultDisplay();
90  8 int width = display.getWidth();
91  8 int height = display.getHeight();
92  8 gameBundle.putInt("height", height);
93  8 gameBundle.putInt("width", width);
94  8 gameIntent.putExtras(gameBundle);
95  8 startActivity(gameIntent);
96   
97    }
98   
99   
100   
101   
102   
103   
104   
105   
106   
107    /* Old start
108    * public void onStartPressed(View v){
109    Intent gameIntent =new Intent(this, game.shad.tempus.hearts.Game.class);
110    et = (EditText) findViewById(R.id.playerName);
111    String s = et.getText().toString();
112    System.out.println(s);
113    gameIntent.putExtra("name", s);
114    gameIntent.putExtra("restart", true);
115    RadioButton easy = (RadioButton) findViewById(R.id.easy);
116    RadioButton medium = (RadioButton) findViewById(R.id.medium);
117    RadioButton hard = (RadioButton) findViewById(R.id.hard);
118   
119    if(easy.isChecked()){
120    gameIntent.putExtra("diff", 1);
121    }
122    else if(medium.isChecked()){
123    gameIntent.putExtra("diff", 2);
124    }
125    else if(hard.isChecked()){
126    gameIntent.putExtra("diff", 3);
127    }
128   
129    RadioButton shuffleDrop = (RadioButton) findViewById(R.id.dropShuffle);
130    RadioButton shuffleSwap = (RadioButton) findViewById(R.id.randomSwap);
131    RadioButton mixShuffle = (RadioButton) findViewById(R.id.mixShuffle);
132   
133    if(shuffleDrop.isChecked()){
134    gameIntent.putExtra("shuffle", 1);
135    }
136    else if(shuffleSwap.isChecked()){
137    gameIntent.putExtra("shuffle", 2);
138    }
139    else if(mixShuffle.isChecked()){
140    gameIntent.putExtra("shuffle", 3);
141    }
142    CheckBox playerHelper = (CheckBox) findViewById(R.id.playerHelper);
143    boolean ph = playerHelper.isChecked();
144    gameIntent.putExtra("playerHelper", ph);
145    CheckBox voidHelper = (CheckBox) findViewById(R.id.trackVoidsBox);
146    boolean vh = voidHelper.isChecked();
147    gameIntent.putExtra("voidHelper", vh);
148    Bundle b = new Bundle();
149    startActivity(gameIntent);
150    // finish();
151    }
152   
153    */
154   
155   
 
156  0 toggle public void onResumePressed(View v){
157  0 Intent gameIntent =new Intent(this, game.shad.tempus.hearts.Game.class);
158  0 et = (EditText) findViewById(R.id.playerName);
159  0 String s = et.getText().toString();
160  0 System.out.println(s);
161  0 gameIntent.putExtra("name", s);
162  0 gameIntent.putExtra("restart", false);
163  0 RadioButton easy = (RadioButton) findViewById(R.id.easy);
164  0 RadioButton medium = (RadioButton) findViewById(R.id.medium);
165  0 RadioButton hard = (RadioButton) findViewById(R.id.hard);
166  0 if(easy.isChecked()){
167  0 gameIntent.putExtra("diff", 1);
168    }
169  0 else if(medium.isChecked()){
170  0 gameIntent.putExtra("diff", 2);
171    }
172  0 else if(hard.isChecked()){
173  0 gameIntent.putExtra("diff", 3);
174    }
175   
176   
177  0 CheckBox voidHelper = (CheckBox) findViewById(R.id.trackVoidsBox);
178  0 boolean vh = voidHelper.isChecked();
179  0 gameIntent.putExtra("voidHelper", vh);
180  0 startActivity(gameIntent);
181    // finish();
182    }
183   
 
184  1 toggle public void textSelected(View v){
185   
186    }
187   
188   
 
189  2 toggle public void todo(View v){
190  2 Toast.makeText(MainMenu.this, "Still in progress...", Toast.LENGTH_SHORT).show();
191   
192    }
193   
194   
195    }