1
0
Fork 0
mirror of https://github.com/ethauvin/android-about-box.git synced 2025-04-25 02:37:11 -07:00

Merge pull request #39 from eggheadgames/improve-share-message

Improve share message
This commit is contained in:
mikemee 2017-10-08 12:04:26 -07:00 committed by GitHub
commit 097f246870
4 changed files with 10 additions and 9 deletions

View file

@ -106,6 +106,7 @@ By default, the default Android share intent will be called with the values spec
aboutConfig.shareMessage = getString(R.string.share_message); aboutConfig.shareMessage = getString(R.string.share_message);
aboutConfig.sharingTitle = getString(R.string.sharing_title); 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`): Alternatively, you can provide a custom sharing function (and omit `shareMessage` and `sharingTitle`):
```java ```java

View file

@ -1,7 +1,7 @@
dependencies: dependencies:
pre: pre:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,android-25 - echo y | android update sdk --no-ui --all --filter tools,platform-tools,android-25
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.2 - echo y | android update sdk --no-ui --all --filter build-tools-25.0.3
test: test:
override: override:

View file

@ -5,14 +5,14 @@ apply plugin: 'com.github.dcendents.android-maven'
group='com.github.eggheadgames' group='com.github.eggheadgames'
android { android {
compileSdkVersion 24 compileSdkVersion 25
buildToolsVersion "25.0.2" buildToolsVersion "25.0.3"
defaultConfig { defaultConfig {
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 24 targetSdkVersion 24
versionCode 6 versionCode 7
versionName "1.3.0" versionName "1.3.1"
} }
buildTypes { buildTypes {
release { release {

View file

@ -25,10 +25,10 @@ public final class ShareUtil {
if (!TextUtils.isEmpty(config.packageName) && !TextUtils.isEmpty(shareMessage) && config.buildType != null) { if (!TextUtils.isEmpty(config.packageName) && !TextUtils.isEmpty(shareMessage) && config.buildType != null) {
switch (config.buildType) { switch (config.buildType) {
case GOOGLE: case GOOGLE:
shareMessage = AboutBoxUtils.playStoreAppURI + config.packageName; shareMessage = shareMessage + AboutBoxUtils.playStoreAppURI + config.packageName;
break; break;
case AMAZON: case AMAZON:
shareMessage = AboutBoxUtils.amznStoreAppURI + config.packageName; shareMessage = shareMessage + AboutBoxUtils.amznStoreAppURI + config.packageName;
break; break;
default: default:
break; break;