Skip to content

Commit

Permalink
Merged '5fdc829' from release-2.4: Link to amazon store instead of pl…
Browse files Browse the repository at this point in the history
…ay when amazon device
  • Loading branch information
timrae committed Jan 30, 2015
2 parents 1ff7b50 + 5fdc829 commit bce3cdb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/AnkiDroidApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ public static boolean isChromebook() {
return android.os.Build.BRAND.equalsIgnoreCase("chromium") || android.os.Build.MANUFACTURER.equalsIgnoreCase("chromium");
}

public static boolean isKindle() {
return Build.BRAND.equalsIgnoreCase("amazon") || Build.MANUFACTURER.equalsIgnoreCase("amazon");
}


/**
* Convenience method for accessing Shared preferences
Expand Down
10 changes: 8 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/anki/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,14 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onClick(View arg0) {
if (mType == TYPE_ABOUT) {
Info.this.startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("market://details?id=com.ichi2.anki")));
if (AnkiDroidApp.isKindle()) {
Intent intent = new Intent("android.intent.action.VIEW",
Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=com.ichi2.anki"));
startActivity(intent);
} else {
Info.this.startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse("market://details?id=com.ichi2.anki")));
}
return;
}
setResult(RESULT_OK);
Expand Down

0 comments on commit bce3cdb

Please sign in to comment.