This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from alexstyl/develop
Release 6.0 - Crash fixes & Paypal Donations
- Loading branch information
Showing
47 changed files
with
558 additions
and
2,661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-560 Bytes
(88%)
common/src/main/res/mipmap-hdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-451 Bytes
(85%)
common/src/main/res/mipmap-mdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-960 Bytes
(86%)
common/src/main/res/mipmap-xhdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-733 Bytes
(93%)
common/src/main/res/mipmap-xxhdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-630 Bytes
(96%)
common/src/main/res/mipmap-xxxhdpi/ic_launcher.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 0 additions & 144 deletions
144
mobile/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl
This file was deleted.
Oops, something went wrong.
103 changes: 103 additions & 0 deletions
103
mobile/src/main/java/com/alexstyl/specialdates/ExternalNavigator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
package com.alexstyl.specialdates; | ||
|
||
import android.app.Activity; | ||
import android.content.ActivityNotFoundException; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.widget.Toast; | ||
|
||
import com.alexstyl.specialdates.analytics.Analytics; | ||
import com.alexstyl.specialdates.analytics.Screen; | ||
import com.alexstyl.specialdates.util.Utils; | ||
import com.novoda.simplechromecustomtabs.SimpleChromeCustomTabs; | ||
|
||
public class ExternalNavigator { | ||
|
||
public static final Uri GOOGLE_PLUS_COMMUNITY = Uri.parse("https://plus.google.com/u/0/communities/112144353599130693487"); | ||
private static final String GOOGLE_PLUS_PACKAGE_NAME = "com.google.android.apps.plus"; | ||
private static final String NO_FRAGMENT = null; | ||
private static final Intent PLAY_STORE_INTENT; | ||
|
||
static { | ||
Uri playstoreUri = createPlayStoreUri(); | ||
PLAY_STORE_INTENT = new Intent(Intent.ACTION_VIEW, playstoreUri); | ||
} | ||
|
||
private static Uri createPlayStoreUri() { | ||
String packageName = MementoApplication.getContext().getPackageName(); | ||
return Uri.parse("market://details?id=" + packageName); | ||
} | ||
|
||
private final Activity activity; | ||
private final Analytics analytics; | ||
|
||
public ExternalNavigator(Activity activity, Analytics analytics) { | ||
this.activity = activity; | ||
this.analytics = analytics; | ||
SimpleChromeCustomTabs.initialize(activity); | ||
} | ||
|
||
public boolean canGoToPlayStore() { | ||
return canResolveIntent(PLAY_STORE_INTENT); | ||
} | ||
|
||
public void toPlayStore() { | ||
try { | ||
activity.startActivity(PLAY_STORE_INTENT); | ||
analytics.trackScreen(Screen.PLAY_STORE); | ||
} catch (ActivityNotFoundException e) { | ||
ErrorTracker.track(e); | ||
} | ||
} | ||
|
||
public void toGooglePlusCommunityBrowser() { | ||
try { | ||
Intent intent = new Intent(Intent.ACTION_VIEW); | ||
intent.setData(GOOGLE_PLUS_COMMUNITY); | ||
activity.startActivity(intent); | ||
} catch (ActivityNotFoundException e) { | ||
ErrorTracker.track(e); | ||
} | ||
} | ||
|
||
public void toGooglePlusCommunityApp() { | ||
try { | ||
Intent intent = new Intent(Intent.ACTION_VIEW); | ||
intent.setPackage(GOOGLE_PLUS_PACKAGE_NAME); | ||
intent.setData(GOOGLE_PLUS_COMMUNITY); | ||
activity.startActivity(intent); | ||
analytics.trackScreen(Screen.GOOGLE_PLUS_COMMUNITY); | ||
} catch (ActivityNotFoundException e) { | ||
ErrorTracker.track(e); | ||
} | ||
} | ||
|
||
public boolean canGoToEmailSupport() { | ||
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "to", NO_FRAGMENT)); | ||
return canResolveIntent(emailIntent); | ||
} | ||
|
||
public void toEmailSupport() { | ||
try { | ||
Intent intent = Utils.getSupportEmailIntent(activity); | ||
activity.startActivity(intent); | ||
analytics.trackScreen(Screen.EMAIL_SUPPORT); | ||
} catch (ActivityNotFoundException ex) { | ||
Toast.makeText(activity, R.string.no_app_found, Toast.LENGTH_SHORT).show(); | ||
ErrorTracker.track(ex); | ||
} | ||
|
||
} | ||
|
||
public void connectTo(Activity activity) { | ||
SimpleChromeCustomTabs.getInstance().connectTo(activity); | ||
} | ||
|
||
public void disconnectTo(Activity activity) { | ||
SimpleChromeCustomTabs.getInstance().disconnectFrom(activity); | ||
} | ||
|
||
private boolean canResolveIntent(Intent intent) { | ||
return activity.getPackageManager().resolveActivity(intent, 0) != null; | ||
} | ||
} |
Oops, something went wrong.