Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class SoftButtonObject

Hierarchy

java.lang.Object

Package
com.smartdevicelink.managers.screen

Overview

SoftButtonObject
SoftButtonObject define a button that can have multiple SoftButtonState values.
The states of SoftButtonObject allow the developer to not have to manage multiple SoftButtons that have very similar functionality.
For example, a repeat button in a music app can be thought of as one SoftButtonObject with three typical states: repeat off, repeat 1, and repeat on.

Constructors

SoftButtonObject( String name, java.util.List<com.smartdevicelink.managers.screen.SoftButtonState> states, String initialStateName, SoftButtonObject.OnEventListener onEventListener )

Create a new instance of the SoftButtonObject with multiple states

public SoftButtonObject(String name,java.util.List<com.smartdevicelink.managers.screen.SoftButtonState> states,String initialStateName,SoftButtonObject.OnEventListener onEventListener)

Parameters

name
a String value represents name of the object
states
a list of SoftButtonState represents the SoftButtonState values for the object
initialStateName
a String value represents the name for the initial state
onEventListener
a listener that has a callback that will be triggered when a button event happens Note: the initialStateName should match exactly the name of one of the states for the object. Otherwise an exception will be thrown.

SoftButtonObject( String name, SoftButtonState state, SoftButtonObject.OnEventListener onEventListener )

Create a new instance of the SoftButtonObject with one state

public SoftButtonObject(String name,SoftButtonState state,SoftButtonObject.OnEventListener onEventListener)

Parameters

name
a String value represents name of the object
state
a SoftButtonState represents state for the object
onEventListener
a listener that has a callback that will be triggered when a button event happens

Methods

transitionToStateByName( String newStateName )

Transition the SoftButtonObject to a specific state

public boolean transitionToStateByName(String newStateName)

Parameters

newStateName
a String value represents the name fo the state that we want to transition the SoftButtonObject to

transitionToNextState()

Transition the SoftButtonObject to the next state

public void transitionToNextState()

getCurrentState()

Get the current state for the SoftButtonObject

public com.smartdevicelink.managers.screen.SoftButtonState getCurrentState()

getCurrentStateSoftButton()

Get the SoftButton object for the current state

public com.smartdevicelink.proxy.rpc.SoftButton getCurrentStateSoftButton()

setUpdateListener( SoftButtonObject.UpdateListener updateListener )

Set the SoftButtonManager's update listener

protected void setUpdateListener(SoftButtonObject.UpdateListener updateListener)

Parameters

updateListener
the SoftButtonManager.UpdateListener object

getName()

Get the name of the SoftButtonObject

public java.lang.String getName()

setName( String name )

Set the name of the SoftButtonObject

public void setName(String name)

Parameters

name
a String that represents the name of the SoftButtonObject

getStates()

Get the SoftButtonState list

public java.util.List getStates()

setStates( java.util.List<com.smartdevicelink.managers.screen.SoftButtonState> states )

Set the the SoftButtonState list

public void setStates(java.util.List<com.smartdevicelink.managers.screen.SoftButtonState> states)

Parameters

states
a list of the object's soft button states

getCurrentStateName()

Get the name of the current state

public java.lang.String getCurrentStateName()

setCurrentStateName( String currentStateName )

Set the name of the current state

public void setCurrentStateName(String currentStateName)

Parameters

currentStateName
a String that represents the name of the current state

getButtonId()

Get the dd of the SoftButtonObject

public int getButtonId()

setButtonId( int buttonId )

Set the id of the SoftButtonObject

public void setButtonId(int buttonId)

Parameters

buttonId
an int value that represents the id of the SoftButtonObject

getOnEventListener()

Get the event listener for the SoftButtonObject

public com.smartdevicelink.managers.screen.SoftButtonObject.OnEventListener getOnEventListener()

setOnEventListener( SoftButtonObject.OnEventListener onEventListener )

Set the event listener for the SoftButtonObject

public void setOnEventListener(SoftButtonObject.OnEventListener onEventListener)

Parameters

onEventListener
a listener that has a callback that will be triggered when a button event happens

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section