sk.baka.ambient.activity.main
Class MainActivity

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.view.ContextThemeWrapper
              extended by android.app.Activity
                  extended by android.app.ListActivity
                      extended by sk.baka.ambient.activity.main.MainActivity
All Implemented Interfaces:
android.content.ComponentCallbacks, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback, AppState.IAppStateAware

public class MainActivity
extends android.app.ListActivity
implements AppState.IAppStateAware

The main activity. Handles GUI operations for all GUI components.

Author:
Martin Vysny

Field Summary
(package private)  ControllerGroup controllers
          The list of switchable controllers.
static java.lang.String INTENTDATA_ACTIVITY
          Send an intent with the activity enum name put under this key to activate the activity.
static java.lang.String INTENTDATA_STORECONFIG
          Send an intent having this extra to save a configuration.
static java.lang.String INTENTKEY_ZOOM
          Sets a new zoom level.
 
Fields inherited from class android.app.Activity
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
 
Fields inherited from class android.content.Context
ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, INPUT_METHOD_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, TELEPHONY_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
MainActivity()
           
 
Method Summary
 void activateAction(ActionsEnum action, boolean cycle)
          Executes given action.
 boolean dispatchKeyEvent(android.view.KeyEvent event)
           
 boolean dispatchTrackballEvent(android.view.MotionEvent ev)
           
 void onCreate(android.os.Bundle icicle)
           
protected  void onDestroy()
           
protected  void onNewIntent(android.content.Intent intent)
           
 boolean onOptionsItemSelected(android.view.MenuItem item)
           
 boolean onPrepareOptionsMenu(android.view.Menu menu)
           
protected  void onStart()
           
protected  void onStop()
           
 void reinit(AppState state)
          Cherry-picks values from the application state and reinitializes itself.
 void storeState(AppState state)
          Stores the components state into the global state.
 
Methods inherited from class android.app.ListActivity
getListAdapter, getListView, getSelectedItemId, getSelectedItemPosition, onContentChanged, onListItemClick, onRestoreInstanceState, setListAdapter, setSelection
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchTouchEvent, finalize, findViewById, finish, finishActivity, finishActivityFromChild, finishFromChild, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getCurrentFocus, getInstanceCount, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLocalClassName, getMenuInflater, getParent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVolumeControlStream, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, getWindow, getWindowManager, hasWindowFocus, isChild, isFinishing, isTaskRoot, managedQuery, moveTaskToBack, onActivityResult, onApplyThemeResource, onChildTitleChanged, onConfigurationChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onKeyDown, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostResume, onPrepareDialog, onPreparePanel, onRestart, onResume, onRetainNonConfigurationInstance, onSaveInstanceState, onSearchRequested, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, registerForContextMenu, removeDialog, requestWindowFeature, runOnUiThread, setContentView, setContentView, setContentView, setDefaultKeyMode, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setIntent, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, unregisterForContextMenu
 
Methods inherited from class android.view.ContextThemeWrapper
attachBaseContext, getTheme, setTheme
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, setWallpaper, setWallpaper, startInstrumentation, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTENTDATA_ACTIVITY

public static final java.lang.String INTENTDATA_ACTIVITY
Send an intent with the activity enum name put under this key to activate the activity.

See Also:
Constant Field Values

INTENTKEY_ZOOM

public static final java.lang.String INTENTKEY_ZOOM
Sets a new zoom level. Expects an instance of EnumMap.

See Also:
Constant Field Values

INTENTDATA_STORECONFIG

public static final java.lang.String INTENTDATA_STORECONFIG
Send an intent having this extra to save a configuration.

See Also:
Constant Field Values

controllers

ControllerGroup controllers
The list of switchable controllers. Only one of these controllers may be visible at the same time.

Constructor Detail

MainActivity

public MainActivity()
Method Detail

onCreate

public void onCreate(android.os.Bundle icicle)
Overrides:
onCreate in class android.app.Activity

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class android.app.Activity

onStop

protected void onStop()
Overrides:
onStop in class android.app.Activity

onStart

protected void onStart()
Overrides:
onStart in class android.app.Activity

activateAction

public void activateAction(ActionsEnum action,
                           boolean cycle)
Executes given action.

Parameters:
action - the action to take, must not be null.
cycle - if true then random/repeat modes are cycled instead of being activated.

reinit

public void reinit(AppState state)
Description copied from interface: AppState.IAppStateAware
Cherry-picks values from the application state and reinitializes itself.

Specified by:
reinit in interface AppState.IAppStateAware
Parameters:
state - the just-loaded state

storeState

public void storeState(AppState state)
Description copied from interface: AppState.IAppStateAware
Stores the components state into the global state. Must not alter settings not applicable for this component.

Specified by:
storeState in interface AppState.IAppStateAware
Parameters:
state - the object to store to.

onNewIntent

protected void onNewIntent(android.content.Intent intent)
Overrides:
onNewIntent in class android.app.Activity

onPrepareOptionsMenu

public boolean onPrepareOptionsMenu(android.view.Menu menu)
Overrides:
onPrepareOptionsMenu in class android.app.Activity

onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)
Overrides:
onOptionsItemSelected in class android.app.Activity

dispatchKeyEvent

public boolean dispatchKeyEvent(android.view.KeyEvent event)
Specified by:
dispatchKeyEvent in interface android.view.Window.Callback
Overrides:
dispatchKeyEvent in class android.app.Activity

dispatchTrackballEvent

public boolean dispatchTrackballEvent(android.view.MotionEvent ev)
Specified by:
dispatchTrackballEvent in interface android.view.Window.Callback
Overrides:
dispatchTrackballEvent in class android.app.Activity


Copyright © 2007-2009. All Rights Reserved.