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

Compare commits

...

106 commits

Author SHA1 Message Date
mikemee
097f246870 Merge pull request #39 from eggheadgames/improve-share-message
Improve share message
2017-10-08 12:04:26 -07:00
Michael Mee
c3e6dca4c8 Increment build tools to the latest 25.x point release 2017-10-08 11:59:15 -07:00
Michael Mee
da75a1835c Bump version for immediate release 2017-10-08 11:52:21 -07:00
Michael Mee
b577541efa Prepend sharing message to the URL 2017-10-08 11:52:04 -07:00
mikemee
51d0b9fcbb Merge pull request #38 from eggheadgames/release-1-3-0
Release 1.3.0 with latest Material About Box
2017-10-08 11:08:02 -07:00
mikemee
5b6719dd13 Release 1.3.0 with latest Material About Box 2017-10-08 11:02:19 -07:00
mikemee
210c48d2ed Merge pull request #37 from ethauvin/develop
Move to Material About Library 2.2.1
2017-10-08 10:59:16 -07:00
fac8415ad9 Moved to version 2.2.1 of the material-about-library. 2017-09-01 23:28:00 -07:00
5df77387e6 Changed publisher URLs to https.
Workaround for invalid developer URL.
2017-09-01 23:25:03 -07:00
mikemee
5cf889dd42 Merge pull request #36 from eggheadgames/release-1.2.2
Release 1.2.2 with fix from #35
2017-09-01 11:07:44 -07:00
Michael Mee
77e3a67097 Release 1.2.2 with fix from #35 2017-09-01 11:02:35 -07:00
mikemee
4fe12914a9 Merge pull request #35 from ethauvin/develop
Handle both publisher or developer page.
2017-09-01 11:00:45 -07:00
Michael Mee
b5729bcfdf Merge branch 'develop'
* develop:
2017-09-01 10:52:33 -07:00
6fbb16f264 Handle both publisher or developer page. 2017-08-31 09:12:11 -07:00
mikemee
696fea95ee Merge pull request #32 from eggheadgames/release/1.2.1
Release 1.2.1
2017-08-30 16:06:35 -07:00
mikemee
c6fae1ad37 Merge pull request #33 from eggheadgames/release/1.2.1
Release/1.2.1 to master
2017-08-30 16:05:39 -07:00
Michael Mee
0fb1c6fb8d Correct downloads URL 2017-08-30 16:00:52 -07:00
Michael Mee
d6fe7c6975 Fix bracket imbalance for License badge 2017-08-30 15:59:26 -07:00
Michael Mee
e957ef5b56 Release 1.2.1 2017-08-30 15:57:45 -07:00
mikemee
0d52e41e48 Merge pull request #31 from ethauvin/develop
Author & Extra & About Company.
2017-08-30 15:36:35 -07:00
71c6c60762 Bring intent to font, to treat the activity as a single instance on background/resume. 2017-08-25 08:58:18 -07:00
546a95373a Added support for HTML in config.extra. 2017-08-22 11:13:23 -07:00
666ae83137 Added config.author, config.extra and config.extraTitle to general info card. 2017-08-22 10:56:18 -07:00
5f556fe8ce Do not display config.aboutLabelTitle if empty. 2017-08-22 10:55:31 -07:00
mikemee
85132d5e50 Merge pull request #29 from ethauvin/develop
Various Minor Fixes
2017-08-22 06:34:57 -07:00
337b7dafb3 Added default case to switch per PMD report. 2017-08-22 00:23:15 -07:00
3ae1c381d1 Made constants final per FindBugs report. 2017-08-22 00:09:03 -07:00
134ebebb61 Force CircleCI trigger. 2017-08-21 23:56:46 -07:00
0ebb478771 Added default shareMessage if not set. 2017-08-21 15:22:16 -07:00
852005c24e Fixed home page URL cleaning for display. 2017-08-21 14:52:44 -07:00
9d708b650f Switched to proper link to Publisher, per official documentation. 2017-08-21 14:22:22 -07:00
AlexDibrivnyy
83c54ea02f Merge pull request #28 from eggheadgames/release_1.2.0
Release 1.2.0 to master
2017-05-16 22:41:06 +03:00
AlexDibrivnyy
e8e817ed30 Merge pull request #27 from eggheadgames/release_1.2.0
Update Readme file
2017-05-16 22:35:01 +03:00
mikemee
1a79efd84a Edit sharing information, adjust styling 2017-05-16 12:25:38 -07:00
Alex Dibrivnyi
139cd11741 Updated Readme file. Incremented version number 2017-05-16 22:13:11 +03:00
AlexDibrivnyy
4e3900f40c Merge pull request #26 from eggheadgames/feature/remove_branch_io
Remove dependancy on Branch.io
2017-05-16 20:47:45 +03:00
Alex Dibrivnyi
3cf3fc8f47 merged 2017-05-16 20:09:11 +03:00
mikemee
ddca85d1b3 Merge pull request #25 from eggheadgames/feature/null_check_to_protect_from_crash
Fix "Force close on launching AboutActivity"
2017-05-16 07:06:15 -07:00
Alexandr Dibrivnyi
1ad0a69002 Added activity context 2017-05-16 12:50:32 +03:00
Alex Dibrivnyi
fc4c2ee3ab Fixed pmd 2017-05-16 00:01:42 +03:00
Alex Dibrivnyi
170c879b10 Removed branch io. We need to try to integrate this version to real app and test (CLose #24) 2017-05-15 23:55:50 +03:00
Alex Dibrivnyi
a3ea5e4d90 Tried to fix GOD class pmd fail 2017-05-15 23:40:57 +03:00
Alex Dibrivnyi
11f7abc55f added null checks to protect lib from crashes 2017-05-15 23:13:25 +03:00
mikemee
93ae9c499e Merge pull request #21 from eggheadgames/release/1.1.0
Release 1.1.0
2017-04-14 10:19:08 -07:00
mikemee
ff613f58d4 Merge pull request #22 from eggheadgames/release/1.1.0
Release 1.1.0 to master
2017-04-14 10:17:32 -07:00
Michael Mee
2a99354cf5 Release 1.1.0
Adds support for a link to a help file in the app.
Updates to the latest Material About Box, which adds theme support
2017-04-14 10:10:57 -07:00
mikemee
835064e73c Merge pull request #19 from eggheadgames/feature/add_guide
Add guide
2017-04-14 10:02:51 -07:00
Michael Mee
a671f916c1 Use latest build tools 2017-04-14 09:55:40 -07:00
Michael Mee
a39ac0331a Set exact build tools version we want 2017-04-14 09:37:05 -07:00
Michael Mee
7f4336b5ec Access internal file appropriately to avoid FileUriExposedException 2017-04-14 09:04:51 -07:00
Michael Mee
2686828222 Adjust green colour of Guide icon 2017-04-14 09:01:58 -07:00
Michael Mee
c9fa053c19 Fix syntax error from missing parens (oops..) 2017-04-13 14:10:01 -07:00
Michael Mee
785187d369 Refactor card assembly to remove redundant intermediate builder variables 2017-04-13 14:08:00 -07:00
Michael Mee
bf033943ce Extract a helper method to DRY things up a little 2017-04-13 13:55:34 -07:00
Michael Mee
7626468b58 Extract logUIEventName method and individual card methods
Fix PMD god class failure
2017-04-13 13:54:47 -07:00
Michael Mee
a9590a92a6 Update to newer tools 2017-04-13 13:01:15 -07:00
Michael Mee
75325cc1cc Fix merge error 2017-04-13 13:00:59 -07:00
mikemee
d3af0f55ea Merge branch 'develop' into feature/add_guide 2017-04-13 12:44:27 -07:00
mikemee
2f4cba730a Merge pull request #20 from eggheadgames/feature/theme_support
Add Material Action Bar Theme support
2017-04-13 12:43:05 -07:00
Alex Dibrivnyi
e34c4067ea Changed readme file. (Close #20) 2017-04-13 21:12:23 +03:00
Alex Dibrivnyi
b8ea937107 Updated card library version. Fixed errors after update 2017-04-13 20:27:14 +03:00
Alex Dibrivnyi
7d339c9cf6 Added logic to show Guide only when html page is provided (Close #18) 2017-04-13 20:08:39 +03:00
Alex Dibrivnyi
cf5d7e3750 Changed guide icon color 2017-04-13 19:55:55 +03:00
Alex Dibrivnyi
2cdc15743a Added Guide to Portuguese 2017-04-13 19:42:04 +03:00
Alex Dibrivnyi
845ad401f9 changed color 2017-04-13 19:33:25 +03:00
Alex Dibrivnyi
251255cd8c replaced guide icon 2017-04-13 19:24:17 +03:00
Alex Dibrivnyi
b93a89c190 added icon. fixed path. (Close #18) 2017-04-13 19:04:49 +03:00
Alex Dibrivnyi
23fae473aa refactored 2017-04-13 18:46:31 +03:00
Alex Dibrivnyi
94842b51da Added guide item 2017-04-13 18:25:32 +03:00
mikemee
bd477b90dd Merge pull request #16 from eggheadgames/release/1.0.2
Release 1.0.2 to master
2017-02-15 22:28:47 -08:00
mikemee
269d04a42f Merge pull request #15 from eggheadgames/release/1.0.2
Release 1.0.2 to develop
2017-02-15 22:28:14 -08:00
Michael Mee
18bdad5e10 Release 1.0.2 2017-02-15 22:22:59 -08:00
mikemee
c91d0ccb72 Merge pull request #14 from eggheadgames/feature/Remove_app_name
Remove `app_name` to stop client shadowing
2017-02-15 22:21:15 -08:00
Michael Mee
40fb21e3c8 Remove app_name to stop client shadowing (close #13) 2017-02-15 22:15:16 -08:00
mikemee
e9aeb63878 Merge pull request #11 from eggheadgames/release/1.0.1
Release 1.0.1 to develop
2017-02-09 16:20:19 -08:00
mikemee
440dd8decc Merge pull request #12 from eggheadgames/release/1.0.1
Release 1.0.1 to master
2017-02-09 16:18:24 -08:00
Michael Mee
3dc2c040bc Increment version for release 2017-02-09 16:13:14 -08:00
Michael Mee
65d3394d79 Remove inaccurate comments 2017-02-09 16:12:44 -08:00
mikemee
ffd2b9c899 Merge pull request #10 from eggheadgames/feature/config_fixes
FIxed small errors
2017-02-09 16:05:46 -08:00
Michael Mee
5303e1d71e Use string resource correctly 2017-02-09 15:41:29 -08:00
Michael Mee
e2c64ba5a8 Add Google Translated version of missing Portuguese prompt 2017-02-09 15:34:52 -08:00
Michael Mee
4a9b0feefc Skip OS for now version to avoid scaring people :) 2017-02-09 15:29:19 -08:00
Michael Mee
6ef9141109 Extract email prompt string into strings.xml 2017-02-09 15:25:50 -08:00
Michael Mee
501017078f Add platform to footer instead of header 2017-02-09 15:12:06 -08:00
Alex Dibrivnyi
077aad00c0 Fixed pmd 2017-02-09 22:17:57 +02:00
Alex Dibrivnyi
2c0511a7fd Fixed lint 2017-02-09 22:08:08 +02:00
Alex Dibrivnyi
7541287f69 Added egab to all strings keys 2017-02-09 22:00:03 +02:00
Alex Dibrivnyi
58c3e44cc1 Added Portuguese language. (Close #3) 2017-02-09 21:48:32 +02:00
Alex Dibrivnyi
690d7547f1 Added footer to email body (Close #5) 2017-02-09 21:30:26 +02:00
Alex Dibrivnyi
0dea2c71e0 Fixed mistyped (Close #4) 2017-02-09 21:09:11 +02:00
Alex Dibrivnyi
5d1674a0aa Changed logic to check build type (Close #6) 2017-02-09 21:01:59 +02:00
Alex Dibrivnyi
ed10e03d6b Added correct error handling when facebook/twitter is not installed. (Close #8) 2017-02-09 20:41:49 +02:00
Alex Dibrivnyi
685b6e6ffe Fixed Amazon link (Close #7) 2017-02-09 20:36:38 +02:00
Alex Dibrivnyi
abe6dbbae7 Fixed Email subject (Close #9) 2017-02-09 20:17:49 +02:00
mikemee
a60b1b1595 Merge pull request #2 from eggheadgames/feature/readme_examples
Changed Readme
2017-02-07 17:10:21 -08:00
mikemee
7b9eaf5715 Make image path relative instead of absolute
So it doesn't break when it moves from branch to branch.
2017-02-07 17:05:32 -08:00
Alex Dibrivnyi
948e104edf Chnaged Readme file, added screenshot 2017-02-07 21:06:02 +02:00
Alex Dibrivnyi
aa3fc4f0b5 Added example image 2017-02-07 21:02:32 +02:00
Alex Dibrivnyi
056ad0cd85 fixed readme 2017-02-06 23:26:03 +02:00
Alex Dibrivnyi
ae0ce1a880 Added readme examples 2017-02-06 23:23:16 +02:00
Alex Dibrivnyi
3d34b34fbe Added idea folder to git ignore 2017-02-06 23:02:10 +02:00
Quality Mobile Puzzle Apps
ac00268fce Add link to material-about-library 2017-02-06 10:22:02 -08:00
Quality Mobile Puzzle Apps
3c8952e383 Add badges and a basic description
Still needs screenshots and integration information
2017-02-06 10:10:15 -08:00
mikemee
5b4c5c63a2 Merge pull request #1 from eggheadgames/develop
Initial Release 🎉 

Woohoo, first version!
2017-02-06 10:02:28 -08:00
Michael Mee
951c3af3f2 Make gradlew executable 2017-02-06 09:55:12 -08:00
Michael Mee
8a0f61ce6e remove .idea folder 2017-02-06 09:54:51 -08:00
41 changed files with 593 additions and 624 deletions

2
.gitignore vendored
View file

@ -34,7 +34,7 @@ captures/
# Intellij
*.iml
.idea/workspace.xml
.idea/
# Keystore files
*.jks

22
.idea/compiler.xml generated
View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View file

@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

18
.idea/gradle.xml generated
View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/library" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

View file

@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="animated-vector-drawable-25.1.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/25.1.0/animated-vector-drawable-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="answers-shim-0.0.6">
<CLASSES>
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.crashlytics.sdk.android/answers-shim/0.0.6/res" />
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.crashlytics.sdk.android/answers-shim/0.0.6/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="appcompat-v7-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.1.0/appcompat-v7-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="cardview-v7-25.1.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/cardview-v7/25.1.0/res" />
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/cardview-v7/25.1.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/cardview-v7/25.1.0/cardview-v7-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="design-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/design/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/design/25.1.0/res" />
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/design/25.1.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/design/25.1.0/design-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="library-2.5.7">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/io.branch.sdk.android/library/2.5.7/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/io.branch.sdk.android/library/2.5.7/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/io.branch.sdk.android/library/2.5.7/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.branch.sdk.android/library/2.5.7/72c56965e9f432e245fe85536f56fd3c688af6cf/library-2.5.7-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="material-about-library-1.5.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.github.daniel-stoneuk/material-about-library/1.5.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.github.daniel-stoneuk/material-about-library/1.5.0/res" />
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.github.daniel-stoneuk/material-about-library/1.5.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="recyclerview-v7-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.1.0/recyclerview-v7-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,11 +0,0 @@
<component name="libraryTable">
<library name="support-annotations-25.1.0">
<CLASSES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/25.1.0/support-annotations-25.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/25.1.0/support-annotations-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="support-compat-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-compat/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-compat/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-compat/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-compat/25.1.0/support-compat-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="support-core-ui-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-core-ui/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-core-ui/25.1.0/res" />
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-core-ui/25.1.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-core-ui/25.1.0/support-core-ui-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="support-core-utils-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-core-utils/25.1.0/support-core-utils-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="support-fragment-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-fragment/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-fragment/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-fragment/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-fragment/25.1.0/support-fragment-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="support-media-compat-25.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-media-compat/25.1.0/support-media-compat-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="support-v4-25.1.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-v4/25.1.0/res" />
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-v4/25.1.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View file

@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="support-vector-drawable-25.1.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/25.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/25.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-vector-drawable/25.1.0/support-vector-drawable-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="transition-25.1.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/transition/25.1.0/res" />
<root url="jar://$PROJECT_DIR$/library/build/intermediates/exploded-aar/com.android.support/transition/25.1.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/transition/25.1.0/transition-25.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

41
.idea/misc.xml generated
View file

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

9
.idea/modules.xml generated
View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/android-about-box.iml" filepath="$PROJECT_DIR$/android-about-box.iml" />
<module fileurl="file://$PROJECT_DIR$/library/library.iml" filepath="$PROJECT_DIR$/library/library.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated
View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

152
README.md
View file

@ -1,2 +1,150 @@
# android-about-box
Modern About Box for an Android App
[![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).
### Easily display the common items of an About Box in a modern Android friendly way
## About
Android About Box is configured with a set of (mostly) strings for the company name, twitter and Facebook accounts, website, and filenames to html files for help files, privacy policy 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.
You can omit most features if they don't apply (e.g. like website), by not setting the values.
## Installation Instructions
Add the JitPack.io repository to your root `build.gradle`:
```gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
```
Add a dependency to your application related `build.gradle`
```gradle
dependencies {
compile 'com.github.eggheadgames:android-about-box:<actual version>'
}
```
## Setup AboutBox
Add AboutBox configuration to your Application class
```java
AboutConfig aboutConfig = AboutConfig.getInstance();
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;
aboutConfig.facebookUserName = FACEBOOK_USER_NAME;
aboutConfig.twitterUserName = TWITTER_USER_NAME;
aboutConfig.webHomePage = WEB_HOME_PAGE;
// app publisher for "Try Other Apps" item
aboutConfig.appPublisher = APP_PUBLISHER;
// if pages are stored locally, then you need to override aboutConfig.dialog to be able use custom WebView
aboutConfig.companyHtmlPath = COMPANY_HTML_PATH;
aboutConfig.privacyHtmlPath = PRIVACY_HTML_PATH;
aboutConfig.acknowledgmentHtmlPath = ACKNOWLEDGMENT_HTML_PATH;
aboutConfig.dialog = new IDialog() {
@Override
public void open(AppCompatActivity appCompatActivity, String url, String tag) {
// handle custom implementations of WebView. It will be called when user click to web items. (Example: "Privacy", "Acknowledgments" and "About")
}
};
aboutConfig.analytics = new IAnalytic() {
@Override
public void logUiEvent(String s, String s1) {
// handle log events.
}
@Override
public void logException(Exception e, boolean b) {
// handle exception events.
}
};
// set it only if aboutConfig.analytics is defined.
aboutConfig.logUiEventName = "Log";
// Contact Support email details
aboutConfig.emailAddress = EMAIL_ADDRESS;
aboutConfig.emailSubject = EMAIL_SUBJECT;
aboutConfig.emailBody = EMAIL_BODY;
```
## 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
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
<activity
android:name="com.eggheadgames.aboutbox.activity.AboutActivity"
android:theme="@style/AppTheme.MaterialAboutActivity"/>
```
Ensure that `AppTheme.MaterialAboutActivity` theme extends either of these themes, and apply primary & accent colours:
```
Theme.Mal.Light.DarkActionBar
Theme.Mal.Light.LightActionBar
Theme.Mal.Dark.LightActionBar
Theme.Mal.Dark.DarkActionBar
```
```xml
<style name="AppTheme.MaterialAboutActivity" parent="Theme.Mal.Light.DarkActionBar" >
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
```
## Screenshot
<img src="extras/example.png?raw=true">

View file

@ -1,7 +1,7 @@
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,android-24
- echo y | android update sdk --no-ui --all --filter build-tools-24.0.2
- 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.3
test:
override:

BIN
extras/example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

0
gradlew vendored Normal file → Executable file
View file

View file

@ -5,15 +5,14 @@ apply plugin: 'com.github.dcendents.android-maven'
group='com.github.eggheadgames'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionCode 7
versionName "1.3.1"
}
buildTypes {
release {
@ -29,8 +28,5 @@ android {
}
dependencies {
compile 'com.github.daniel-stoneuk:material-about-library:1.5.0'
compile('io.branch.sdk.android:library:2.5.7') {
exclude module: 'answers.shim'
}
compile 'com.github.daniel-stoneuk:material-about-library:2.2.1'
}

View file

@ -1,10 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eggheadgames.aboutbox">
package="com.eggheadgames.aboutbox">
<application android:label="@string/app_name">
<application>
<activity
android:name="com.eggheadgames.aboutbox.activity.AboutActivity"
android:theme="@style/AppTheme.MaterialAboutActivity" />
android:theme="@style/AppTheme.MaterialAboutActivity"/>
</application>

View file

@ -0,0 +1,109 @@
package com.eggheadgames.aboutbox;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;
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() {
//nothing
}
public static void getOpenFacebookIntent(Activity context, String name) {
try {
context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/" + name));
context.startActivity(intent);
} catch (Exception e) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" + name));
context.startActivity(intent);
} catch (Exception e1) {
Toast.makeText(context, R.string.egab_can_not_open, Toast.LENGTH_SHORT).show();
}
}
}
public static void startTwitter(Activity context, String name) {
try {
context.getPackageManager().getPackageInfo("com.twitter.android", 0);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=" + name));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
} catch (Exception e) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/" + name));
context.startActivity(intent);
} catch (Exception e1) {
Toast.makeText(context, R.string.egab_can_not_open, Toast.LENGTH_SHORT).show();
}
}
}
public static void openApp(Activity context, AboutConfig.BuildType buildType, String packageName) {
String appURI = null;
String webURI = null;
switch (buildType) {
case GOOGLE:
appURI = "market://details?id=" + packageName;
webURI = playStoreAppURI + packageName;
break;
case AMAZON:
appURI = "amzn://apps/android?p=" + packageName;
webURI = amznStoreAppURI + packageName;
break;
default:
//nothing
}
openApplication(context, appURI, webURI);
}
public static void openPublisher(Activity context, AboutConfig.BuildType buildType, String publisher, String packageName) {
String appURI = null;
String webURI = null;
switch (buildType) {
case GOOGLE:
// see:
// 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;
case AMAZON:
appURI = "amzn://apps/android?showAll=1&p=" + packageName;
webURI = "http://www.amazon.com/gp/mas/dl/android?showAll=1&p=" + packageName;
break;
default:
//nothing
}
openApplication(context, appURI, webURI);
}
public static void openApplication(Activity context, String appURI, String webURI) {
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(appURI)));
} catch (ActivityNotFoundException e1) {
try {
openHTMLPage(context, webURI);
} catch (ActivityNotFoundException e2) {
Toast.makeText(context, R.string.egab_can_not_open, Toast.LENGTH_SHORT).show();
}
}
}
public static void openHTMLPage(Activity context, String htmlPath) {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(htmlPath)));
}
}

View file

@ -8,11 +8,15 @@ public class AboutConfig {
public String appName;
public int appIcon;
public String version;
public String author;
public String extra;
public String extraTitle;
public String aboutLabelTitle;
public String logUiEventName;
public String facebookUserName;
public String twitterUserName;
public String webHomePage;
public String guideHtmlPath;
public String appPublisher;
public String companyHtmlPath;
public String privacyHtmlPath;
@ -20,9 +24,10 @@ public class AboutConfig {
public BuildType buildType;
public String packageName;
// custom analytics and dialog
// custom analytics, dialog and share
public IAnalytic analytics;
public IDialog dialog;
public IShare share;
// email
public String emailAddress;
@ -30,7 +35,6 @@ public class AboutConfig {
public String emailBody;
// share
public String shareMessageTitle;
public String shareMessage;
public String sharingTitle;

View file

@ -0,0 +1,9 @@
package com.eggheadgames.aboutbox;
import android.app.Activity;
public interface IShare {
void share(Activity activity);
}

View file

@ -1,18 +1,20 @@
package com.eggheadgames.aboutbox.activity;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import com.danielstone.materialaboutlibrary.MaterialAboutActivity;
import com.danielstone.materialaboutlibrary.model.MaterialAboutActionItem;
import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem;
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction;
import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem;
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard;
import com.danielstone.materialaboutlibrary.model.MaterialAboutList;
import com.danielstone.materialaboutlibrary.model.MaterialAboutTitleItem;
import com.eggheadgames.aboutbox.AboutBoxUtils;
import com.eggheadgames.aboutbox.AboutConfig;
import com.eggheadgames.aboutbox.IAnalytic;
import com.eggheadgames.aboutbox.R;
import com.eggheadgames.aboutbox.share.EmailUtil;
import com.eggheadgames.aboutbox.share.ShareUtil;
@ -21,6 +23,7 @@ public class AboutActivity extends MaterialAboutActivity {
public static void launch(Activity activity) {
Intent intent = new Intent(activity, AboutActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
activity.startActivity(intent);
}
@ -29,6 +32,18 @@ public class AboutActivity extends MaterialAboutActivity {
final AboutConfig config = AboutConfig.getInstance();
return new MaterialAboutList.Builder()
.addCard(buildGeneralInfoCard(config))
.addCard(buildSupportCard(config))
.addCard(buildShareCard(config))
.addCard(buildAboutCard(config))
.addCard(buildSocialNetworksCard(config))
.addCard(buildPrivacyCard(config))
.build();
}
@NonNull
private MaterialAboutCard buildGeneralInfoCard(AboutConfig config) {
MaterialAboutCard.Builder generalInfoCardBuilder = new MaterialAboutCard.Builder();
generalInfoCardBuilder.addItem(new MaterialAboutTitleItem.Builder()
@ -37,234 +52,222 @@ public class AboutActivity extends MaterialAboutActivity {
.build());
generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.version)
.text(R.string.egab_version)
.subText(config.version)
.build());
if (!TextUtils.isEmpty(config.author)) {
generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.egab_author)
.subText(config.author)
.build());
}
MaterialAboutCard.Builder supportCardBuilder = new MaterialAboutCard.Builder();
supportCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.contact_support)
.icon(R.drawable.ic_email_black)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
if (!TextUtils.isEmpty(config.extra) && !TextUtils.isEmpty(config.extraTitle)) {
generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(config.extraTitle)
.subTextHtml(config.extra)
.build());
}
return generalInfoCardBuilder.build();
}
@NonNull
private MaterialAboutCard buildSupportCard(final AboutConfig config) {
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
if (!TextUtils.isEmpty(config.guideHtmlPath)) {
card.addItem(itemHelper(R.string.egab_guide, R.drawable.ic_help_green,
new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
if (config.dialog == null) {
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.guideHtmlPath);
} else {
config.dialog.open(AboutActivity.this, config.guideHtmlPath, getString(R.string.egab_guide));
}
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_guide));
}
})
);
}
card.addItem(itemHelper(R.string.egab_contact_support, R.drawable.ic_email_black,
new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
EmailUtil.contactUs(AboutActivity.this);
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.contact_log_event));
}
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_contact_log_event));
}
})
.build());
}));
return card.build();
}
MaterialAboutCard.Builder shareCardBuilder = new MaterialAboutCard.Builder();
shareCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.leave_review)
.icon(R.drawable.ic_review)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@NonNull
private MaterialAboutCard buildShareCard(final AboutConfig config) {
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
if (config.buildType != null && !TextUtils.isEmpty(config.packageName)) {
card.addItem(itemHelper(R.string.egab_leave_review, R.drawable.ic_review,
new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.openApp(AboutActivity.this, config.buildType, config.packageName);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_review_log_event));
}
}));
}
card.addItem(itemHelper(R.string.egab_share, R.drawable.ic_share_black,
new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
openApp(config.packageName, config.buildType == AboutConfig.BuildType.GOOGLE);
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.review_log_event));
}
}
})
.build());
shareCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.share)
.icon(R.drawable.ic_share_black)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
ShareUtil.share(AboutActivity.this);
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.share_log_event));
}
}
})
.build());
MaterialAboutCard.Builder aboutCardBuilder = new MaterialAboutCard.Builder();
aboutCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.try_other_apps)
.icon(R.drawable.ic_try_other_apps)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
openPublisher(config.buildType == AboutConfig.BuildType.GOOGLE, config.appPublisher);
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.try_other_app_log_event));
}
}
})
.build());
aboutCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(config.aboutLabelTitle)
.icon(R.drawable.ic_about_black)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
if (config.dialog == null) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(config.companyHtmlPath)));
if (config.share == null) {
ShareUtil.share(AboutActivity.this);
} else {
config.dialog.open(AboutActivity.this, config.companyHtmlPath, config.aboutLabelTitle);
}
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, config.aboutLabelTitle);
config.share.share(AboutActivity.this);
}
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_share_log_event));
}
})
.build());
}));
return card.build();
}
MaterialAboutCard.Builder socialNetworksCardBuilder = new MaterialAboutCard.Builder();
socialNetworksCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.facebook_label)
.subText(config.facebookUserName)
.icon(R.drawable.ic_facebook_24)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
getOpenFacebookIntent(AboutActivity.this, config.facebookUserName);
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.facebook_log_event));
@NonNull
private MaterialAboutCard buildAboutCard(final AboutConfig config) {
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
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,
new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.openPublisher(AboutActivity.this, config.buildType,
config.appPublisher, config.packageName);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_try_other_app_log_event));
}
}
})
.build());
socialNetworksCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.twitter_label)
.subText(config.twitterUserName)
.icon(R.drawable.ic_twitter_24dp)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
startTwitter(AboutActivity.this, config.twitterUserName);
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.twitter_log_event));
}));
}
if (!TextUtils.isEmpty(config.companyHtmlPath) && !TextUtils.isEmpty(config.aboutLabelTitle)) {
card.addItem(new MaterialAboutActionItem.Builder()
.text(config.aboutLabelTitle)
.icon(R.drawable.ic_about_black)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
if (config.dialog == null) {
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.companyHtmlPath);
} else {
config.dialog.open(AboutActivity.this, config.companyHtmlPath, config.aboutLabelTitle);
}
logUIEventName(config.analytics, config.logUiEventName, config.aboutLabelTitle);
}
}
})
.build());
})
.build());
}
return card.build();
}
socialNetworksCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.web_label)
.subText(config.webHomePage.replace("https://", "").replace("http://", "").replace("/", ""))
.icon(R.drawable.ic_web_black_24dp)
.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.website_log_event));
@NonNull
private MaterialAboutCard buildSocialNetworksCard(final AboutConfig config) {
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
if (!TextUtils.isEmpty(config.facebookUserName)) {
card.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.egab_facebook_label)
.subText(config.facebookUserName)
.icon(R.drawable.ic_facebook_24)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.getOpenFacebookIntent(AboutActivity.this, config.facebookUserName);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_facebook_log_event));
}
}
})
.build());
MaterialAboutCard.Builder privacyCardBuilder = new MaterialAboutCard.Builder();
privacyCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.privacy_policy)
.icon(R.drawable.ic_privacy)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
if (config.dialog == null) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(config.privacyHtmlPath)));
} else {
config.dialog.open(AboutActivity.this, config.privacyHtmlPath, getString(R.string.privacy_policy));
})
.build());
}
if (!TextUtils.isEmpty(config.twitterUserName)) {
card.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.egab_twitter_label)
.subText(config.twitterUserName)
.icon(R.drawable.ic_twitter_24dp)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.startTwitter(AboutActivity.this, config.twitterUserName);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_twitter_log_event));
}
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.privacy_log_event));
})
.build());
}
if (!TextUtils.isEmpty(config.webHomePage)) {
card.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.egab_web_label)
.subText(config.webHomePage.replaceFirst("^https?://", "").replaceAll("/$", ""))
.icon(R.drawable.ic_web_black_24dp)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.webHomePage);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_website_log_event));
}
}
})
.build());
privacyCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.acknowledgment)
.icon(R.drawable.ic_acknowledgment)
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
@Override
public void onClick() {
if (config.dialog == null) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(config.acknowledgmentHtmlPath)));
} else {
config.dialog.open(AboutActivity.this, config.acknowledgmentHtmlPath, getString(R.string.acknowledgment));
})
.build());
}
return card.build();
}
@NonNull
private MaterialAboutCard buildPrivacyCard(final AboutConfig config) {
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
if (!TextUtils.isEmpty(config.privacyHtmlPath)) {
card.addItem(itemHelper(R.string.egab_privacy_policy, R.drawable.ic_privacy,
new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
if (config.dialog == null) {
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.privacyHtmlPath);
} else {
config.dialog.open(AboutActivity.this, config.privacyHtmlPath, getString(R.string.egab_privacy_policy));
}
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_privacy_log_event));
}
if (config.analytics != null) {
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.asknowledgment_log_event));
})
);
}
if (!TextUtils.isEmpty(config.acknowledgmentHtmlPath)) {
card.addItem(itemHelper(R.string.egab_acknowledgements, R.drawable.ic_acknowledgements,
new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
if (config.dialog == null) {
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.acknowledgmentHtmlPath);
} else {
config.dialog.open(AboutActivity.this, config.acknowledgmentHtmlPath, getString(R.string.egab_acknowledgements));
}
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_acknowledgements_log_event));
}
}
})
.build());
})
);
}
return card.build();
}
return new MaterialAboutList.Builder()
.addCard(generalInfoCardBuilder.build())
.addCard(supportCardBuilder.build())
.addCard(shareCardBuilder.build())
.addCard(aboutCardBuilder.build())
.addCard(socialNetworksCardBuilder.build())
.addCard(privacyCardBuilder.build())
private MaterialAboutActionItem itemHelper(int name, int icon, MaterialAboutItemOnClickAction clickAction) {
return new MaterialAboutActionItem.Builder()
.text(name)
.icon(icon)
.setOnClickAction(clickAction)
.build();
}
@Override
protected CharSequence getActivityTitle() {
return getString(R.string.about_screen_title);
return getString(R.string.egab_about_screen_title);
}
public static void getOpenFacebookIntent(Activity context, String name) {
Intent intent;
try {
context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/" + name));
} catch (Exception e) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" + name));
}
context.startActivity(intent);
}
public static void startTwitter(Activity context, String name) {
Intent intent;
try {
context.getPackageManager().getPackageInfo("com.twitter.android", 0);
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=" + name));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch (Exception e) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/" + name));
}
context.startActivity(intent);
}
public void openApp(String packageName, boolean googlePlay) {//true if Google Play, false if Amazon Store
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse((googlePlay ? "market://details?id=" : "amzn://apps/android?p=") + packageName)));
} catch (ActivityNotFoundException e1) {
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse((googlePlay ? "http://play.google.com/store/apps/details?id=" : "http://www.amazon.com/gp/mas/dl/android?p=") + packageName)));
} catch (ActivityNotFoundException e2) {
Toast.makeText(this, R.string.can_not_open, Toast.LENGTH_SHORT).show();
}
}
}
public void openPublisher(boolean googlePlay, String publisher) {//true if Google Play, false if Amazon Store
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse((googlePlay ? "market://search?q=pub:" : "amzn://apps/android?showAll=1&p=") + publisher)));
} catch (ActivityNotFoundException e1) {
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse((googlePlay ? "http://play.google.com/store/search?q=pub:" : "http://www.amazon.com/gp/mas/dl/android?showAll=1&p=") + publisher)));
} catch (ActivityNotFoundException e2) {
Toast.makeText(this, R.string.can_not_open, Toast.LENGTH_SHORT).show();
}
private void logUIEventName(IAnalytic analytics, String eventType, String eventValue) {
if (analytics != null) {
analytics.logUiEvent(eventType, eventValue);
}
}
}

View file

@ -3,9 +3,11 @@ package com.eggheadgames.aboutbox.share;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import com.eggheadgames.aboutbox.AboutConfig;
import com.eggheadgames.aboutbox.BuildConfig;
import com.eggheadgames.aboutbox.R;
public final class EmailUtil {
@ -18,26 +20,35 @@ public final class EmailUtil {
final Uri mailto = Uri.fromParts("mailto", config.emailAddress, null);
final String emailSubject;
String emailBody = config.emailBody;
if (TextUtils.isEmpty(emailBody)) {
String deviceInfo = "";
deviceInfo += "\n App version: " + config.version;
deviceInfo += "\n Android version: " + Build.VERSION.RELEASE + " (" + android.os.Build.VERSION.SDK_INT + ")";
deviceInfo += "\n Device: " + android.os.Build.MODEL + " (" + android.os.Build.PRODUCT + ")";
deviceInfo += "\n Platform: " + platformName(config.buildType);
if ("google".equals(BuildConfig.FLAVOR)) {
emailSubject = config.emailSubject + "G";
} else if ("amazon".equals(BuildConfig.FLAVOR)) {
emailSubject = config.emailSubject + "K";
} else {
emailSubject = config.emailSubject;
emailBody = activity.getString(R.string.egab_email_body_prompt) + "\n\n\n\n\n"
+ "---------------------------" + deviceInfo;
}
try {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, mailto);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
emailIntent.putExtra(Intent.EXTRA_TEXT, config.emailBody);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, config.emailSubject);
emailIntent.putExtra(Intent.EXTRA_TEXT, emailBody);
activity.startActivity(Intent.createChooser(emailIntent, "Send email..."));
} catch (Exception e) {
if (config.analytics != null) {
config.analytics.logException(e, false);
}
}
}
private static String platformName(AboutConfig.BuildType buildType) {
switch (buildType) {
case GOOGLE: return "Google Play";
case AMAZON: return "Amazon Kindle";
default: return "Unknown";
}
}
}

View file

@ -1,17 +1,12 @@
package com.eggheadgames.aboutbox.share;
import android.app.Activity;
import android.content.Intent;
import android.text.TextUtils;
import com.eggheadgames.aboutbox.AboutBoxUtils;
import com.eggheadgames.aboutbox.AboutConfig;
import io.branch.indexing.BranchUniversalObject;
import io.branch.referral.Branch;
import io.branch.referral.BranchError;
import io.branch.referral.SharingHelper;
import io.branch.referral.util.LinkProperties;
import io.branch.referral.util.ShareSheetStyle;
public final class ShareUtil {
private ShareUtil() {
@ -19,48 +14,29 @@ public final class ShareUtil {
}
public static void share(Activity activity) {
BranchUniversalObject branchUniversalObject = new BranchUniversalObject();
final AboutConfig config = AboutConfig.getInstance();
AboutConfig config = AboutConfig.getInstance();
ShareSheetStyle shareSheetStyle = new ShareSheetStyle(activity, config.shareMessageTitle,
config.shareMessage)
.setCopyUrlStyle(activity.getResources().getDrawable(android.R.drawable.ic_menu_send),
"Copy", "Added to clipboard")
.setMoreOptionStyle(activity.getResources().getDrawable(android.R.drawable.ic_menu_search), "Show more")
.addPreferredSharingOption(SharingHelper.SHARE_WITH.FACEBOOK)
.addPreferredSharingOption(SharingHelper.SHARE_WITH.EMAIL)
.setSharingTitle(config.sharingTitle);
Intent intent2 = new Intent();
intent2.setAction(Intent.ACTION_SEND);
intent2.setType("text/plain");
branchUniversalObject.showShareSheet(activity,
new LinkProperties(), shareSheetStyle, new Branch.BranchLinkShareListener() {
@Override
public void onShareLinkDialogLaunched() {
//nothing
}
String shareMessage = config.shareMessage;
@Override
public void onShareLinkDialogDismissed() {
if (config.analytics != null) {
config.analytics.logUiEvent("Share", "Dismissed");
}
}
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;
}
}
@Override
public void onLinkShareResponse(String sharedLink, String sharedChannel, BranchError error) {
if (config.analytics != null) {
if (error == null || TextUtils.isEmpty(error.getMessage())) {
config.analytics.logUiEvent("Share", sharedChannel);
} else {
config.analytics.logUiEvent("Share Failure", error.getMessage());
}
}
}
@Override
public void onChannelSelected(String channelName) {
//nothing
}
});
intent2.putExtra(Intent.EXTRA_TEXT, shareMessage);
activity.startActivity(Intent.createChooser(intent2, config.sharingTitle));
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#00c853"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,17h-2v-2h2v2zm2.07,-7.75l-0.9,0.92C13.45,12.9 13,13.5 13,15h-2v-0.5c0,-1.1 0.45,-2.1 1.17,-2.83l1.24,-1.26c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2H8c0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,0.88 -0.36,1.68 -0.93,2.25z"/>
</vector>

View file

@ -0,0 +1,26 @@
<resources>
<string name="egab_leave_review">Avaliar</string>
<string name="egab_contact_support">Contactar o Suporte</string>
<string name="egab_try_other_apps">Experimentar outras aplicações</string>
<string name="egab_version">Versão</string>
<string name="egab_author">Autor</string>
<string name="egab_facebook_label">Facebook</string>
<string name="egab_twitter_label">Twitter</string>
<string name="egab_web_label">Web</string>
<string name="egab_acknowledgements">Acknowledgements</string>
<string name="egab_privacy_policy">Política de Privacidade</string>
<string name="egab_about_screen_title">Sobre</string>
<string name="egab_share">Partilhar</string>
<string name="egab_contact_log_event">Contactos</string>
<string name="egab_review_log_event">Avalie</string>
<string name="egab_share_log_event">Partilhar</string>
<string name="egab_try_other_app_log_event">Experimentar outras aplicações</string>
<string name="egab_facebook_log_event">Facebook</string>
<string name="egab_twitter_log_event">Twitter</string>
<string name="egab_website_log_event">Website</string>
<string name="egab_privacy_log_event">Privacicidade</string>
<string name="egab_acknowledgements_log_event">Acknowledgements</string>
<string name="egab_can_not_open">Tu não tens nenhuma aplicação que possa abrir esta ligação</string>
<string name="egab_email_body_prompt">Digite sua pergunta aqui: </string>
<string name="egab_guide">Guia</string>
</resources>

View file

@ -1,25 +1,27 @@
<resources>
<string name="app_name">AboutBox</string>
<string name="leave_review">Leave Review</string>
<string name="contact_support">Contact Support</string>
<string name="try_other_apps">Try Other Apps</string>
<string name="version">Version</string>
<string name="facebook_label">Facebook</string>
<string name="twitter_label">Twitter</string>
<string name="web_label">Web</string>
<string name="acknowledgment">Acknowledgment</string>
<string name="privacy_policy">Privacy Policy</string>
<string name="about_screen_title">About</string>
<string name="share">Share</string>
<string name="contact_log_event">Contact</string>
<string name="review_log_event">Review</string>
<string name="share_log_event">Share</string>
<string name="try_other_app_log_event">Try Other Apps</string>
<string name="facebook_log_event">Facebook</string>
<string name="twitter_log_event">Twitter</string>
<string name="website_log_event">Website</string>
<string name="privacy_log_event">Privacy</string>
<string name="asknowledgment_log_event">Acknowledgement</string>
<string name="can_not_open">You don\'t have any app that can open this link</string>
<string name="egab_leave_review">Leave Review</string>
<string name="egab_contact_support">Contact Support</string>
<string name="egab_try_other_apps">Try Other Apps</string>
<string name="egab_version">Version</string>
<string name="egab_author">Author</string>
<string name="egab_facebook_label">Facebook</string>
<string name="egab_twitter_label">Twitter</string>
<string name="egab_web_label">Web</string>
<string name="egab_acknowledgements">Acknowledgements</string>
<string name="egab_privacy_policy">Privacy Policy</string>
<string name="egab_about_screen_title">About</string>
<string name="egab_share">Share</string>
<string name="egab_contact_log_event">Contact</string>
<string name="egab_review_log_event">Review</string>
<string name="egab_share_log_event">Share</string>
<string name="egab_try_other_app_log_event">Try Other Apps</string>
<string name="egab_facebook_log_event">Facebook</string>
<string name="egab_twitter_log_event">Twitter</string>
<string name="egab_website_log_event">Website</string>
<string name="egab_privacy_log_event">Privacy</string>
<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>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<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="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>