Skip to content

Commit

Permalink
Final Production 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsCalebJones committed May 26, 2018
1 parent dcda536 commit 174fab3
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ keystore.properties
mobile/keystore.properties
mobile/alpha/release/output.json
*.lnk
*.log
4 changes: 3 additions & 1 deletion mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ dependencies {
implementation 'com.afollestad.material-dialogs:commons:0.9.3.0'
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.github.MFlisar:GDPRDialog:1.0'

implementation 'com.github.ItsCalebJones:GDPRDialog:54231db'

annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.github.jrvansuita:MaterialAbout:0.2.1'
implementation 'com.github.mukeshsolanki:MarkdownView-Android:1.0.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
import me.calebjones.spacelaunchnow.utils.customtab.CustomTabActivityHelper;
import timber.log.Timber;

public class MainActivity extends BaseActivity implements GDPR.IGDPRCallback{
public class MainActivity extends BaseActivity implements GDPR.IGDPRCallback {

private static final String NAV_ITEM_ID = "navItemId";
private static ListPreferences listPreferences;
Expand Down Expand Up @@ -292,23 +292,23 @@ public void onFeedbackTapped() {
),
new DividerDrawerItem(),
new ExpandableDrawerItem().withName(R.string.get_help).withIcon(GoogleMaterial.Icon.gmd_account_box).withDescription(R.string.help_description).withIdentifier(20).withSelectable(false).withSubItems(
new SecondaryDrawerItem()
.withIcon(GoogleMaterial.Icon.gmd_info_outline)
.withName(R.string.whats_new)
.withDescription(R.string.whats_new_subtitle)
.withIdentifier(R.id.menu_new)
.withSelectable(false),
new SecondaryDrawerItem()
.withIcon(GoogleMaterial.Icon.gmd_account_box)
.withName(R.string.about).withDescription(R.string.about_subtitle)
.withIdentifier(R.id.about)
.withSelectable(false),
new SecondaryDrawerItem()
.withIcon(GoogleMaterial.Icon.gmd_feedback)
.withName(R.string.feedback)
.withDescription(R.string.feedback_subtitle)
.withIdentifier(R.id.menu_feedback)
.withSelectable(false)
new SecondaryDrawerItem()
.withIcon(GoogleMaterial.Icon.gmd_info_outline)
.withName(R.string.whats_new)
.withDescription(R.string.whats_new_subtitle)
.withIdentifier(R.id.menu_new)
.withSelectable(false),
new SecondaryDrawerItem()
.withIcon(GoogleMaterial.Icon.gmd_account_box)
.withName(R.string.about).withDescription(R.string.about_subtitle)
.withIdentifier(R.id.about)
.withSelectable(false),
new SecondaryDrawerItem()
.withIcon(GoogleMaterial.Icon.gmd_feedback)
.withName(R.string.feedback)
.withDescription(R.string.feedback_subtitle)
.withIdentifier(R.id.menu_feedback)
.withSelectable(false)
),
new DividerDrawerItem(),
new PrimaryDrawerItem().withName(R.string.settings)
Expand Down Expand Up @@ -466,7 +466,7 @@ public void run() {
configureAdState(GDPR.getInstance().getConsentState());
}

private void showRemoveAd(){
private void showRemoveAd() {
snackbar = Snackbar
.make(coordinatorLayout, R.string.upgrade_pro, Snackbar.LENGTH_INDEFINITE)
.setActionTextColor(ContextCompat.getColor(context, R.color.colorAccent))
Expand All @@ -492,7 +492,7 @@ private synchronized void showRemainingCount() {
String message = String.format("%s more times until rate pop-up", count);
Toast mToast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
mToast.setText(message);
if (BuildConfig.DEBUG){
if (BuildConfig.DEBUG) {
mToast.show();
}
}
Expand Down Expand Up @@ -537,7 +537,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
} else {
getMenuInflater().inflate(R.menu.main_menu, menu);
}
if(SupporterHelper.isSupporter()){
if (SupporterHelper.isSupporter()) {
menu.findItem(R.id.action_supporter).setVisible(false);
menu.removeItem(R.id.action_supporter);
}
Expand All @@ -559,11 +559,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
}

if (id == R.id.action_consent){
showGDPRIfNecessary(true, GDPRLocation.UNKNOWN);
if (id == R.id.action_consent) {
showGDPRIfNecessary(true, GDPRLocation.IN_EAA_OR_UNKNOWN);
}

if (id == R.id.action_supporter){
if (id == R.id.action_supporter) {
Intent intent = new Intent(this, SupporterActivity.class);
startActivity(intent);
return true;
Expand Down Expand Up @@ -813,7 +813,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}

private void showGDPRIfNecessary(boolean forceShow, GDPRLocation location) {
if (forceShow || location == GDPRLocation.EAA) {
if (forceShow || location == GDPRLocation.IN_EAA_OR_UNKNOWN) {
try {
GDPR.getInstance().showDialog(this, getGDPRSetup(), location);
} catch (IllegalStateException e) {
Expand All @@ -822,8 +822,9 @@ private void showGDPRIfNecessary(boolean forceShow, GDPRLocation location) {
}
}

private GDPRSetup getGDPRSetup(){
return new GDPRSetup(GDPRDefinitions.ADMOB,
private GDPRSetup getGDPRSetup() {

return new GDPRSetup(GDPRDefinitions.ADMOB,
GDPRDefinitions.FIREBASE_CRASH,
new GDPRNetwork("Fabric - Crashlytics",
"https://try.crashlytics.com/terms/",
Expand All @@ -836,12 +837,12 @@ private GDPRSetup getGDPRSetup(){
true,
false),
GDPRDefinitions.FIREBASE_ANALYTICS)
.withPrivacyPolicy("https://spacelaunchnow.me/app/privacy")
.withAllowNoConsent(false)
.withExplicitAgeConfirmation(true)
.withCheckRequestLocation(true)
.withBottomSheet(true)
.withForceSelection(true);
.withPrivacyPolicy("https://spacelaunchnow.me/app/privacy")
.withAllowNoConsent(false)
.withExplicitAgeConfirmation(true)
.withCheckRequestLocation(true)
.withBottomSheet(true)
.withForceSelection(true);
}

@Override
Expand All @@ -860,23 +861,24 @@ public void onConsentInfoUpdate(GDPRConsentState consentState, boolean isNewStat
bundle.putString("GDPR_Location", consentState.getLocation().name());
firebaseAnalytics.logEvent("SLN_GDPR_EVENT", bundle);
firebaseAnalytics.setUserProperty("gdpr_consent", consent.name());
firebaseAnalytics.setUserProperty("gdpr_location", consentState.getLocation().name());
firebaseAnalytics.setUserProperty("gdpr_location", consentState.getLocation().name());
// user just selected this consent, do whatever you want...
switch (consent) {
case UNKNOWN:
// never happens!
break;
case NO_CONSENT:
if (!SupporterHelper.isSupporter()) {
Intent intent = new Intent(this, SupporterActivity.class);
if (!SupporterHelper.isSupporter()) {
Intent intent = new Intent(this, SupporterActivity.class);
startActivity(intent);
}
firebaseAnalytics.setAnalyticsCollectionEnabled(false);
break;
case NON_PERSONAL_CONSENT_ONLY:

firebaseAnalytics.setAnalyticsCollectionEnabled(true);
break;
case PERSONAL_CONSENT:
firebaseAnalytics.setAnalyticsCollectionEnabled(true);
break;
}
} else {
Expand All @@ -893,6 +895,7 @@ public void onConsentInfoUpdate(GDPRConsentState consentState, boolean isNewStat
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false);
break;
case NON_PERSONAL_CONSENT_ONLY:
firebaseAnalytics.setAnalyticsCollectionEnabled(true);
break;
case PERSONAL_CONSENT:
// user restarted activity and consent was already given...
Expand All @@ -907,11 +910,11 @@ private void configureAdState(GDPRConsentState consentState) {
boolean allowAds = true;
GDPRConsent consent = consentState.getConsent();

if (consentState.getLocation() == GDPRLocation.EAA && consent == GDPRConsent.UNKNOWN){
if (consentState.getLocation() == GDPRLocation.IN_EAA_OR_UNKNOWN && consent == GDPRConsent.UNKNOWN) {
allowAds = false;
}

if (consent == GDPRConsent.NO_CONSENT || consent == GDPRConsent.NON_PERSONAL_CONSENT_ONLY){
if (consent == GDPRConsent.NO_CONSENT || consent == GDPRConsent.NON_PERSONAL_CONSENT_ONLY) {
allowsPersonalAds = false;
}

Expand Down
1 change: 0 additions & 1 deletion mobile/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@
<string name="gdpr_type_cloud_database">cloud database</string>
<string name="gdpr_type_crash">crash reporting</string>
<string name="gdpr_type_analytics">analytics reporting</string>
<string name="gdpr_dialog_question">Can we continue to use your data for these purposes%1$s? \n\n(You may continue to use the application no matter your choice.)</string>

<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
Expand Down
4 changes: 2 additions & 2 deletions mobile/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu May 24 16:49:50 EDT 2018
AI_VERSION_CODE=61
#Sat May 26 11:08:24 EDT 2018
AI_VERSION_CODE=63
4 changes: 2 additions & 2 deletions wear/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu May 24 16:49:50 EDT 2018
AI_VERSION_CODE=160
#Sat May 26 11:08:25 EDT 2018
AI_VERSION_CODE=162

0 comments on commit 174fab3

Please sign in to comment.