Package zendesk.messaging
Class MessagingConfiguration.Builder
- java.lang.Object
-
- zendesk.messaging.MessagingConfiguration.Builder
-
- Enclosing class:
- MessagingConfiguration
public static class MessagingConfiguration.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Configuration
config(Context context)
Create aConfiguration
for the passed in configuration options.Intent
intent(Context context, Configuration... configurations)
Create anIntent
to start theMessagingActivity
with the specified configuration options.Intent
intent(Context context, java.util.List<Configuration> configurations)
Create anIntent
to start theMessagingActivity
with the specified configuration options.void
show(Context context, Configuration... configurations)
DisplayMessagingActivity
to the user.void
show(Context context, java.util.List<Configuration> configurations)
DisplayMessagingActivity
to the user.MessagingConfiguration.Builder
withBotAvatarDrawable(int avatarDrawableId)
Specify the Drawable resource to use as the avatar for Bots on the conversation interface.MessagingConfiguration.Builder
withBotLabelString(java.lang.String botLabelString)
Specify the String to use as the label displayed on Bot messages in the conversation interface.MessagingConfiguration.Builder
withBotLabelStringRes(int stringResourceId)
Specify the String resource to use as the label displayed on Bot messages in the conversation interface.MessagingConfiguration.Builder
withEngines(Engine... engines)
Specify a list of product specificEngine
s.MessagingConfiguration.Builder
withEngines(java.util.List engines)
Specify a list of product specificEngine
s.MessagingConfiguration.Builder
withMultilineResponseOptionsEnabled(boolean multilineResponseOptionsEnabled)
Specify whether to enable text wrapping for quick replies in the conversation interface.MessagingConfiguration.Builder
withToolbarTitle(java.lang.String toolbarTitle)
Specify the String to use as the title of the screen in the conversation interface.MessagingConfiguration.Builder
withToolbarTitleRes(int stringResourceId)
Specify the String to use as the title of the screen in the conversation interface.
-
-
-
Method Detail
-
withEngines
public MessagingConfiguration.Builder withEngines(java.util.List engines)
Specify a list of product specificEngine
s.- Parameters:
engines
- a list of engines- Returns:
- the builder
-
withEngines
public MessagingConfiguration.Builder withEngines(Engine... engines)
Specify a list of product specificEngine
s.- Parameters:
engines
- a list of engines- Returns:
- the builder
-
withToolbarTitleRes
public MessagingConfiguration.Builder withToolbarTitleRes(int stringResourceId)
Specify the String to use as the title of the screen in the conversation interface. This is "Contact us" by default.If both this and #withToolbarTitle() are provided, the value passed to #withToolbarTitle takes precedence
- Parameters:
stringResourceId
- the String resource ID to be used as the title for the conversation screen- Returns:
- the builder
-
withToolbarTitle
public MessagingConfiguration.Builder withToolbarTitle(java.lang.String toolbarTitle)
Specify the String to use as the title of the screen in the conversation interface.If both this and #withToolbarTitleRes() are provided, this takes precedence
- Parameters:
toolbarTitle
- the String to be used as the label for Bot messages- Returns:
- the builder
-
withBotLabelStringRes
public MessagingConfiguration.Builder withBotLabelStringRes(int stringResourceId)
Specify the String resource to use as the label displayed on Bot messages in the conversation interface. This is "Answer Bot" by default.If both this and #withBotLabelString() are provided, the value passed to #withBotLabelString takes precedence
- Parameters:
stringResourceId
- the String resource ID to be used as the label for Bot messages- Returns:
- the builder
-
withBotLabelString
public MessagingConfiguration.Builder withBotLabelString(java.lang.String botLabelString)
Specify the String to use as the label displayed on Bot messages in the conversation interface.If both this and #withBotLabelStringRes() are provided, this takes precedence
- Parameters:
botLabelString
- the String to be used as the label for Bot messages- Returns:
- the builder
-
withBotAvatarDrawable
public MessagingConfiguration.Builder withBotAvatarDrawable(int avatarDrawableId)
Specify the Drawable resource to use as the avatar for Bots on the conversation interface. This is the Answer Bot logo by default.- Parameters:
avatarDrawableId
- the Drawable resource ID to be used as the avatar for Bots in the conversation interface.- Returns:
- the builder
-
withMultilineResponseOptionsEnabled
public MessagingConfiguration.Builder withMultilineResponseOptionsEnabled(boolean multilineResponseOptionsEnabled)
Specify whether to enable text wrapping for quick replies in the conversation interface. If this is enabled (true), quick replies will wrap so that they will all be on screen at once, if it is disabled (false) they will show as a single horizontally scrollable line. Defaults to disabled (false).- Parameters:
multilineResponseOptionsEnabled
- the flag for whether to enable quick reply text wrapping- Returns:
- the builder
-
show
public void show(Context context, Configuration... configurations)
DisplayMessagingActivity
to the user.- Parameters:
context
- The context whichstartActivity
will be invoked on.configurations
- Configurations for other Zendesk SDK activities that can be started from ChatActivity.
-
show
public void show(Context context, java.util.List<Configuration> configurations)
DisplayMessagingActivity
to the user.- Parameters:
context
- The context whichstartActivity
will be invoked on.configurations
- Configurations for other Zendesk SDK activities that can be started from ChatActivity.
-
config
public Configuration config(Context context)
Create aConfiguration
for the passed in configuration options.
-
intent
public Intent intent(Context context, Configuration... configurations)
Create anIntent
to start theMessagingActivity
with the specified configuration options.- Parameters:
context
- The context whichstartActivity
will be invoked on.configurations
- Configurations for screen that can be started from ChatActivity.- Returns:
- An
Intent
forMessagingActivity
with the specified configuration options.
-
intent
public Intent intent(Context context, java.util.List<Configuration> configurations)
Create anIntent
to start theMessagingActivity
with the specified configuration options.- Parameters:
context
- The context whichstartActivity
will be invoked on.configurations
- Configurations for screen that can be started from ChatActivity.- Returns:
- An
Intent
forMessagingActivity
with the specified configuration options.
-
-