com.drismo.gui
Class ViewTrip

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.ActivityGroup
                      extended by android.app.TabActivity
                          extended by com.drismo.gui.ViewTrip
All Implemented Interfaces:
android.content.ComponentCallbacks, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback

public class ViewTrip
extends android.app.TabActivity

Handles displaying of a trip and shows the different info in different views.


Field Summary
private  GraphView graphView
           
private static int showThresholds
           
private  android.widget.TabHost tabHost
           
private  Trip trip
           
 
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
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_NOT_FOREGROUND, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DROPBOX_SERVICE, 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, UI_MODE_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Constructor Summary
ViewTrip()
           
 
Method Summary
 void onCreate(android.os.Bundle savedInstanceState)
          Sets up the whole layout/view.
 boolean onCreateOptionsMenu(android.view.Menu menu)
          Creating the menu for this activity from trip_graph_menu.xml.
 boolean onOptionsItemSelected(android.view.MenuItem item)
          Set the menu for this activity, when the user press the device menu button.
 void onStart()
          Fires the app rater on start:
 void populateActivity()
          Populates the activity's tabs & views.
 void readTripFile(java.lang.String filename)
          Reads one trip, based of the given file name.
static java.io.ByteArrayOutputStream saveGraph(android.view.View v)
           
static int showThresholds()
          Get the value that determines if thresholds should be displayed in the graph or not.
 
Methods inherited from class android.app.TabActivity
getTabHost, getTabWidget, onChildTitleChanged, onContentChanged, onPostCreate, onRestoreInstanceState, onSaveInstanceState, setDefaultTab, setDefaultTab
 
Methods inherited from class android.app.ActivityGroup
getCurrentActivity, getLocalActivityManager, onDestroy, onPause, onResume, onStop
 
Methods inherited from class android.app.Activity
addContentView, closeContextMenu, closeOptionsMenu, createPendingResult, dismissDialog, dispatchKeyEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, 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, onAttachedToWindow, onBackPressed, onConfigurationChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onDetachedFromWindow, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNewIntent, onOptionsMenuClosed, onPanelClosed, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareOptionsMenu, onPreparePanel, onRestart, onRetainNonConfigurationInstance, onSearchRequested, onTitleChanged, onTouchEvent, onTrackballEvent, onUserInteraction, onUserLeaveHint, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, overridePendingTransition, 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, showDialog, startActivity, startActivityForResult, startActivityFromChild, startActivityIfNeeded, startIntentSender, startIntentSenderForResult, startIntentSenderFromChild, startManagingCursor, startNextMatchingActivity, startSearch, stopManagingCursor, takeKeyEvents, triggerSearch, 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, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getWallpaper, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showThresholds

private static int showThresholds

trip

private Trip trip

graphView

private GraphView graphView

tabHost

private android.widget.TabHost tabHost
Constructor Detail

ViewTrip

public ViewTrip()
Method Detail

onCreate

public void onCreate(android.os.Bundle savedInstanceState)
Sets up the whole layout/view.

Overrides:
onCreate in class android.app.ActivityGroup
Parameters:
savedInstanceState - savedInstance

onStart

public void onStart()
Fires the app rater on start:

Overrides:
onStart in class android.app.Activity

readTripFile

public void readTripFile(java.lang.String filename)
Reads one trip, based of the given file name.

Parameters:
filename - File to read.

populateActivity

public void populateActivity()
Populates the activity's tabs & views.


onCreateOptionsMenu

public boolean onCreateOptionsMenu(android.view.Menu menu)
Creating the menu for this activity from trip_graph_menu.xml.

Overrides:
onCreateOptionsMenu in class android.app.Activity
Parameters:
menu - The menu to place the items into.
Returns:
True to display the menu if we're in graph view. False in other tabs.

onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)
Set the menu for this activity, when the user press the device menu button.

Overrides:
onOptionsItemSelected in class android.app.Activity
Parameters:
item - The selected menu item.
Returns:
True, to end menu processing after the invalidation is done.

showThresholds

public static int showThresholds()
Get the value that determines if thresholds should be displayed in the graph or not.

Returns:
Returns 1 if thresholds should be shown.

saveGraph

public static java.io.ByteArrayOutputStream saveGraph(android.view.View v)