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

java.lang.Object
  extended by sk.baka.ambient.views.KeyEventHandler
      extended by sk.baka.ambient.views.gesturelist.keypad.AbstractKeypadHandler
          extended by sk.baka.ambient.views.gesturelist.keypad.KeypadDpadSearch
All Implemented Interfaces:
android.view.KeyEvent.Callback

public final class KeypadDpadSearch
extends AbstractKeypadHandler

Handles search using the DPAD only.

Author:
Martin Vysny

Field Summary
 
Fields inherited from class sk.baka.ambient.views.gesturelist.keypad.AbstractKeypadHandler
owner
 
Fields inherited from class sk.baka.ambient.views.KeyEventHandler
keyDownHandled
 
Constructor Summary
KeypadDpadSearch(GesturesListView owner)
          Creates new instance
 
Method Summary
 boolean isActivatedByKey(int keyCode, android.view.KeyEvent event)
          Checks if this handler is activated by given key press.
 boolean isStarted()
          Checks if this handler is started.
protected  boolean onConfirm()
          Invoked on center or KeyEvent.KEYCODE_ENTER key press.
protected  boolean onDown()
          Invoked on down arrow key press.
protected  boolean onKey(int keyCode, int count, android.view.KeyEvent event)
          Invoked on key press.
protected  boolean onLeft()
          Invoked on left arrow key press.
protected  boolean onRight()
          Invoked on right arrow key press.
protected  boolean onUp()
          Invoked on up arrow key press.
 void start()
          Starts this key handler.
 void stop()
          Stops this key handler.
 
Methods inherited from class sk.baka.ambient.views.gesturelist.keypad.AbstractKeypadHandler
selectionChanged
 
Methods inherited from class sk.baka.ambient.views.KeyEventHandler
compose, isConfirm, keyUp, moveFocus, onKey, onKeyDown, onKeyMultiple, onKeyUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeypadDpadSearch

public KeypadDpadSearch(GesturesListView owner)
Creates new instance

Parameters:
owner - the owner.
Method Detail

start

public void start()
Description copied from class: AbstractKeypadHandler
Starts this key handler. The handler should initialize and start listening for keys.

Specified by:
start in class AbstractKeypadHandler

stop

public void stop()
Description copied from class: AbstractKeypadHandler
Stops this key handler. The handler should clean up. No more keys will be received unless AbstractKeypadHandler.start() is invoked again.

Specified by:
stop in class AbstractKeypadHandler

isActivatedByKey

public boolean isActivatedByKey(int keyCode,
                                android.view.KeyEvent event)
Description copied from class: AbstractKeypadHandler
Checks if this handler is activated by given key press.

Specified by:
isActivatedByKey in class AbstractKeypadHandler
Parameters:
keyCode - the key code
event - the event.
Returns:
true if this handler should be activated, false otherwise.

isStarted

public boolean isStarted()
Description copied from class: AbstractKeypadHandler
Checks if this handler is started.

Specified by:
isStarted in class AbstractKeypadHandler
Returns:
true if started, false otherwise.

onConfirm

protected boolean onConfirm()
Description copied from class: KeyEventHandler
Invoked on center or KeyEvent.KEYCODE_ENTER key press.

Overrides:
onConfirm in class KeyEventHandler
Returns:
true if the event was handled and is to be suppressed, false otherwise.

onDown

protected boolean onDown()
Description copied from class: KeyEventHandler
Invoked on down arrow key press.

Overrides:
onDown in class KeyEventHandler
Returns:
true if the event was handled and is to be suppressed, false otherwise.

onLeft

protected boolean onLeft()
Description copied from class: KeyEventHandler
Invoked on left arrow key press.

Overrides:
onLeft in class KeyEventHandler
Returns:
true if the event was handled and is to be suppressed, false otherwise.

onRight

protected boolean onRight()
Description copied from class: KeyEventHandler
Invoked on right arrow key press.

Overrides:
onRight in class KeyEventHandler
Returns:
true if the event was handled and is to be suppressed, false otherwise.

onUp

protected boolean onUp()
Description copied from class: KeyEventHandler
Invoked on up arrow key press.

Overrides:
onUp in class KeyEventHandler
Returns:
true if the event was handled and is to be suppressed, false otherwise.

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.


Copyright © 2007-2009. All Rights Reserved.