diff --git a/README.md b/README.md index 4dc387a..24137eb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [![Circle CI](https://circleci.com/gh/eggheadgames/android-about-box.svg?style=svg)](https://circleci.com/gh/eggheadgames/android-about-box) [![Release](https://jitpack.io/v/eggheadgames/android-about-box.svg)](https://jitpack.io/#eggheadgames/android-about-box) +![Downloads](https://jitpack.io/v/eggheadgames/android-about-box/month.svg) +[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/eggheadgames/android-about-box/blob/develop/LICENSE) # About Box A modern About Box for an Android App built on the [daniel-stoneuk/material-about-library](https://github.com/daniel-stoneuk/material-about-library). @@ -12,7 +14,7 @@ Android About Box is configured with a set of (mostly) strings for the company n When triggered from a menu item, it will display the app name, icon and version, provide links to contact support, leave a review, share the app, go to other apps by the same company in the app store -- as well as links to Facebook etc. -As of version 1.1.0, you can also optionally provide a help file with the `aboutConfig.guideHtmlPath` setting. Leave it unset (null or empty string) and the behaviour is compatible with version 1.0.x. +You can omit most features if they don't apply (e.g. like website), by not setting the values. ## Installation Instructions @@ -34,12 +36,7 @@ dependencies { } ``` -## Example -### Setup Branch.io - -Branch.io integration can be found [here](https://github.com/BranchMetrics/android-branch-deep-linking) - -### Setup AboutBox +## Setup AboutBox Add AboutBox configuration to your Application class @@ -48,6 +45,7 @@ Add AboutBox configuration to your Application class aboutConfig.appName = getString(R.string.app_name); aboutConfig.appIcon = R.mipmap.ic_launcher; aboutConfig.version = "1.0.0"; + aboutConfig.author = "Tolstoy"; aboutConfig.aboutLabelTitle = "About App"; aboutConfig.packageName = getApplicationContext().getPackageName(); aboutConfig.buildType = google ? AboutConfig.BuildType.GOOGLE : AboutConfig.BuildType.AMAZON; @@ -90,23 +88,41 @@ Add AboutBox configuration to your Application class aboutConfig.emailSubject = EMAIL_SUBJECT; aboutConfig.emailBody = EMAIL_BODY; - // Branch.io labels. - aboutConfig.shareMessageTitle = getString(R.string.share_message_title); - aboutConfig.shareMessage = getString(R.string.share_message); - aboutConfig.sharingTitle = getString(R.string.sharing_title); + ``` -Open AboutBox screen +## Open the About Box from your app ```java AboutActivity.launch(activity); ``` + + +## Sharing + +By default, the default Android share intent will be called with the values specified in `shareMessage` and `sharingTitle`. For example: +```java + aboutConfig.shareMessage = getString(R.string.share_message); + aboutConfig.sharingTitle = getString(R.string.sharing_title); +``` +The `share_message` string will have an app store URL appended to it (appropriately constructed for Google Play or Amazon). + +Alternatively, you can provide a custom sharing function (and omit `shareMessage` and `sharingTitle`): + ```java + aboutConfig.share = new IShare() { + @Override + public void share(Activity activity) { + // do custom sharing + } + }; +``` + ## Theme -Add to your AndroidManifest.xml file +If you add the following to your AndroidManifest.xml file, the About Box will use these colours. This allows you to match your app colours: -``` +```xml @@ -120,7 +136,7 @@ Theme.Mal.Dark.LightActionBar Theme.Mal.Dark.DarkActionBar ``` -``` +```xml