Package zendesk.support.guide
Class HelpCenterActivity
- java.lang.Object
-
- AppCompatActivity
-
- zendesk.support.guide.HelpCenterActivity
-
- All Implemented Interfaces:
- zendesk.support.guide.HelpCenterMvp.View
public class HelpCenterActivity extends AppCompatActivity implements zendesk.support.guide.HelpCenterMvp.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
HelpCenterActivity.builder()
-
-
Constructor Summary
Constructors Constructor and Description HelpCenterActivity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
announceContentLoaded()
Announce that the content has loaded, for accessibility purposes.static HelpCenterUiConfig.Builder
builder()
Create a new builder for HelpCenterActivity.void
clearSearchResults()
Clears any currently shown search results from the view.void
dismissError()
Dismiss the error Snackbar if it is currently displayed.void
exitActivity()
Exits the activity immediatelyContext
getContext()
Gets the View's context.void
hideLoadingState()
Hides the loading stateboolean
isShowingHelp()
Tells whether the view is currently showing the Help Center, or Search results.protected void
onCreate(Bundle savedInstanceState)
boolean
onCreateOptionsMenu(Menu menu)
boolean
onOptionsItemSelected(MenuItem item)
protected void
onPause()
boolean
onPrepareOptionsMenu(Menu menu)
protected void
onResume()
void
showContactUsButton()
Shows the contact us button as a FABvoid
showContactZendesk()
Shows the contact Zendesk componentvoid
showError(int errorMessageId)
Shows a Snackbar with an error messagevoid
showErrorWithRetry(zendesk.support.guide.HelpCenterMvp.ErrorType errorType, RetryAction action)
Shows a snackbar with an error message and a retry actionvoid
showHelp(HelpCenterUiConfig helpCenterUiConfig)
Shows Help for the given SDK UI configuration.void
showLoadingState()
Shows a loading statevoid
showRequestList()
Shows the list of requests that the user has createdvoid
showSearchResults(java.util.List<SearchArticle> searchArticles, java.lang.String query)
Shows Help search results for the given query text
-
-
-
Method Detail
-
builder
public static HelpCenterUiConfig.Builder builder()
Create a new builder for HelpCenterActivity.
-
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:zendesk.support.guide.HelpCenterMvp.View
Shows the contact us button as a FAB- Specified by:
showContactUsButton
in interfacezendesk.support.guide.HelpCenterMvp.View
-
showHelp
public void showHelp(HelpCenterUiConfig helpCenterUiConfig)
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Shows Help for the given SDK UI configuration.- Specified by:
showHelp
in interfacezendesk.support.guide.HelpCenterMvp.View
- Parameters:
helpCenterUiConfig
- The HelpCenterUiConfig 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:zendesk.support.guide.HelpCenterMvp.View
Shows a loading state- Specified by:
showLoadingState
in interfacezendesk.support.guide.HelpCenterMvp.View
-
hideLoadingState
public void hideLoadingState()
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Hides the loading state- Specified by:
hideLoadingState
in interfacezendesk.support.guide.HelpCenterMvp.View
-
showSearchResults
public void showSearchResults(java.util.List<SearchArticle> searchArticles, java.lang.String query)
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Shows Help search results for the given query text- Specified by:
showSearchResults
in interfacezendesk.support.guide.HelpCenterMvp.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:zendesk.support.guide.HelpCenterMvp.View
Clears any currently shown search results from the view.- Specified by:
clearSearchResults
in interfacezendesk.support.guide.HelpCenterMvp.View
-
isShowingHelp
public boolean isShowingHelp()
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Tells 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:
isShowingHelp
in interfacezendesk.support.guide.HelpCenterMvp.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:zendesk.support.guide.HelpCenterMvp.View
Shows the list of requests that the user has created- Specified by:
showRequestList
in interfacezendesk.support.guide.HelpCenterMvp.View
-
showContactZendesk
public void showContactZendesk()
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Shows the contact Zendesk component- Specified by:
showContactZendesk
in interfacezendesk.support.guide.HelpCenterMvp.View
-
showErrorWithRetry
public void showErrorWithRetry(zendesk.support.guide.HelpCenterMvp.ErrorType errorType, RetryAction action)
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Shows a snackbar with an error message and a retry action- Specified by:
showErrorWithRetry
in interfacezendesk.support.guide.HelpCenterMvp.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:zendesk.support.guide.HelpCenterMvp.View
Shows a Snackbar with an error message- Specified by:
showError
in interfacezendesk.support.guide.HelpCenterMvp.View
- Parameters:
errorMessageId
- The string resource ID to display
-
dismissError
public void dismissError()
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Dismiss the error Snackbar if it is currently displayed.- Specified by:
dismissError
in interfacezendesk.support.guide.HelpCenterMvp.View
-
getContext
public Context getContext()
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Gets the View's context.- Specified by:
getContext
in interfacezendesk.support.guide.HelpCenterMvp.View
- Returns:
- The Context of the View implementation.
-
exitActivity
public void exitActivity()
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Exits the activity immediately- Specified by:
exitActivity
in interfacezendesk.support.guide.HelpCenterMvp.View
-
announceContentLoaded
public void announceContentLoaded()
Description copied from interface:zendesk.support.guide.HelpCenterMvp.View
Announce that the content has loaded, for accessibility purposes.- Specified by:
announceContentLoaded
in interfacezendesk.support.guide.HelpCenterMvp.View
-
-