Class SequenceItem
java.lang.Object
uk.co.samuelwall.materialtaptargetprompt.extras.sequence.SequenceItem
- All Implemented Interfaces:
MaterialTapTargetPrompt.PromptStateChangeListener
- Direct Known Subclasses:
SequenceItemShowFor
public class SequenceItem extends java.lang.Object implements MaterialTapTargetPrompt.PromptStateChangeListener
Represents a prompt to display in a sequence.
-
Constructor Summary
Constructors Constructor Description SequenceItem(SequenceState state)
Constructor. -
Method Summary
Modifier and Type Method Description void
addStateChanger(int state)
Add a state that will trigger the sequence to move on.void
clearStateChangers()
Remove all state changers.void
dismiss()
CallsMaterialTapTargetPrompt.dismiss()
on this items states prompt.void
finish()
CallsMaterialTapTargetPrompt.finish()
on this items states prompt.SequenceState
getState()
Get the prompt state that this sequence item uses.protected void
onItemComplete()
Emits theMaterialTapTargetSequence.SequenceCompleteListener.onSequenceComplete()
event if the listener is set.void
onPromptStateChanged(MaterialTapTargetPrompt prompt, int state)
Called when the prompts state changes.void
removeStateChanger(int state)
Remove a specific state changer.void
setSequenceListener(MaterialTapTargetSequence.SequenceCompleteListener listener)
Set the listener for this sequence item completing.void
show()
Show this sequence item.protected void
show(MaterialTapTargetPrompt prompt)
Show the created prompt for this sequence item.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SequenceItem
Constructor.- Parameters:
state
- The prompt that this item will show.
-
-
Method Details
-
addStateChanger
public void addStateChanger(int state)Add a state that will trigger the sequence to move on.- Parameters:
state
- The state that triggers the sequence to move on.- See Also:
MaterialTapTargetPrompt.STATE_REVEALING
,MaterialTapTargetPrompt.STATE_REVEALED
,MaterialTapTargetPrompt.STATE_FOCAL_PRESSED
,MaterialTapTargetPrompt.STATE_FINISHING
,MaterialTapTargetPrompt.STATE_FINISHED
,MaterialTapTargetPrompt.STATE_NON_FOCAL_PRESSED
,MaterialTapTargetPrompt.STATE_DISMISSING
,MaterialTapTargetPrompt.STATE_DISMISSED
-
removeStateChanger
public void removeStateChanger(int state)Remove a specific state changer.- Parameters:
state
- The state to remove.- See Also:
MaterialTapTargetPrompt.STATE_REVEALING
,MaterialTapTargetPrompt.STATE_REVEALED
,MaterialTapTargetPrompt.STATE_FOCAL_PRESSED
,MaterialTapTargetPrompt.STATE_FINISHING
,MaterialTapTargetPrompt.STATE_FINISHED
,MaterialTapTargetPrompt.STATE_NON_FOCAL_PRESSED
,MaterialTapTargetPrompt.STATE_DISMISSING
,MaterialTapTargetPrompt.STATE_DISMISSED
-
clearStateChangers
public void clearStateChangers()Remove all state changers. -
setSequenceListener
public void setSequenceListener(@Nullable MaterialTapTargetSequence.SequenceCompleteListener listener)Set the listener for this sequence item completing.- Parameters:
listener
- The item finish listener.
-
getState
Get the prompt state that this sequence item uses.- Returns:
- The prompt state.
-
show
public void show()Show this sequence item. -
finish
public void finish()CallsMaterialTapTargetPrompt.finish()
on this items states prompt. -
dismiss
public void dismiss()CallsMaterialTapTargetPrompt.dismiss()
on this items states prompt. -
show
Show the created prompt for this sequence item.- Parameters:
prompt
- The prompt to show, this will never be null here.
-
onPromptStateChanged
Description copied from interface:MaterialTapTargetPrompt.PromptStateChangeListener
Called when the prompts state changes.- Specified by:
onPromptStateChanged
in interfaceMaterialTapTargetPrompt.PromptStateChangeListener
- Parameters:
prompt
- The prompt which state has changed.state
- can be eitherMaterialTapTargetPrompt.STATE_REVEALING
,MaterialTapTargetPrompt.STATE_REVEALED
,MaterialTapTargetPrompt.STATE_FOCAL_PRESSED
,MaterialTapTargetPrompt.STATE_FINISHED
,MaterialTapTargetPrompt.STATE_DISMISSING
,MaterialTapTargetPrompt.STATE_DISMISSED
-
onItemComplete
protected void onItemComplete()Emits theMaterialTapTargetSequence.SequenceCompleteListener.onSequenceComplete()
event if the listener is set.
-