public class SWADMain extends MenuExpandableListActivity
Modifier and Type | Class and Description |
---|---|
private class |
SWADMain.onItemSelectedListener |
Modifier and Type | Field and Description |
---|---|
(package private) SecureConnection |
conn
SSL connection
|
private long |
courseCode
Code of selected course
|
private int |
currentRole
Current role 2 - student 3 - teacher -1 - none role was chosen
|
private boolean |
dBCleaned |
private Cursor |
dbCursor
Cursor for database access
|
private boolean |
firstRun
Indicates if it is the first run
|
protected String[] |
functions
Array of strings for main ListView
|
private String |
IMAGE
Function text field
|
private List<Model> |
listCourses
User courses list
|
private EditText |
mDniView |
private boolean |
mLoginError |
private View |
mLoginFormView |
private TextView |
mLoginStatusMessageView |
private View |
mLoginStatusView |
private View |
mMainScreenView |
private EditText |
mPasswordView |
private EditText |
mServerView |
private ImageButton |
mUpdateButton |
private String |
NAME
Function name field
|
(package private) Preferences |
prefs
Application preferences
|
private View.OnTouchListener |
Spinner_OnTouch |
static String |
TAG
Tests tag name for Logcat
|
dbHelper, isDebuggable
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
Constructor and Description |
---|
SWADMain() |
Modifier and Type | Method and Description |
---|---|
void |
attemptLogin()
Attempts to sign in or register the account specified by the login form.
|
private void |
changeToStudentMenu()
Adapts the current menu to students view.
|
private void |
changeToTeacherMenu()
Adapts the current menu to teachers view.
|
private void |
cleanSpinner()
Create an empty spinner.
|
private void |
createBaseMenu()
Creates base menu.
|
private void |
createMenu() |
private void |
createSpinnerAdapter() |
private void |
getCurrentCourses() |
static DataBaseHelper |
getDbHelper()
Gets the database helper
|
private void |
initializeViews() |
private boolean |
isUserOrPasswordEmpty() |
private void |
loginForm(boolean show)
Shows a login form
|
protected void |
onActivityResult(int requestCode,
int resultCode,
Intent data) |
boolean |
onChildClick(ExpandableListView parent,
View v,
int groupPosition,
int childPosition,
long id) |
void |
onCreate(Bundle icicle) |
protected void |
onDestroy() |
void |
onRefreshClick(View v)
Launches an action when refresh button is pushed
|
protected void |
onResume() |
protected void |
setMenuDbClean()
Creates an empty Menu and spinner when the data base is empty
|
private void |
setupLoginForm() |
private void |
showProgress(boolean show)
Shows the progress UI and hides the login form.
|
void |
showUpgradeDialog(Context context)
Shows initial dialog after application upgrade.
|
error, onCreateOptionsMenu, onOptionsItemSelected, onPause, showDialog, viewPreferences
getExpandableListAdapter, getExpandableListView, getSelectedId, getSelectedPosition, onContentChanged, onCreateContextMenu, onGroupCollapse, onGroupExpand, onRestoreInstanceState, setListAdapter, setSelectedChild, setSelectedGroup
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isTaskRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContextItemSelected, onContextMenuClosed, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onNewIntent, onOptionsMenuClosed, onPanelClosed, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistData, onRestart, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onStart, onStop, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, recreate, registerForContextMenu, removeDialog, reportFullyDrawn, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, shouldUpRecreateTask, showDialog, showDialog, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityForResult, startActivityForResult, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
applyOverrideConfiguration, attachBaseContext, getResources, getTheme, setTheme
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
Preferences prefs
SecureConnection conn
protected String[] functions
private final String NAME
private final String IMAGE
private long courseCode
private Cursor dbCursor
public static final String TAG
private boolean firstRun
private int currentRole
private boolean dBCleaned
private boolean mLoginError
private EditText mDniView
private EditText mPasswordView
private EditText mServerView
private View mLoginFormView
private View mLoginStatusView
private View mMainScreenView
private TextView mLoginStatusMessageView
private ImageButton mUpdateButton
private final View.OnTouchListener Spinner_OnTouch
public static DataBaseHelper getDbHelper()
public void showUpgradeDialog(Context context)
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id)
onChildClick
in interface ExpandableListView.OnChildClickListener
onChildClick
in class ExpandableListActivity
public void onCreate(Bundle icicle)
onCreate
in class MenuExpandableListActivity
protected void onResume()
onResume
in class MenuExpandableListActivity
protected void onActivityResult(int requestCode, int resultCode, Intent data)
onActivityResult
in class Activity
private void createSpinnerAdapter()
private void cleanSpinner()
private void getCurrentCourses()
private void createMenu()
private void createBaseMenu()
private void changeToStudentMenu()
private void changeToTeacherMenu()
protected void setMenuDbClean()
setMenuDbClean
in class MenuExpandableListActivity
public void onRefreshClick(View v)
v
- Actual viewprivate boolean isUserOrPasswordEmpty()
private void initializeViews()
private void loginForm(boolean show)
private void setupLoginForm()
public void attemptLogin()
private void showProgress(boolean show)