-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shintaro Katafuchi
committed
Jun 28, 2015
1 parent
41be586
commit 45cbdad
Showing
4 changed files
with
68 additions
and
48 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
25 changes: 25 additions & 0 deletions
25
library/src/main/java/hotchemi/android/rate/IntentHelper.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,25 @@ | ||
package hotchemi.android.rate; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
import static hotchemi.android.rate.UriHelper.getGooglePlay; | ||
import static hotchemi.android.rate.UriHelper.isPackageExists; | ||
|
||
final class IntentHelper { | ||
|
||
private static final String GOOGLE_PLAY_PACKAGE_NAME = "com.android.vending"; | ||
|
||
private IntentHelper() { | ||
} | ||
|
||
static Intent createIntentForGooglePlay(Context context) { | ||
String packageName = context.getPackageName(); | ||
Intent intent = new Intent(Intent.ACTION_VIEW, getGooglePlay(packageName)); | ||
if (isPackageExists(context, GOOGLE_PLAY_PACKAGE_NAME)) { | ||
intent.setPackage(GOOGLE_PLAY_PACKAGE_NAME); | ||
} | ||
return intent; | ||
} | ||
|
||
} |
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