Package com.zendesk.sdk.support
Class SupportActivity
- java.lang.Object
-
- AppCompatActivity
-
- com.zendesk.sdk.support.SupportActivity
-
- All Implemented Interfaces:
- SupportMvp.View
public class SupportActivity extends AppCompatActivity implements SupportMvp.View
This Activity is the main entry point for showing Help Center content in the SDK.This Activity is designed to be started with the
SupportActivity.Builder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classSupportActivity.BuilderThis builder is used to generate the startup configuration for the Activity.
-
Constructor Summary
Constructors Constructor and Description SupportActivity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearSearchResults()Clears any currently shown search results from the view.voiddismissError()Dismiss the error Snackbar if it is currently displayed.voidexitActivity()Exits the activity immediatelyContextgetContext()Gets the View's context.voidhideLoadingState()Hides the loading statebooleanisShowingHelp()Tells whether the view is currently showing the Help Center, or Search results.protected voidonCreate(Bundle savedInstanceState)booleanonCreateOptionsMenu(Menu menu)booleanonOptionsItemSelected(MenuItem item)protected voidonPause()booleanonPrepareOptionsMenu(Menu menu)protected voidonResume()protected voidonSaveInstanceState(Bundle outState)voidshowContactUsButton()Shows the contact us button as a FABvoidshowContactZendesk()Shows the contact Zendesk componentvoidshowError(int errorMessageId)Shows a Snackbar with an error messagevoidshowErrorWithRetry(SupportMvp.ErrorType errorType, RetryAction action)Shows a snackbar with an error message and a retry actionvoidshowHelp(SupportUiConfig supportUiConfig)Shows Help for the given SDK UI configuration.voidshowLoadingState()Shows a loading statevoidshowRequestList()Shows the list of requests that the user has createdvoidshowSearchResults(java.util.List<SearchArticle> searchArticles, java.lang.String query)Shows Help search results for the given query text
-
-
-
Method Detail
-
onCreate
protected void onCreate(Bundle savedInstanceState)
-
onResume
protected void onResume()
-
onPause
protected void onPause()
-
onCreateOptionsMenu
public boolean onCreateOptionsMenu(Menu menu)
-
onPrepareOptionsMenu
public boolean onPrepareOptionsMenu(Menu menu)
-
onOptionsItemSelected
public boolean onOptionsItemSelected(MenuItem item)
-
showContactUsButton
public void showContactUsButton()
Description copied from interface:SupportMvp.ViewShows the contact us button as a FAB- Specified by:
showContactUsButtonin interfaceSupportMvp.View
-
showHelp
public void showHelp(SupportUiConfig supportUiConfig)
Description copied from interface:SupportMvp.ViewShows Help for the given SDK UI configuration.- Specified by:
showHelpin interfaceSupportMvp.View- Parameters:
supportUiConfig- The SupportUiConfig containing the category and section IDs, label names, and configuration flags to be used in displaying the UI.
-
showLoadingState
public void showLoadingState()
Description copied from interface:SupportMvp.ViewShows a loading state- Specified by:
showLoadingStatein interfaceSupportMvp.View
-
hideLoadingState
public void hideLoadingState()
Description copied from interface:SupportMvp.ViewHides the loading state- Specified by:
hideLoadingStatein interfaceSupportMvp.View
-
showSearchResults
public void showSearchResults(java.util.List<SearchArticle> searchArticles, java.lang.String query)
Description copied from interface:SupportMvp.ViewShows Help search results for the given query text- Specified by:
showSearchResultsin interfaceSupportMvp.View- Parameters:
searchArticles- The List of articles returned for the searchquery- The query text that was used in the search
-
clearSearchResults
public void clearSearchResults()
Description copied from interface:SupportMvp.ViewClears any currently shown search results from the view.- Specified by:
clearSearchResultsin interfaceSupportMvp.View
-
isShowingHelp
public boolean isShowingHelp()
Description copied from interface:SupportMvp.ViewTells whether the view is currently showing the Help Center, or Search results. While this is the kind of logical decision normally calculated by the presenter, in this case, with state changes etc, the view is the ultimate source of truth.- Specified by:
isShowingHelpin interfaceSupportMvp.View- Returns:
- true if the currently displayed view is the Help Center, false if it's search results.
-
showRequestList
public void showRequestList()
Description copied from interface:SupportMvp.ViewShows the list of requests that the user has created- Specified by:
showRequestListin interfaceSupportMvp.View
-
showContactZendesk
public void showContactZendesk()
Description copied from interface:SupportMvp.ViewShows the contact Zendesk component- Specified by:
showContactZendeskin interfaceSupportMvp.View
-
showErrorWithRetry
public void showErrorWithRetry(SupportMvp.ErrorType errorType, RetryAction action)
Description copied from interface:SupportMvp.ViewShows a snackbar with an error message and a retry action- Specified by:
showErrorWithRetryin interfaceSupportMvp.View- Parameters:
errorType- The type of error to display a message foraction- The retry action to perform
-
showError
public void showError(int errorMessageId)
Description copied from interface:SupportMvp.ViewShows a Snackbar with an error message- Specified by:
showErrorin interfaceSupportMvp.View- Parameters:
errorMessageId- The string resource ID to display
-
dismissError
public void dismissError()
Description copied from interface:SupportMvp.ViewDismiss the error Snackbar if it is currently displayed.- Specified by:
dismissErrorin interfaceSupportMvp.View
-
getContext
public Context getContext()
Description copied from interface:SupportMvp.ViewGets the View's context.- Specified by:
getContextin interfaceSupportMvp.View- Returns:
- The Context of the View implementation.
-
onSaveInstanceState
protected void onSaveInstanceState(Bundle outState)
-
exitActivity
public void exitActivity()
Description copied from interface:SupportMvp.ViewExits the activity immediately- Specified by:
exitActivityin interfaceSupportMvp.View
-
-