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
  • 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

      @NonNull public MaterialTapTargetSequence addPrompt​(@Nullable MaterialTapTargetPrompt prompt)
      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

      @NonNull public MaterialTapTargetSequence addPrompt​(@NonNull PromptOptions promptOptions)
      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

      @NonNull public MaterialTapTargetSequence addPrompt​(@NonNull SequenceItem item)
      Adds a sequence item to the end of the sequence. This sequence item must have state changers added to it by calling SequenceItem.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

      @NonNull public SequenceItem get​(int index)
      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

      @NonNull public MaterialTapTargetSequence show()
      Start the sequence by showing the first prompt.
      Returns:
      This.
    • finish

      @NonNull public MaterialTapTargetSequence finish()
      Removes the currently displayed prompt in the sequence from view using the finish action and stops the sequence from continuing.
      Returns:
      This.
    • dismiss

      @NonNull public MaterialTapTargetSequence dismiss()
      Removes the currently displayed prompt in the sequence from view using the dismiss action and stops the sequence from continuing.
      Returns:
      This.
    • showFromIndex

      @NonNull public MaterialTapTargetSequence showFromIndex​(int index)
      Shows or continues to show this sequence from the prompt at the index supplied.
      Parameters:
      index - The index to show from.
      Returns:
      This.