Package org.mozilla.geckoview
Class GeckoSession.PromptDelegate.ChoicePrompt
Object
org.mozilla.geckoview.GeckoSession.PromptDelegate.BasePrompt
org.mozilla.geckoview.GeckoSession.PromptDelegate.ChoicePrompt
- Enclosing interface:
- GeckoSession.PromptDelegate
public static class GeckoSession.PromptDelegate.ChoicePrompt
extends GeckoSession.PromptDelegate.BasePrompt
ChoicePrompt contains the information necessary to display a menu or list prompt generated by
content.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefines one selectable element in a ChoicePrompt.static @interfaceChoice type definitions for selection prompts.static classChoice prompt types definitions.Nested classes/interfaces inherited from class org.mozilla.geckoview.GeckoSession.PromptDelegate.BasePrompt
GeckoSession.PromptDelegate.BasePrompt.Observer -
Field Summary
FieldsModifier and TypeFieldDescriptionAn array ofGeckoSession.PromptDelegate.ChoicePrompt.Choicerepresenting possible choices.final StringThe message to be displayed with this prompt; may be null.final intFields inherited from class org.mozilla.geckoview.GeckoSession.PromptDelegate.BasePrompt
title -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedChoicePrompt(String id, String title, String message, int type, GeckoSession.PromptDelegate.ChoicePrompt.Choice[] choices, GeckoSession.PromptDelegate.BasePrompt.Observer observer) Constructs a ChoicePrompt with the specified message, type, and choices. -
Method Summary
Modifier and TypeMethodDescriptionConfirms this prompt with the string id of a single choice.Confirms this prompt with the string ids of multiple choicesconfirm(GeckoSession.PromptDelegate.ChoicePrompt.Choice selectedChoice) Confirms this prompt with a single choice.confirm(GeckoSession.PromptDelegate.ChoicePrompt.Choice[] selectedChoices) Confirms this prompt with multiple choices.Methods inherited from class org.mozilla.geckoview.GeckoSession.PromptDelegate.BasePrompt
confirm, dismiss, getDelegate, isComplete, setDelegate
-
Field Details
-
message
The message to be displayed with this prompt; may be null. -
type
public final int type -
choices
An array ofGeckoSession.PromptDelegate.ChoicePrompt.Choicerepresenting possible choices.
-
-
Constructor Details
-
ChoicePrompt
protected ChoicePrompt(@NonNull String id, @Nullable String title, @Nullable String message, int type, @NonNull GeckoSession.PromptDelegate.ChoicePrompt.Choice[] choices, @NonNull GeckoSession.PromptDelegate.BasePrompt.Observer observer) Constructs a ChoicePrompt with the specified message, type, and choices.- Parameters:
id- the unique identifier for this prompttitle- optional title text for the prompt; may be nullmessage- the message to be displayed with this prompt; may be nulltype- the choice prompt type (menu, single, or multiple)choices- the array of Choice objects representing possible selectionsobserver- the observer to notify when the prompt is completed
-
-
Method Details
-
confirm
@UiThread @NonNull public GeckoSession.PromptDelegate.PromptResponse confirm(@NonNull String selectedId) Confirms this prompt with the string id of a single choice.- Parameters:
selectedId- The string ID of the selected choice.- Returns:
- A
GeckoSession.PromptDelegate.PromptResponsewhich can be used to complete theGeckoResultassociated with this prompt.
-
confirm
@UiThread @NonNull public GeckoSession.PromptDelegate.PromptResponse confirm(@NonNull String[] selectedIds) Confirms this prompt with the string ids of multiple choices- Parameters:
selectedIds- The string IDs of the selected choices.- Returns:
- A
GeckoSession.PromptDelegate.PromptResponsewhich can be used to complete theGeckoResultassociated with this prompt.
-
confirm
@UiThread @NonNull public GeckoSession.PromptDelegate.PromptResponse confirm(@NonNull GeckoSession.PromptDelegate.ChoicePrompt.Choice selectedChoice) Confirms this prompt with a single choice.- Parameters:
selectedChoice- The selected choice.- Returns:
- A
GeckoSession.PromptDelegate.PromptResponsewhich can be used to complete theGeckoResultassociated with this prompt.
-
confirm
@UiThread @NonNull public GeckoSession.PromptDelegate.PromptResponse confirm(@NonNull GeckoSession.PromptDelegate.ChoicePrompt.Choice[] selectedChoices) Confirms this prompt with multiple choices.- Parameters:
selectedChoices- The selected choices.- Returns:
- A
GeckoSession.PromptDelegate.PromptResponsewhich can be used to complete theGeckoResultassociated with this prompt.
-