mirror of
https://github.com/ethauvin/android-about-box.git
synced 2025-04-25 02:37:11 -07:00
Added guide item
This commit is contained in:
parent
269d04a42f
commit
94842b51da
3 changed files with 18 additions and 4 deletions
|
@ -13,6 +13,7 @@ public class AboutConfig {
|
|||
public String facebookUserName;
|
||||
public String twitterUserName;
|
||||
public String webHomePage;
|
||||
public String guideHtmlPath;
|
||||
public String appPublisher;
|
||||
public String companyHtmlPath;
|
||||
public String privacyHtmlPath;
|
||||
|
|
|
@ -56,7 +56,19 @@ public class AboutActivity extends MaterialAboutActivity {
|
|||
}
|
||||
})
|
||||
.build());
|
||||
|
||||
supportCardBuilder.addItem(new MaterialAboutActionItem.Builder()
|
||||
.text(R.string.egab_guide)
|
||||
.icon(R.drawable.ic_about_black)
|
||||
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(config.webHomePage)));
|
||||
if (config.analytics != null) {
|
||||
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.egab_guide));
|
||||
}
|
||||
}
|
||||
})
|
||||
.build());
|
||||
|
||||
MaterialAboutCard.Builder shareCardBuilder = new MaterialAboutCard.Builder();
|
||||
shareCardBuilder.addItem(new MaterialAboutActionItem.Builder()
|
||||
|
@ -267,7 +279,7 @@ public class AboutActivity extends MaterialAboutActivity {
|
|||
default:
|
||||
//nothing
|
||||
}
|
||||
open(appURI, webURI);
|
||||
openApplication(appURI, webURI);
|
||||
}
|
||||
|
||||
public void openPublisher(AboutConfig.BuildType buildType, String publisher, String packageName) {
|
||||
|
@ -285,10 +297,10 @@ public class AboutActivity extends MaterialAboutActivity {
|
|||
default:
|
||||
//nothing
|
||||
}
|
||||
open(appURI, webURI);
|
||||
openApplication(appURI, webURI);
|
||||
}
|
||||
|
||||
private void open(String appURI, String webURI) {
|
||||
private void openApplication(String appURI, String webURI) {
|
||||
try {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(appURI)));
|
||||
} catch (ActivityNotFoundException e1) {
|
||||
|
|
|
@ -21,5 +21,6 @@
|
|||
<string name="egab_acknowledgements_log_event">Acknowledgements</string>
|
||||
<string name="egab_can_not_open">You don\'t have any app that can open this link</string>
|
||||
<string name="egab_email_body_prompt">Please type your question here: </string>
|
||||
<string name="egab_guide">Guide</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue