Class MaterialTapTargetPrompt


  • public class MaterialTapTargetPrompt
    extends java.lang.Object
    A Material Design tap target onboarding implementation.

    For more information about onboarding and tap targets, read the Onboarding Material Design guidelines.

    • Field Detail

      • STATE_NOT_SHOWN

        public static final int STATE_NOT_SHOWN
        Prompt has yet to be shown.
        See Also:
        Constant Field Values
      • STATE_REVEALING

        public static final int STATE_REVEALING
        Prompt is reveal animation is running.
        See Also:
        Constant Field Values
      • STATE_REVEALED

        public static final int STATE_REVEALED
        Prompt reveal animation has finished and the prompt is displayed.
        See Also:
        Constant Field Values
      • STATE_FOCAL_PRESSED

        public static final int STATE_FOCAL_PRESSED
        The prompt target has been pressed in the focal area.
        See Also:
        Constant Field Values
      • STATE_FINISHED

        public static final int STATE_FINISHED
        The prompt has been removed from view after the prompt has been pressed in the focal area.
        See Also:
        Constant Field Values
      • STATE_DISMISSING

        public static final int STATE_DISMISSING
        The dismiss() method has been called and the prompt is being removed from view.
        See Also:
        Constant Field Values
      • STATE_DISMISSED

        public static final int STATE_DISMISSED
        The prompt has been removed from view after the prompt has either been pressed somewhere other than the prompt target or the system back button has been pressed.
        See Also:
        Constant Field Values
      • STATE_FINISHING

        public static final int STATE_FINISHING
        The finish() method has been called and the prompt is being removed from view.
        See Also:
        Constant Field Values
      • STATE_NON_FOCAL_PRESSED

        public static final int STATE_NON_FOCAL_PRESSED
        The prompt has been pressed outside the focal area.
        See Also:
        Constant Field Values
      • STATE_SHOW_FOR_TIMEOUT

        public static final int STATE_SHOW_FOR_TIMEOUT
        The prompt has been dismissed by the show for timeout.
        See Also:
        Constant Field Values
      • STATE_BACK_BUTTON_PRESSED

        public static final int STATE_BACK_BUTTON_PRESSED
        The prompt has been dismissed by the system back button being pressed.
        See Also:
        Constant Field Values
    • Method Detail

      • show

        public void show()
        Displays the prompt.
      • showFor

        public void showFor​(long millis)
        Displays the prompt for a maximum amount of time.
        Parameters:
        millis - The number of milliseconds to show the prompt for.
      • cancelShowForTimer

        public void cancelShowForTimer()
        Cancel the show for timer if it has been created.
      • finish

        public void finish()
        Removes the prompt from view, using a expand and fade animation.

        This is treated as if the user has touched the target focal point.

      • dismiss

        public void dismiss()
        Removes the prompt from view, using a contract and fade animation.

        This is treated as if the user has touched outside the target focal point.

      • onPromptStateChanged

        protected void onPromptStateChanged​(int state)
        Handles emitting the prompt state changed events.
        Parameters:
        state - The state that the prompt is now in.
      • createDefault

        @NonNull
        public static MaterialTapTargetPrompt createDefault​(@NonNull
                                                            PromptOptions promptOptions)
        Creates a prompt with the supplied options.
        Parameters:
        promptOptions - The options to use to create the prompt.
        Returns:
        The created prompt.