mirror of
https://github.com/ethauvin/android-about-box.git
synced 2025-04-25 10:47:10 -07:00
Compare commits
36 commits
Author | SHA1 | Date | |
---|---|---|---|
|
097f246870 | ||
|
c3e6dca4c8 | ||
|
da75a1835c | ||
|
b577541efa | ||
|
51d0b9fcbb | ||
|
5b6719dd13 | ||
|
210c48d2ed | ||
fac8415ad9 | |||
5df77387e6 | |||
|
5cf889dd42 | ||
|
77e3a67097 | ||
|
4fe12914a9 | ||
|
b5729bcfdf | ||
6fbb16f264 | |||
|
696fea95ee | ||
|
c6fae1ad37 | ||
|
0fb1c6fb8d | ||
|
d6fe7c6975 | ||
|
e957ef5b56 | ||
|
0d52e41e48 | ||
71c6c60762 | |||
546a95373a | |||
666ae83137 | |||
5f556fe8ce | |||
|
85132d5e50 | ||
337b7dafb3 | |||
3ae1c381d1 | |||
134ebebb61 | |||
0ebb478771 | |||
852005c24e | |||
9d708b650f | |||
|
83c54ea02f | ||
|
ff613f58d4 | ||
|
bd477b90dd | ||
|
440dd8decc | ||
|
5b4c5c63a2 |
10 changed files with 97 additions and 41 deletions
|
@ -1,5 +1,7 @@
|
||||||
[](https://circleci.com/gh/eggheadgames/android-about-box)
|
[](https://circleci.com/gh/eggheadgames/android-about-box)
|
||||||
[](https://jitpack.io/#eggheadgames/android-about-box)
|
[](https://jitpack.io/#eggheadgames/android-about-box)
|
||||||
|

|
||||||
|
[](https://github.com/eggheadgames/android-about-box/blob/develop/LICENSE)
|
||||||
|
|
||||||
# About Box
|
# 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).
|
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.
|
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.2.0, you can omit many features that don't apply (e.g. like website), by not setting the values.
|
You can omit most features if they don't apply (e.g. like website), by not setting the values.
|
||||||
|
|
||||||
## Installation Instructions
|
## Installation Instructions
|
||||||
|
|
||||||
|
@ -43,6 +45,7 @@ Add AboutBox configuration to your Application class
|
||||||
aboutConfig.appName = getString(R.string.app_name);
|
aboutConfig.appName = getString(R.string.app_name);
|
||||||
aboutConfig.appIcon = R.mipmap.ic_launcher;
|
aboutConfig.appIcon = R.mipmap.ic_launcher;
|
||||||
aboutConfig.version = "1.0.0";
|
aboutConfig.version = "1.0.0";
|
||||||
|
aboutConfig.author = "Tolstoy";
|
||||||
aboutConfig.aboutLabelTitle = "About App";
|
aboutConfig.aboutLabelTitle = "About App";
|
||||||
aboutConfig.packageName = getApplicationContext().getPackageName();
|
aboutConfig.packageName = getApplicationContext().getPackageName();
|
||||||
aboutConfig.buildType = google ? AboutConfig.BuildType.GOOGLE : AboutConfig.BuildType.AMAZON;
|
aboutConfig.buildType = google ? AboutConfig.BuildType.GOOGLE : AboutConfig.BuildType.AMAZON;
|
||||||
|
@ -85,7 +88,7 @@ Add AboutBox configuration to your Application class
|
||||||
aboutConfig.emailSubject = EMAIL_SUBJECT;
|
aboutConfig.emailSubject = EMAIL_SUBJECT;
|
||||||
aboutConfig.emailBody = EMAIL_BODY;
|
aboutConfig.emailBody = EMAIL_BODY;
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Open the About Box from your app
|
## Open the About Box from your app
|
||||||
|
@ -103,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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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 4
|
versionCode 7
|
||||||
versionName "1.2.0"
|
versionName "1.3.1"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -28,5 +28,5 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.github.daniel-stoneuk:material-about-library:1.8.2'
|
compile 'com.github.daniel-stoneuk:material-about-library:2.2.1'
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,9 @@ import android.widget.Toast;
|
||||||
|
|
||||||
public final class AboutBoxUtils {
|
public final class AboutBoxUtils {
|
||||||
|
|
||||||
|
public final static String playStoreAppURI = "https://play.google.com/store/apps/details?id=";
|
||||||
|
public final static String amznStoreAppURI = "https://www.amazon.com/gp/mas/dl/android?p=";
|
||||||
|
|
||||||
private AboutBoxUtils() {
|
private AboutBoxUtils() {
|
||||||
//nothing
|
//nothing
|
||||||
}
|
}
|
||||||
|
@ -49,11 +52,11 @@ public final class AboutBoxUtils {
|
||||||
switch (buildType) {
|
switch (buildType) {
|
||||||
case GOOGLE:
|
case GOOGLE:
|
||||||
appURI = "market://details?id=" + packageName;
|
appURI = "market://details?id=" + packageName;
|
||||||
webURI = "http://play.google.com/store/apps/details?id=" + packageName;
|
webURI = playStoreAppURI + packageName;
|
||||||
break;
|
break;
|
||||||
case AMAZON:
|
case AMAZON:
|
||||||
appURI = "amzn://apps/android?p=" + packageName;
|
appURI = "amzn://apps/android?p=" + packageName;
|
||||||
webURI = "http://www.amazon.com/gp/mas/dl/android?p=" + packageName;
|
webURI = amznStoreAppURI + packageName;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//nothing
|
//nothing
|
||||||
|
@ -66,8 +69,17 @@ public final class AboutBoxUtils {
|
||||||
String webURI = null;
|
String webURI = null;
|
||||||
switch (buildType) {
|
switch (buildType) {
|
||||||
case GOOGLE:
|
case GOOGLE:
|
||||||
appURI = "market://search?q=pub:" + publisher;
|
// see:
|
||||||
webURI = "http://play.google.com/store/search?q=pub:" + publisher;
|
// https://developer.android.com/distribute/marketing-tools/linking-to-google-play.html#OpeningPublisher
|
||||||
|
// https://stackoverflow.com/questions/32029408/how-to-open-developer-page-on-google-play-store-market
|
||||||
|
// https://issuetracker.google.com/65244694
|
||||||
|
if (publisher.matches("\\d+")) {
|
||||||
|
webURI = "https://play.google.com/store/apps/dev?id=" + publisher;
|
||||||
|
appURI = webURI;
|
||||||
|
} else {
|
||||||
|
appURI = "market://search?q=pub:" + publisher;
|
||||||
|
webURI = "https://play.google.com/store/search?q=pub:" + publisher;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AMAZON:
|
case AMAZON:
|
||||||
appURI = "amzn://apps/android?showAll=1&p=" + packageName;
|
appURI = "amzn://apps/android?showAll=1&p=" + packageName;
|
||||||
|
|
|
@ -8,6 +8,9 @@ public class AboutConfig {
|
||||||
public String appName;
|
public String appName;
|
||||||
public int appIcon;
|
public int appIcon;
|
||||||
public String version;
|
public String version;
|
||||||
|
public String author;
|
||||||
|
public String extra;
|
||||||
|
public String extraTitle;
|
||||||
public String aboutLabelTitle;
|
public String aboutLabelTitle;
|
||||||
public String logUiEventName;
|
public String logUiEventName;
|
||||||
public String facebookUserName;
|
public String facebookUserName;
|
||||||
|
|
|
@ -8,7 +8,7 @@ import android.text.TextUtils;
|
||||||
|
|
||||||
import com.danielstone.materialaboutlibrary.MaterialAboutActivity;
|
import com.danielstone.materialaboutlibrary.MaterialAboutActivity;
|
||||||
import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem;
|
import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem;
|
||||||
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickListener;
|
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction;
|
||||||
import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem;
|
import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem;
|
||||||
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard;
|
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard;
|
||||||
import com.danielstone.materialaboutlibrary.model.MaterialAboutList;
|
import com.danielstone.materialaboutlibrary.model.MaterialAboutList;
|
||||||
|
@ -23,6 +23,7 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
|
|
||||||
public static void launch(Activity activity) {
|
public static void launch(Activity activity) {
|
||||||
Intent intent = new Intent(activity, AboutActivity.class);
|
Intent intent = new Intent(activity, AboutActivity.class);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||||
activity.startActivity(intent);
|
activity.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +55,21 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
.text(R.string.egab_version)
|
.text(R.string.egab_version)
|
||||||
.subText(config.version)
|
.subText(config.version)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(config.author)) {
|
||||||
|
generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
|
||||||
|
.text(R.string.egab_author)
|
||||||
|
.subText(config.author)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(config.extra) && !TextUtils.isEmpty(config.extraTitle)) {
|
||||||
|
generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
|
||||||
|
.text(config.extraTitle)
|
||||||
|
.subTextHtml(config.extra)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
return generalInfoCardBuilder.build();
|
return generalInfoCardBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,9 +79,9 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(config.guideHtmlPath)) {
|
if (!TextUtils.isEmpty(config.guideHtmlPath)) {
|
||||||
card.addItem(itemHelper(R.string.egab_guide, R.drawable.ic_help_green,
|
card.addItem(itemHelper(R.string.egab_guide, R.drawable.ic_help_green,
|
||||||
new MaterialAboutItemOnClickListener() {
|
new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
if (config.dialog == null) {
|
if (config.dialog == null) {
|
||||||
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.guideHtmlPath);
|
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.guideHtmlPath);
|
||||||
} else {
|
} else {
|
||||||
|
@ -77,9 +93,9 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
card.addItem(itemHelper(R.string.egab_contact_support, R.drawable.ic_email_black,
|
card.addItem(itemHelper(R.string.egab_contact_support, R.drawable.ic_email_black,
|
||||||
new MaterialAboutItemOnClickListener() {
|
new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
EmailUtil.contactUs(AboutActivity.this);
|
EmailUtil.contactUs(AboutActivity.this);
|
||||||
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_contact_log_event));
|
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_contact_log_event));
|
||||||
}
|
}
|
||||||
|
@ -93,18 +109,18 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
|
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
|
||||||
if (config.buildType != null && !TextUtils.isEmpty(config.packageName)) {
|
if (config.buildType != null && !TextUtils.isEmpty(config.packageName)) {
|
||||||
card.addItem(itemHelper(R.string.egab_leave_review, R.drawable.ic_review,
|
card.addItem(itemHelper(R.string.egab_leave_review, R.drawable.ic_review,
|
||||||
new MaterialAboutItemOnClickListener() {
|
new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
AboutBoxUtils.openApp(AboutActivity.this, config.buildType, config.packageName);
|
AboutBoxUtils.openApp(AboutActivity.this, config.buildType, config.packageName);
|
||||||
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_review_log_event));
|
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_review_log_event));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
card.addItem(itemHelper(R.string.egab_share, R.drawable.ic_share_black,
|
card.addItem(itemHelper(R.string.egab_share, R.drawable.ic_share_black,
|
||||||
new MaterialAboutItemOnClickListener() {
|
new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
if (config.share == null) {
|
if (config.share == null) {
|
||||||
ShareUtil.share(AboutActivity.this);
|
ShareUtil.share(AboutActivity.this);
|
||||||
} else {
|
} else {
|
||||||
|
@ -121,22 +137,22 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
|
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
|
||||||
if (config.buildType != null && !TextUtils.isEmpty(config.appPublisher) && !TextUtils.isEmpty(config.packageName)) {
|
if (config.buildType != null && !TextUtils.isEmpty(config.appPublisher) && !TextUtils.isEmpty(config.packageName)) {
|
||||||
card.addItem(itemHelper(R.string.egab_try_other_apps, R.drawable.ic_try_other_apps,
|
card.addItem(itemHelper(R.string.egab_try_other_apps, R.drawable.ic_try_other_apps,
|
||||||
new MaterialAboutItemOnClickListener() {
|
new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
AboutBoxUtils.openPublisher(AboutActivity.this, config.buildType,
|
AboutBoxUtils.openPublisher(AboutActivity.this, config.buildType,
|
||||||
config.appPublisher, config.packageName);
|
config.appPublisher, config.packageName);
|
||||||
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_try_other_app_log_event));
|
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_try_other_app_log_event));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
if (!TextUtils.isEmpty(config.companyHtmlPath)) {
|
if (!TextUtils.isEmpty(config.companyHtmlPath) && !TextUtils.isEmpty(config.aboutLabelTitle)) {
|
||||||
card.addItem(new MaterialAboutActionItem.Builder()
|
card.addItem(new MaterialAboutActionItem.Builder()
|
||||||
.text(config.aboutLabelTitle)
|
.text(config.aboutLabelTitle)
|
||||||
.icon(R.drawable.ic_about_black)
|
.icon(R.drawable.ic_about_black)
|
||||||
.setOnClickListener(new MaterialAboutItemOnClickListener() {
|
.setOnClickAction(new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
if (config.dialog == null) {
|
if (config.dialog == null) {
|
||||||
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.companyHtmlPath);
|
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.companyHtmlPath);
|
||||||
} else {
|
} else {
|
||||||
|
@ -158,9 +174,9 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
.text(R.string.egab_facebook_label)
|
.text(R.string.egab_facebook_label)
|
||||||
.subText(config.facebookUserName)
|
.subText(config.facebookUserName)
|
||||||
.icon(R.drawable.ic_facebook_24)
|
.icon(R.drawable.ic_facebook_24)
|
||||||
.setOnClickListener(new MaterialAboutItemOnClickListener() {
|
.setOnClickAction(new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
AboutBoxUtils.getOpenFacebookIntent(AboutActivity.this, config.facebookUserName);
|
AboutBoxUtils.getOpenFacebookIntent(AboutActivity.this, config.facebookUserName);
|
||||||
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_facebook_log_event));
|
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_facebook_log_event));
|
||||||
}
|
}
|
||||||
|
@ -172,9 +188,9 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
.text(R.string.egab_twitter_label)
|
.text(R.string.egab_twitter_label)
|
||||||
.subText(config.twitterUserName)
|
.subText(config.twitterUserName)
|
||||||
.icon(R.drawable.ic_twitter_24dp)
|
.icon(R.drawable.ic_twitter_24dp)
|
||||||
.setOnClickListener(new MaterialAboutItemOnClickListener() {
|
.setOnClickAction(new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
AboutBoxUtils.startTwitter(AboutActivity.this, config.twitterUserName);
|
AboutBoxUtils.startTwitter(AboutActivity.this, config.twitterUserName);
|
||||||
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_twitter_log_event));
|
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_twitter_log_event));
|
||||||
}
|
}
|
||||||
|
@ -184,11 +200,11 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
if (!TextUtils.isEmpty(config.webHomePage)) {
|
if (!TextUtils.isEmpty(config.webHomePage)) {
|
||||||
card.addItem(new MaterialAboutActionItem.Builder()
|
card.addItem(new MaterialAboutActionItem.Builder()
|
||||||
.text(R.string.egab_web_label)
|
.text(R.string.egab_web_label)
|
||||||
.subText(config.webHomePage.replace("https://", "").replace("http://", "").replace("/", ""))
|
.subText(config.webHomePage.replaceFirst("^https?://", "").replaceAll("/$", ""))
|
||||||
.icon(R.drawable.ic_web_black_24dp)
|
.icon(R.drawable.ic_web_black_24dp)
|
||||||
.setOnClickListener(new MaterialAboutItemOnClickListener() {
|
.setOnClickAction(new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.webHomePage);
|
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.webHomePage);
|
||||||
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_website_log_event));
|
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_website_log_event));
|
||||||
}
|
}
|
||||||
|
@ -203,9 +219,9 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
|
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
|
||||||
if (!TextUtils.isEmpty(config.privacyHtmlPath)) {
|
if (!TextUtils.isEmpty(config.privacyHtmlPath)) {
|
||||||
card.addItem(itemHelper(R.string.egab_privacy_policy, R.drawable.ic_privacy,
|
card.addItem(itemHelper(R.string.egab_privacy_policy, R.drawable.ic_privacy,
|
||||||
new MaterialAboutItemOnClickListener() {
|
new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
if (config.dialog == null) {
|
if (config.dialog == null) {
|
||||||
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.privacyHtmlPath);
|
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.privacyHtmlPath);
|
||||||
} else {
|
} else {
|
||||||
|
@ -219,9 +235,9 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
}
|
}
|
||||||
if (!TextUtils.isEmpty(config.acknowledgmentHtmlPath)) {
|
if (!TextUtils.isEmpty(config.acknowledgmentHtmlPath)) {
|
||||||
card.addItem(itemHelper(R.string.egab_acknowledgements, R.drawable.ic_acknowledgements,
|
card.addItem(itemHelper(R.string.egab_acknowledgements, R.drawable.ic_acknowledgements,
|
||||||
new MaterialAboutItemOnClickListener() {
|
new MaterialAboutItemOnClickAction() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(boolean b) {
|
public void onClick() {
|
||||||
if (config.dialog == null) {
|
if (config.dialog == null) {
|
||||||
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.acknowledgmentHtmlPath);
|
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.acknowledgmentHtmlPath);
|
||||||
} else {
|
} else {
|
||||||
|
@ -235,11 +251,11 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
return card.build();
|
return card.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private MaterialAboutActionItem itemHelper(int name, int icon, MaterialAboutItemOnClickListener listener) {
|
private MaterialAboutActionItem itemHelper(int name, int icon, MaterialAboutItemOnClickAction clickAction) {
|
||||||
return new MaterialAboutActionItem.Builder()
|
return new MaterialAboutActionItem.Builder()
|
||||||
.text(name)
|
.text(name)
|
||||||
.icon(icon)
|
.icon(icon)
|
||||||
.setOnClickListener(listener)
|
.setOnClickAction(clickAction)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@ package com.eggheadgames.aboutbox.share;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.eggheadgames.aboutbox.AboutBoxUtils;
|
||||||
import com.eggheadgames.aboutbox.AboutConfig;
|
import com.eggheadgames.aboutbox.AboutConfig;
|
||||||
|
|
||||||
public final class ShareUtil {
|
public final class ShareUtil {
|
||||||
|
@ -17,7 +19,24 @@ public final class ShareUtil {
|
||||||
Intent intent2 = new Intent();
|
Intent intent2 = new Intent();
|
||||||
intent2.setAction(Intent.ACTION_SEND);
|
intent2.setAction(Intent.ACTION_SEND);
|
||||||
intent2.setType("text/plain");
|
intent2.setType("text/plain");
|
||||||
intent2.putExtra(Intent.EXTRA_TEXT, config.shareMessage);
|
|
||||||
|
String shareMessage = config.shareMessage;
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(config.packageName) && !TextUtils.isEmpty(shareMessage) && config.buildType != null) {
|
||||||
|
switch (config.buildType) {
|
||||||
|
case GOOGLE:
|
||||||
|
shareMessage = shareMessage + AboutBoxUtils.playStoreAppURI + config.packageName;
|
||||||
|
break;
|
||||||
|
case AMAZON:
|
||||||
|
shareMessage = shareMessage + AboutBoxUtils.amznStoreAppURI + config.packageName;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
intent2.putExtra(Intent.EXTRA_TEXT, shareMessage);
|
||||||
|
|
||||||
activity.startActivity(Intent.createChooser(intent2, config.sharingTitle));
|
activity.startActivity(Intent.createChooser(intent2, config.sharingTitle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<string name="egab_contact_support">Contactar o Suporte</string>
|
<string name="egab_contact_support">Contactar o Suporte</string>
|
||||||
<string name="egab_try_other_apps">Experimentar outras aplicações</string>
|
<string name="egab_try_other_apps">Experimentar outras aplicações</string>
|
||||||
<string name="egab_version">Versão</string>
|
<string name="egab_version">Versão</string>
|
||||||
|
<string name="egab_author">Autor</string>
|
||||||
<string name="egab_facebook_label">Facebook</string>
|
<string name="egab_facebook_label">Facebook</string>
|
||||||
<string name="egab_twitter_label">Twitter</string>
|
<string name="egab_twitter_label">Twitter</string>
|
||||||
<string name="egab_web_label">Web</string>
|
<string name="egab_web_label">Web</string>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<string name="egab_contact_support">Contact Support</string>
|
<string name="egab_contact_support">Contact Support</string>
|
||||||
<string name="egab_try_other_apps">Try Other Apps</string>
|
<string name="egab_try_other_apps">Try Other Apps</string>
|
||||||
<string name="egab_version">Version</string>
|
<string name="egab_version">Version</string>
|
||||||
|
<string name="egab_author">Author</string>
|
||||||
<string name="egab_facebook_label">Facebook</string>
|
<string name="egab_facebook_label">Facebook</string>
|
||||||
<string name="egab_twitter_label">Twitter</string>
|
<string name="egab_twitter_label">Twitter</string>
|
||||||
<string name="egab_web_label">Web</string>
|
<string name="egab_web_label">Web</string>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="AppTheme.MaterialAboutActivity" parent="Theme.Mal" >
|
<style name="AppTheme.MaterialAboutActivity" parent="Theme.Mal.Light.DarkActionBar" >
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue