Created
December 15, 2020 13:44
-
-
Save baz8080/9108243118b2a93bb447a46870e1e580 to your computer and use it in GitHub Desktop.
Workaround for the bug where the conversations icon disappears sometimes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.myapplication"> | |
<application | |
android:name=".MainApplication" | |
... | |
android:theme="@style/AppTheme"> | |
<!-- Remember to declare the CustomHelpCenterActivity --> | |
<activity | |
android:name=".CustomHelpCenterActivity" | |
/> | |
... | |
</application> | |
</manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.Menu; | |
import android.view.MenuItem; | |
import zendesk.support.guide.HelpCenterActivity; | |
// Extend Zendesk's Activity and override onPrepareOptionsMenu to always show the menu. | |
public class CustomHelpCenterActivity extends HelpCenterActivity { | |
@Override | |
public boolean onPrepareOptionsMenu(Menu menu) { | |
boolean show = super.onPrepareOptionsMenu(menu); | |
MenuItem conversationsMenuItem = menu.findItem(com.zendesk.guide.sdk.R.id.fragment_help_menu_contact); | |
if (conversationsMenuItem != null) { | |
conversationsMenuItem.setVisible(true); | |
} | |
return show; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zendesk.configurations.Configuration; | |
import zendesk.support.guide.HelpCenterActivity; | |
public void launchCustomHelpCenterActivity() { | |
Intent intent = new Intent(this, CustomHelpCenterActivity.class); | |
// You can use the Zendesk HelpCenterActivity builder to get a config. | |
// This config must be passed or else the CustomHelpCenterActivity will | |
// not open. | |
Configuration configuration = HelpCenterActivity.builder().config(); | |
intent.putExtra("ZENDESK_CONFIGURATION", configuration); | |
startActivity(intent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment