com.stringsandints.inventium.khlrooster
Class Khlrooster

java.lang.Object
  extended by Activity
      extended by com.stringsandints.inventium.khlrooster.Khlrooster

public class Khlrooster
extends Activity

Main screen of the application This will show a visual representation of the schedule. The user can switch between a day view and a week view. The menu in the screen is also the access point for the configuration of the application.

Author:
mathias

Field Summary
static int DAY_VIEW_ID
           
private  DayCalender dc
           
private  WeekCalendar wc
           
static int WEEK_VIEW_ID
           
 
Constructor Summary
Khlrooster()
           
 
Method Summary
private  void changeDayWeekViewIcon(MenuItem mi, int dvi)
          Method to change the week/day view icon in the menu whenever its toggled.
 void changeSyncIcon(Menu menu)
           
private  void enableAlarm(MenuItem item)
          Used property: alarmEnabled (Boolean).
 void onCreate(Bundle savedInstanceState)
          Called when the application is being created.
 boolean onCreateOptionsMenu(Menu menu)
          Called when the menu is created.
 boolean onCreatePanelMenu(int featureId, Menu menu)
          Called when the subMenu is created.
protected  void onDestroy()
           
 boolean onOptionsItemSelected(MenuItem item)
          Called when an option in the menu is chosen.
 boolean onPrepareOptionsMenu(Menu menu)
           
 void onRestoreInstanceState(Bundle savedInstanceState)
          Called when the InstanceState has to be restored.
 void onSaveInstanceState(Bundle savedInstanceState)
          Called when the instanceState has to be saved.
private  void readAndSetForceWifi(MenuItem item)
          Used property: forceWireless (Boolean).
private  void readAndSetVibrateBeforeLessonProperty(MenuItem item)
          Used property: vibrateBeforeLesson (Boolean).
private  int setLayoutProperty()
          Used property: layout (int).
private  void updateView()
          Toggles between day and week view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAY_VIEW_ID

public static final int DAY_VIEW_ID
See Also:
Constant Field Values

WEEK_VIEW_ID

public static final int WEEK_VIEW_ID
See Also:
Constant Field Values

dc

private DayCalender dc

wc

private WeekCalendar wc
Constructor Detail

Khlrooster

public Khlrooster()
Method Detail

onCreate

public void onCreate(Bundle savedInstanceState)
Called when the application is being created. Sets the right layout.


onSaveInstanceState

public void onSaveInstanceState(Bundle savedInstanceState)
Called when the instanceState has to be saved. (For instance when changing to landscape view.)


onRestoreInstanceState

public void onRestoreInstanceState(Bundle savedInstanceState)
Called when the InstanceState has to be restored. (For instance when the user changes to landscape view.)


onCreateOptionsMenu

public boolean onCreateOptionsMenu(Menu menu)
Called when the menu is created. This method inflates the menu and makes sure the right icon for either week or day view is placed in the menu.


onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(Menu menu)

onCreatePanelMenu

public boolean onCreatePanelMenu(int featureId,
                                 Menu menu)
Called when the subMenu is created. The alarmEnabled property is read and either checked (when it was enabled) or unchecked (when it was disabled).


onOptionsItemSelected

public boolean onOptionsItemSelected(MenuItem item)
Called when an option in the menu is chosen. The case checks which one was chosen and then sets the right property.


readAndSetForceWifi

private void readAndSetForceWifi(MenuItem item)
Used property: forceWireless (Boolean). This method reads the previously chosen setting, then uses this to either check or uncheck the CheckBox. Afterwards the property is committed again.

Parameters:
item -

readAndSetVibrateBeforeLessonProperty

private void readAndSetVibrateBeforeLessonProperty(MenuItem item)
Used property: vibrateBeforeLesson (Boolean). This method reads the previously chosen setting, then uses this to either check or uncheck the CheckBox. Afterwards the property is committed again.

Parameters:
item -

setLayoutProperty

private int setLayoutProperty()
Used property: layout (int). This method checks to see what the property layout has to be set to. It then writes this property.

Returns:

enableAlarm

private void enableAlarm(MenuItem item)
Used property: alarmEnabled (Boolean). This method reads the property alarmEnabled and uses this to check or uncheck to corresponding checkbox, based on whether or not the setting was already enabled or not.

Parameters:
item -

updateView

private void updateView()
Toggles between day and week view.


changeDayWeekViewIcon

private void changeDayWeekViewIcon(MenuItem mi,
                                   int dvi)
Method to change the week/day view icon in the menu whenever its toggled.


changeSyncIcon

public void changeSyncIcon(Menu menu)

onDestroy

protected void onDestroy()