Class MaterialTapTargetSequence
java.lang.Object
uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetSequence
public class MaterialTapTargetSequence
extends java.lang.Object
A Sequence of prompts to be shown one after another
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MaterialTapTargetSequence.SequenceCompleteListener
Interface definition for a callback to be invoked when a sequence completes. -
Constructor Summary
Constructors Constructor Description MaterialTapTargetSequence()
-
Method Summary
Modifier and Type Method Description MaterialTapTargetSequence
addPrompt(PromptOptions promptOptions)
Add a prompt to the end of the sequence.MaterialTapTargetSequence
addPrompt(PromptOptions promptOptions, long milliseconds)
Add a show for time prompt to the end of the sequence.MaterialTapTargetSequence
addPrompt(SequenceItem item)
Adds a sequence item to the end of the sequence.MaterialTapTargetSequence
addPrompt(MaterialTapTargetPrompt prompt)
Add a prompt to the end of the sequence.MaterialTapTargetSequence
addPrompt(MaterialTapTargetPrompt prompt, long milliseconds)
Add a show for time prompt to the end of the sequence.MaterialTapTargetSequence
dismiss()
Removes the currently displayed prompt in the sequence from view using the dismiss action and stops the sequence from continuing.MaterialTapTargetSequence
finish()
Removes the currently displayed prompt in the sequence from view using the finish action and stops the sequence from continuing.SequenceItem
get(int index)
Gets a prompt at a position in this sequence.MaterialTapTargetSequence
setSequenceCompleteListener(MaterialTapTargetSequence.SequenceCompleteListener listener)
Set the listener to listen with the action to call when the sequence endsMaterialTapTargetSequence
show()
Start the sequence by showing the first prompt.MaterialTapTargetSequence
showFromIndex(int index)
Shows or continues to show this sequence from the prompt at the index supplied.int
size()
Get the number of prompts in this sequence.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MaterialTapTargetSequence
public MaterialTapTargetSequence()
-
-
Method Details
-
setSequenceCompleteListener
@NonNull public MaterialTapTargetSequence setSequenceCompleteListener(@Nullable MaterialTapTargetSequence.SequenceCompleteListener listener)Set the listener to listen with the action to call when the sequence ends- Parameters:
listener
- the listener with the action to execute
-
addPrompt
Add a prompt to the end of the sequence.- Parameters:
prompt
- The prompt to add.
-
addPrompt
@NonNull public MaterialTapTargetSequence addPrompt(@Nullable MaterialTapTargetPrompt prompt, long milliseconds)Add a show for time prompt to the end of the sequence.- Parameters:
prompt
- The prompt to add.milliseconds
- The number of milliseconds to show the prompt for.- Returns:
- This.
-
addPrompt
Add a prompt to the end of the sequence.- Parameters:
promptOptions
- The prompt to add.- Returns:
- This.
-
addPrompt
@NonNull public MaterialTapTargetSequence addPrompt(@NonNull PromptOptions promptOptions, long milliseconds)Add a show for time prompt to the end of the sequence.- Parameters:
promptOptions
- The prompt to add.milliseconds
- The number of milliseconds to show the prompt for.- Returns:
- This.
-
addPrompt
Adds a sequence item to the end of the sequence. This sequence item must have state changers added to it by callingSequenceItem.addStateChanger(int)
.- Parameters:
item
- The already created sequence item to add.- Returns:
- This.
-
size
public int size()Get the number of prompts in this sequence.- Returns:
- The number of prompts in this sequence.
-
get
Gets a prompt at a position in this sequence.- Parameters:
index
- The prompt 0 based index.- Returns:
- The prompt at the specified position in this sequence.
-
show
Start the sequence by showing the first prompt.- Returns:
- This.
-
finish
Removes the currently displayed prompt in the sequence from view using the finish action and stops the sequence from continuing.- Returns:
- This.
-
dismiss
Removes the currently displayed prompt in the sequence from view using the dismiss action and stops the sequence from continuing.- Returns:
- This.
-
showFromIndex
Shows or continues to show this sequence from the prompt at the index supplied.- Parameters:
index
- The index to show from.- Returns:
- This.
-