Class RateMyAppDialog.Builder
- java.lang.Object
-
- com.zendesk.sdk.rating.ui.RateMyAppDialog.Builder
-
- Enclosing class:
- RateMyAppDialog
public static class RateMyAppDialog.Builder extends java.lang.Object
Builder class used to instantiate aRateMyAppDialog
Buttons should be added in the order that you want them to display.
-
-
Constructor Summary
Constructors Constructor and Description Builder(FragmentActivity activity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description RateMyAppDialog
build()
Creates the instance ofRateMyAppDialog
RateMyAppDialog.Builder
withAndroidStoreRatingButton()
Adds a button which will link to an android store when tapped.RateMyAppDialog.Builder
withButton(RateMyAppButton button)
Adds a button which conforms to theRateMyAppButton
interfaceRateMyAppDialog.Builder
withDontRemindMeAgainButton()
Adds a button which will dismiss the dialog and never show it again.RateMyAppDialog.Builder
withOnShowListener(RateMyAppDialog.OnShowListener onShowListener)
Includes anRateMyAppDialog.OnShowListener
which can be used to determine when the dialog has shownRateMyAppDialog.Builder
withRules(RateMyAppRule... rules)
Specifies one or more rules which will govern when theRateMyAppDialog
is permitted to show.RateMyAppDialog.Builder
withSelectionListener(RateMyAppButtonContainer.RateMyAppSelectionListener selectionListener)
Includes aRateMyAppButtonContainer.RateMyAppSelectionListener
which can be used to subscribe to button click events.RateMyAppDialog.Builder
withSendFeedbackButton()
Adds a button which will open a UI where the user can enter feedback.RateMyAppDialog.Builder
withSendFeedbackButton(ZendeskFeedbackConfiguration feedbackConfiguration)
Adds a button which will open a UI where the user can enter feedback.RateMyAppDialog.Builder
withSendFeedbackButton(ZendeskFeedbackConfiguration feedbackConfiguration, SubmissionListener listener)
Adds a button which will open a UI where the user can enter feedback.
-
-
-
Method Detail
-
withButton
public RateMyAppDialog.Builder withButton(RateMyAppButton button)
Adds a button which conforms to theRateMyAppButton
interfaceNote that if the button or the activity supplied in the builder is null then no button will be added.
- Parameters:
button
- The button to add- Returns:
- the builder
-
withAndroidStoreRatingButton
public RateMyAppDialog.Builder withAndroidStoreRatingButton()
Adds a button which will link to an android store when tapped.Note that if the activity supplied in the builder is null then no button will be added. It will also not be added if the server settings did not supply a store URL.
As the android store url will be supplied by the server this could link to Google Play, Amazon etc.
- Returns:
- the builder
-
withDontRemindMeAgainButton
public RateMyAppDialog.Builder withDontRemindMeAgainButton()
Adds a button which will dismiss the dialog and never show it again.Note that if the activity supplied in the builder is null then no button will be added.
- Returns:
- the builder
-
withSendFeedbackButton
public RateMyAppDialog.Builder withSendFeedbackButton()
Adds a button which will open a UI where the user can enter feedback.- Returns:
- the builder
-
withSendFeedbackButton
public RateMyAppDialog.Builder withSendFeedbackButton(ZendeskFeedbackConfiguration feedbackConfiguration)
Adds a button which will open a UI where the user can enter feedback.This overload allows additional configuration to be supplied, which will enhance the feedback.
- Parameters:
feedbackConfiguration
- instance ofZendeskFeedbackConfiguration
used to control the content of the feedback that is sent to Zendesk- Returns:
- the builder
-
withSendFeedbackButton
public RateMyAppDialog.Builder withSendFeedbackButton(ZendeskFeedbackConfiguration feedbackConfiguration, SubmissionListener listener)
Adds a button which will open a UI where the user can enter feedback.This method also allows you to specify a callback to tell when the user has cancelled the feedback dialog and to know when the feedback has been sent.
Note that the button will not be added if the
FeedbackConnector
is null or in an invalid state.- Parameters:
feedbackConfiguration
- instance ofZendeskFeedbackConfiguration
used to control the content of the feedback that is sent to Zendesklistener
- The listener that will be called when the user cancels the dialog or sends feedback. Can also be used to determine other submission lifecycle events- Returns:
- the builder
-
withSelectionListener
public RateMyAppDialog.Builder withSelectionListener(RateMyAppButtonContainer.RateMyAppSelectionListener selectionListener)
Includes aRateMyAppButtonContainer.RateMyAppSelectionListener
which can be used to subscribe to button click events. This can be useful for tracking button clicks.- Parameters:
selectionListener
- The selection listener which the events will be sent to.- Returns:
- the builder
-
withOnShowListener
public RateMyAppDialog.Builder withOnShowListener(RateMyAppDialog.OnShowListener onShowListener)
Includes anRateMyAppDialog.OnShowListener
which can be used to determine when the dialog has shown- Parameters:
onShowListener
- The listener which will receive the event- Returns:
- the builder
-
withRules
public RateMyAppDialog.Builder withRules(RateMyAppRule... rules)
Specifies one or more rules which will govern when theRateMyAppDialog
is permitted to show.A default set of rules will be applied if you don't specify any rules here
- Parameters:
rules
- one or moreRateMyAppRules
- Returns:
- the builder
-
build
public RateMyAppDialog build()
Creates the instance ofRateMyAppDialog
- Returns:
- an instance of the dialog
-
-