Added in API level 1

SoundEffectConstants


open class SoundEffectConstants
kotlin.Any
   ↳ android.view.SoundEffectConstants

Constants to be used to play sound effects via View#playSoundEffect(int)

Summary

Constants
static Int

static Int

Effect id for a navigation down

static Int

Effect id for a navigation left

static Int

Effect id for a repeatedly triggered navigation down, e.

static Int

Effect id for a repeatedly triggered navigation left, e.

static Int

Effect id for a repeatedly triggered navigation right, e.

static Int

Effect id for a repeatedly triggered navigation up, e.

static Int

Effect id for a navigation right

static Int

Effect id for a navigation up

Public methods
open static Int
getConstantForFocusDirection(direction: Int, repeating: Boolean)

Get the sonification constant for the focus directions

open static Int

Get the sonification constant for the focus directions.

Constants

CLICK

Added in API level 1
static val CLICK: Int
Value: 0
Added in API level 1
static val NAVIGATION_DOWN: Int

Effect id for a navigation down

Value: 4
Added in API level 1
static val NAVIGATION_LEFT: Int

Effect id for a navigation left

Value: 1
Added in API level 31
static val NAVIGATION_REPEAT_DOWN: Int

Effect id for a repeatedly triggered navigation down, e.g. due to long pressing a button

Value: 8
Added in API level 31
static val NAVIGATION_REPEAT_LEFT: Int

Effect id for a repeatedly triggered navigation left, e.g. due to long pressing a button

Value: 5
Added in API level 31
static val NAVIGATION_REPEAT_RIGHT: Int

Effect id for a repeatedly triggered navigation right, e.g. due to long pressing a button

Value: 7
Added in API level 31
static val NAVIGATION_REPEAT_UP: Int

Effect id for a repeatedly triggered navigation up, e.g. due to long pressing a button

Value: 6
Added in API level 1
static val NAVIGATION_RIGHT: Int

Effect id for a navigation right

Value: 3
Added in API level 1
static val NAVIGATION_UP: Int

Effect id for a navigation up

Value: 2

Public methods

getConstantForFocusDirection

Added in API level 31
open static fun getConstantForFocusDirection(
    direction: Int,
    repeating: Boolean
): Int

Get the sonification constant for the focus directions

Parameters
direction Int: The direction of the focus. Value is android.view.View#FOCUS_BACKWARD, android.view.View#FOCUS_FORWARD, android.view.View#FOCUS_LEFT, android.view.View#FOCUS_UP, android.view.View#FOCUS_RIGHT, or android.view.View#FOCUS_DOWN
repeating Boolean: True if the user long-presses a direction
Return
Int The appropriate sonification constant Value is android.view.SoundEffectConstants#NAVIGATION_LEFT, android.view.SoundEffectConstants#NAVIGATION_UP, android.view.SoundEffectConstants#NAVIGATION_RIGHT, android.view.SoundEffectConstants#NAVIGATION_DOWN, android.view.SoundEffectConstants#NAVIGATION_REPEAT_LEFT, android.view.SoundEffectConstants#NAVIGATION_REPEAT_UP, android.view.SoundEffectConstants#NAVIGATION_REPEAT_RIGHT, or android.view.SoundEffectConstants#NAVIGATION_REPEAT_DOWN
Exceptions
java.lang.IllegalArgumentException when the passed direction is not one of the documented values.

getContantForFocusDirection

Added in API level 1
open static fun getContantForFocusDirection(direction: Int): Int

Get the sonification constant for the focus directions.

Parameters
direction Int: The direction of the focus. Value is android.view.View#FOCUS_BACKWARD, android.view.View#FOCUS_FORWARD, android.view.View#FOCUS_LEFT, android.view.View#FOCUS_UP, android.view.View#FOCUS_RIGHT, or android.view.View#FOCUS_DOWN
Return
Int The appropriate sonification constant.
Exceptions
IllegalArgumentException when the passed direction is not one of the documented values.