Home screen
Shake enables you to customize home screen according to your preferences and needs.
Setting up custom actions
By default, Home screen shows Submit new ticket button and New chat button at the top of the screen. If you want, you can extend or customize these buttons using the custom actions.
There are several types of actions you can set on the home screen:
- Custom action - tap on the custom action executes a custom function
- Submit new ticket action - tap on the submit new ticket action start a new ticket screen
- Start a new chat action - tap on the new chat action starts a chat screen
note
Start a new chat action won't be visible if your app user is not registered.
Here's an example how you can set custom actions on the home screen:
- Java
- Kotlin
App.java
void setShakeHomeActions() {ShakeHomeAction customAction = new ShakeHomeAction(R.string.visit_roadmap,R.string.visit_roadmap_subtitle,R.drawable.ic_open_link,() -> {// Open URLreturn null;});ShakeHomeAction submitAction = new ShakeHomeSubmitAction(R.string.submit_ticket,R.string.submit_ticket_subtitle,R.drawable.ic_new_ticket,);ShakeHomeAction chatAction = new ShakeHomeChatAction(R.string.start_chat,R.string.start_chat_subtitle,R.drawable.ic_new_chat,);ArrayList<ShakeHomeAction> actions = (ArrayList<ShakeHomeAction>) Arrays.asList(customAction, submitAction, chatAction);Shake.getReportConfiguration().setHomeActions(actions);}
App.kt
fun setShakeHomeActions() {val customAction = ShakeHomeAction(title = R.string.visit_roadmap,subtitle = R.string.visit_roadmap_subtitle,icon = R.drawable.ic_open_link,handler = {// Open URL})val submitAction = ShakeHomeSubmitAction(title = R.string.submit_ticket,subtitle = R.string.submit_ticket_subtitle,icon = R.drawable.ic_new_ticket,)val chatAction = ShakeHomeChatAction(title = R.string.start_chat,subtitle = R.string.start_chat_subtitle,icon = R.drawable.ic_new_chat,)val actions = arrayListOf(customAction, submitAction, chatAction)Shake.getReportConfiguration().homeActions = actions}
Changing the home screen subtitle
If you want to change subtitle message on the home screen, you can do it using the following method:
- Java
- Kotlin
App.java
Shake.getReportConfiguration().setHomeSubtitle(R.string.shake_home_subtitle);
App.kt
Shake.getReportConfiguration().homeSubtitle = R.string.shake_home_subtitle