FileDocCategorySizeDatePackage
SoundEffectConstants.javaAPI DocAndroid 1.5 API2133Wed May 06 22:41:56 BST 2009android.view

SoundEffectConstants

public class SoundEffectConstants extends Object
Constants to be used to play sound effects via {@link View#playSoundEffect(int)}

Fields Summary
public static final int
CLICK
public static final int
NAVIGATION_LEFT
public static final int
NAVIGATION_UP
public static final int
NAVIGATION_RIGHT
public static final int
NAVIGATION_DOWN
Constructors Summary
private SoundEffectConstants()

Methods Summary
public static intgetContantForFocusDirection(int direction)
Get the sonification constant for the focus directions.

param
direction One of {@link View#FOCUS_UP}, {@link View#FOCUS_DOWN}, {@link View#FOCUS_LEFT}, {@link View#FOCUS_RIGHT}, {@link View#FOCUS_FORWARD} or {@link View#FOCUS_BACKWARD}
return
The appropriate sonification constant.


                                               
         
        switch (direction) {
            case View.FOCUS_RIGHT:
                return SoundEffectConstants.NAVIGATION_RIGHT;
            case View.FOCUS_FORWARD:
            case View.FOCUS_DOWN:
                return SoundEffectConstants.NAVIGATION_DOWN;
            case View.FOCUS_LEFT:
                return SoundEffectConstants.NAVIGATION_LEFT;
            case View.FOCUS_BACKWARD:
            case View.FOCUS_UP:
                return SoundEffectConstants.NAVIGATION_UP;
        }
        throw new IllegalArgumentException("direction must be one of "
                + "{FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_FORWARD, FOCUS_BACKWARD}.");