Interface IView3
interface IView3
Extends IView2
This interface extends IView2 with additional functionalities to
manage sound effects for this view.
Like its predecessors IView2 and IView, all methods of this
interface must be called from the UI thread.
Methods
areSoundEffectsEnabled()
bool areSoundEffectsEnabled()
Checks whether sound effects are enabled for this view.
Sound effects are enabled by default, unless explicitly disabled through
IView3::setSoundEffectsEnabled.
This setting only affects this view instance.
Returns
bool
true if sound effects are enabled
setSoundEffectsEnabled()
Enable or disable sound effects for this view. When enabled, this view can play sound for appropriate events like selections, clicks etc. Sound playback also requires the system-wide sound settings to be enabled apart from this view specific setting. Sound effects are enabled by default for any view. IMPORTANT: Even when sound effects are disabled for a view, if focus management is handled by the UI stack, sounds may still be heard during navigation as those sounds are played by the focus management system, not by the individual view.voidsetSoundEffectsEnabled(boolenabled)
Parameters
enabled
bool — Required
true to enable sound effect, false to disable it
playSoundEffect()
Plays a predefined sound effect. The sound effect plays only if both system-wide sound effect and this view’s sound effect are enabled. RefervoidplaySoundEffect(SoundEffecteffect)
IView3::setSoundEffectsEnabled.
Parameters
effect
SoundEffect — Required
the sound effect to play
Throws
NotSupportedError— if the effect is not supported. ReferSoundEffectInvalidArgumentError— if the sound effect is not supported by the current theme

