Add some documentation for the activities and app context

master
bspeice 2013-11-28 23:12:46 -05:00
parent c843d7f337
commit d9ce6e0f1c
4 changed files with 17 additions and 9 deletions

View File

@ -21,7 +21,8 @@ public class GameDay extends Application{
} }
/** /**
* Gets the app context. * Provides a static way of getting to the Application-level context.
* Unless you know *exactly* why you need this, you don't.
* *
* @return the app context * @return the app context
*/ */

View File

@ -22,9 +22,9 @@ public class Alerts extends MenuActivity {
} }
/** /**
* On click timed alerts. * On clicking the Timed Alerts box, enable or disable the alerts.
* *
* @param view the view * @param view - The view clicked
*/ */
public void onClickTimedAlerts(View view) { public void onClickTimedAlerts(View view) {
int toastDuration = Toast.LENGTH_SHORT; int toastDuration = Toast.LENGTH_SHORT;
@ -37,7 +37,7 @@ public class Alerts extends MenuActivity {
} }
/** /**
* On click organization alerts. * On clicking the Organization Alerts box, enable or disable the alerts.
* *
* @param view the view * @param view the view
*/ */
@ -52,7 +52,7 @@ public class Alerts extends MenuActivity {
} }
/** /**
* On click university alerts. * On clicking the University Alerts box, enable or disable the alerts.
* *
* @param view the view * @param view the view
*/ */

View File

@ -10,7 +10,7 @@ import com.uncc.gameday.R;
// TODO: Auto-generated Javadoc // TODO: Auto-generated Javadoc
/** /**
* The Class MenuActivity. * The Class MenuActivity - Provides a re-usable way to define menu behavior
*/ */
public class MenuActivity extends Activity { public class MenuActivity extends Activity {
@ -33,8 +33,11 @@ public class MenuActivity extends Activity {
return true; return true;
} }
/* (non-Javadoc) /**
* @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem) * When a menu item is selected, fire up its activity. This allows us to
* define a single method for menu items that is re-used by sub-classes.
*
* @param item - The MenuItem selected
*/ */
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {

View File

@ -25,15 +25,17 @@ public class Parking extends MenuActivity {
} }
/** /**
* On radio button click. * On clicking a parking lot button, show that fragment
* *
* @param v the v * @param v the v
*/ */
public void onRadioButtonClick(View v) { public void onRadioButtonClick(View v) {
// Set up some initial fragment boilerplate
FragmentManager fm = this.getFragmentManager(); FragmentManager fm = this.getFragmentManager();
LotViewFragment f = new LotViewFragment(); LotViewFragment f = new LotViewFragment();
Bundle fBundle = new Bundle(); Bundle fBundle = new Bundle();
// Get the actual parking lot we will load (store as a String)
switch (v.getId()) { switch (v.getId()) {
case R.id.radioButtonBlack: case R.id.radioButtonBlack:
fBundle.putCharArray("CHOICE", ParkingChoice.BLACK.getValue().toCharArray()); fBundle.putCharArray("CHOICE", ParkingChoice.BLACK.getValue().toCharArray());
@ -70,6 +72,8 @@ public class Parking extends MenuActivity {
break; break;
} }
// Start up the fragment with the information
// Note the setArguments() and getArguments() function
f.setArguments(fBundle); f.setArguments(fBundle);
f.show(fm, "lot_view"); f.show(fm, "lot_view");
} }