mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 05:13:53 +01:00
Rate Us feature added
This commit is contained in:
parent
a7a2b51ceb
commit
4432f2ca1a
8 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import android.accounts.AccountManager;
|
|||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.NavigationView;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
|
|
@ -132,6 +133,17 @@ public abstract class NavigationBaseActivity extends BaseActivity
|
|||
Toast.makeText(this, R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return true;
|
||||
case R.id.action_rate:
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
final String appPackageName = getPackageName();
|
||||
Toast.makeText(this, appPackageName, Toast.LENGTH_SHORT).show();
|
||||
try {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
|
||||
}
|
||||
catch (android.content.ActivityNotFoundException anfe) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
|
||||
}
|
||||
return true;
|
||||
case R.id.action_logout:
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage(R.string.logout_verification)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue