sk.baka.ambient.activity.main
Class MenuHandler

java.lang.Object
  extended by sk.baka.ambient.views.KeyEventHandler
      extended by sk.baka.ambient.activity.main.MenuHandler
All Implemented Interfaces:
android.view.KeyEvent.Callback

final class MenuHandler
extends KeyEventHandler

Handles activities from the MainActivity menu.

Author:
Martin Vysny

Field Summary
 
Fields inherited from class sk.baka.ambient.views.KeyEventHandler
keyDownHandled
 
Constructor Summary
MenuHandler(MainActivity mainActivity)
          Creates new handler instance.
 
Method Summary
 void cancelResize()
          Cancels the resizing operation.
(package private)  boolean dispatchTrackballEvent(android.view.MotionEvent ev)
          See MainActivity.dispatchTrackballEvent(MotionEvent)
protected  void keyUp(int keyCode, android.view.KeyEvent event)
          Handles the key-up event.
protected  boolean onKey(int keyCode, int count, android.view.KeyEvent event)
          Invoked on key press.
(package private)  boolean onOptionsItemSelected(android.view.MenuItem item)
          MainActivity.onOptionsItemSelected(MenuItem)
(package private)  void onPrepareOptionsMenu(android.view.Menu menu)
          MainActivity.onPrepareOptionsMenu(Menu)
 void startResizing()
          Starts the controller resizing if available.
 
Methods inherited from class sk.baka.ambient.views.KeyEventHandler
compose, isConfirm, moveFocus, onConfirm, onDown, onKey, onKeyDown, onKeyMultiple, onKeyUp, onLeft, onRight, onUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuHandler

MenuHandler(MainActivity mainActivity)
Creates new handler instance.

Parameters:
mainActivity - owner activity
Method Detail

onKey

protected boolean onKey(int keyCode,
                        int count,
                        android.view.KeyEvent event)
Description copied from class: KeyEventHandler
Invoked on key press. By default invokes one of the onUp, onDown... event handlers.

Overrides:
onKey in class KeyEventHandler
Parameters:
keyCode - the key code
count - the key repeat count. 0 is the first key press
event - the event
Returns:
true if the event was handled and is to be suppressed, false otherwise.

keyUp

protected void keyUp(int keyCode,
                     android.view.KeyEvent event)
Description copied from class: KeyEventHandler
Handles the key-up event. The event is not cancelable by overriding class. By default does nothing.

Overrides:
keyUp in class KeyEventHandler
Parameters:
keyCode - the key code
event - the event

cancelResize

public void cancelResize()
Cancels the resizing operation.


dispatchTrackballEvent

boolean dispatchTrackballEvent(android.view.MotionEvent ev)
See MainActivity.dispatchTrackballEvent(MotionEvent)

Parameters:
ev - event
Returns:
boolean

startResizing

public void startResizing()
Starts the controller resizing if available.


onPrepareOptionsMenu

void onPrepareOptionsMenu(android.view.Menu menu)
MainActivity.onPrepareOptionsMenu(Menu)

Parameters:
menu - menu

onOptionsItemSelected

boolean onOptionsItemSelected(android.view.MenuItem item)
MainActivity.onOptionsItemSelected(MenuItem)

Parameters:
item - item
Returns:
boolean


Copyright © 2007-2009. All Rights Reserved.