com.stringsandints.inventium.khlrooster
Class LessonEditor

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

public class LessonEditor
extends Activity

This class is the Activity wherein users can select their lessons.


Field Summary
private  LessonEditorAsyncHelper async
           
static int ASYNC_CLASS
           
static int ASYNC_DEP
           
static int ASYNC_LESSON
           
static int ASYNC_NONE
           
 int asyncactivity
           
 java.util.ArrayList<java.lang.String> asyncargs
           
 boolean connectionAlive
           
private  java.lang.String department
           
private  java.util.ArrayList<VEVENT> eventlist
           
private  boolean lessoncheckboxcheckmode
           
private  java.util.ArrayList<CheckBox> lessoncheckboxes
           
private  boolean loading
           
private  java.lang.String reeks
           
private  java.util.ArrayList<java.lang.String> selectedlessons
           
 
Constructor Summary
LessonEditor()
           
 
Method Summary
private  void doAsyncRequest(int type)
          This method performs an asynchronous request
 void getClasses()
          This method starts an asynchronous request to fetch the classes
 void getDepartments()
          This method starts an asynchronous request to fetch the departments
 void getLessons()
          This method starts an asynchronous request to fetch the lessons
 void onBackPressed()
          When the user presses the back button, this method is called.
 void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
          This method is called whenever an element in one of the lists is selected
 void onClassesFetched(java.util.ArrayList<java.lang.String> classes)
          This method is called by an asynchronous task
protected  void onCreate(Bundle savedInstanceState)
          This method is called when the Activity gets created.
 void onDepartmentsFetched(java.util.ArrayList<java.lang.String> departments)
          This method is called by an asynchronous task
protected  void onDestroy()
          This method is called when the activity exits
 void onLessonSelectAll(View v)
          This method is called when the select all lessons button is pressed
 void onLessonsFetched(java.util.ArrayList<java.lang.String> lessons, java.util.ArrayList<VEVENT> events)
          This method is called by an asynchronous task
 void onLessonsSaved(View v)
          This method is called when the lesson save button is pressed
 void onLessonsSynced(boolean success)
          This method is called by an asynchronous task
protected  void onRestoreInstanceState(Bundle savedInstanceState)
          This method is called when the activity changes state (eg screen orientation is changed)
protected  void onSaveInstanceState(Bundle outState)
          This method is called when the activity changes state (eg screen orientation is changed)
private  void showClassSelector(java.util.ArrayList<java.lang.String> classes)
          This method shows the class selector
private  void showDepartmentSelector(java.util.ArrayList<java.lang.String> departments)
          This method shows the department selector
private  void showLessonSelector(java.util.ArrayList<java.lang.String> lessons)
          This method shows the lesson selector
protected  void switchActivity()
          This method calls the correct subactivity when asked
private  void toggleLoadingScreen(boolean on)
          This method toggles the loading screen and hides all other screens
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionAlive

public boolean connectionAlive

department

private java.lang.String department

reeks

private java.lang.String reeks

loading

private boolean loading

selectedlessons

private java.util.ArrayList<java.lang.String> selectedlessons

ASYNC_NONE

public static final int ASYNC_NONE
See Also:
Constant Field Values

ASYNC_DEP

public static final int ASYNC_DEP
See Also:
Constant Field Values

ASYNC_CLASS

public static final int ASYNC_CLASS
See Also:
Constant Field Values

ASYNC_LESSON

public static final int ASYNC_LESSON
See Also:
Constant Field Values

asyncactivity

public int asyncactivity

asyncargs

public java.util.ArrayList<java.lang.String> asyncargs

async

private LessonEditorAsyncHelper async

eventlist

private java.util.ArrayList<VEVENT> eventlist

lessoncheckboxes

private java.util.ArrayList<CheckBox> lessoncheckboxes

lessoncheckboxcheckmode

private boolean lessoncheckboxcheckmode
Constructor Detail

LessonEditor

public LessonEditor()
Method Detail

onCreate

protected void onCreate(Bundle savedInstanceState)
This method is called when the Activity gets created. The layout is changed to lesson_editor and the getDepartments() function is called.


onDestroy

protected void onDestroy()
This method is called when the activity exits


onSaveInstanceState

protected void onSaveInstanceState(Bundle outState)
This method is called when the activity changes state (eg screen orientation is changed)


onRestoreInstanceState

protected void onRestoreInstanceState(Bundle savedInstanceState)
This method is called when the activity changes state (eg screen orientation is changed)


onBackPressed

public void onBackPressed()
When the user presses the back button, this method is called.


switchActivity

protected void switchActivity()
This method calls the correct subactivity when asked


toggleLoadingScreen

private void toggleLoadingScreen(boolean on)
This method toggles the loading screen and hides all other screens


showDepartmentSelector

private void showDepartmentSelector(java.util.ArrayList<java.lang.String> departments)
This method shows the department selector


showClassSelector

private void showClassSelector(java.util.ArrayList<java.lang.String> classes)
This method shows the class selector


showLessonSelector

private void showLessonSelector(java.util.ArrayList<java.lang.String> lessons)
This method shows the lesson selector


doAsyncRequest

private void doAsyncRequest(int type)
This method performs an asynchronous request


onDepartmentsFetched

public void onDepartmentsFetched(java.util.ArrayList<java.lang.String> departments)
This method is called by an asynchronous task

Parameters:
departments -

onClassesFetched

public void onClassesFetched(java.util.ArrayList<java.lang.String> classes)
This method is called by an asynchronous task

Parameters:
classes -

onLessonsFetched

public void onLessonsFetched(java.util.ArrayList<java.lang.String> lessons,
                             java.util.ArrayList<VEVENT> events)
This method is called by an asynchronous task

Parameters:
lessons -
events -

onLessonsSynced

public void onLessonsSynced(boolean success)
This method is called by an asynchronous task

Parameters:
success -

getDepartments

public void getDepartments()
This method starts an asynchronous request to fetch the departments


getClasses

public void getClasses()
This method starts an asynchronous request to fetch the classes


getLessons

public void getLessons()
This method starts an asynchronous request to fetch the lessons


onCheckedChanged

public void onCheckedChanged(CompoundButton buttonView,
                             boolean isChecked)
This method is called whenever an element in one of the lists is selected


onLessonsSaved

public void onLessonsSaved(View v)
This method is called when the lesson save button is pressed

Parameters:
v -

onLessonSelectAll

public void onLessonSelectAll(View v)
This method is called when the select all lessons button is pressed