sk.baka.ambient.views.gesturelist.keypad
Class AbstractKeypadHandler

java.lang.Object
  extended by sk.baka.ambient.views.KeyEventHandler
      extended by sk.baka.ambient.views.gesturelist.keypad.AbstractKeypadHandler
All Implemented Interfaces:
android.view.KeyEvent.Callback
Direct Known Subclasses:
KeypadController, KeypadDpadSearch, KeypadSearch

public abstract class AbstractKeypadHandler
extends KeyEventHandler

Handles the key events.

Author:
Martin Vysny

Field Summary
protected  GesturesListView owner
          The owner instance.
 
Fields inherited from class sk.baka.ambient.views.KeyEventHandler
keyDownHandled
 
Constructor Summary
AbstractKeypadHandler(GesturesListView owner)
          Creates new handler.
 
Method Summary
abstract  boolean isActivatedByKey(int keyCode, android.view.KeyEvent event)
          Checks if this handler is activated by given key press.
abstract  boolean isStarted()
          Checks if this handler is started.
 void selectionChanged()
          Invoked when the selection is changed in the underlying list view.
abstract  void start()
          Starts this key handler.
abstract  void stop()
          Stops this key handler.
 
Methods inherited from class sk.baka.ambient.views.KeyEventHandler
compose, isConfirm, keyUp, moveFocus, onConfirm, onDown, onKey, 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
 

Field Detail

owner

protected final GesturesListView owner
The owner instance.

Constructor Detail

AbstractKeypadHandler

public AbstractKeypadHandler(GesturesListView owner)
Creates new handler.

Parameters:
owner - owner list view
Method Detail

isActivatedByKey

public abstract boolean isActivatedByKey(int keyCode,
                                         android.view.KeyEvent event)
Checks if this handler is activated by given key press.

Parameters:
keyCode - the key code
event - the event.
Returns:
true if this handler should be activated, false otherwise.

start

public abstract void start()
Starts this key handler. The handler should initialize and start listening for keys.


stop

public abstract void stop()
Stops this key handler. The handler should clean up. No more keys will be received unless start() is invoked again.


isStarted

public abstract boolean isStarted()
Checks if this handler is started.

Returns:
true if started, false otherwise.

selectionChanged

public void selectionChanged()
Invoked when the selection is changed in the underlying list view.



Copyright © 2007-2009. All Rights Reserved.