Rate Us feature added

This commit is contained in:
Ujjwal Agrawal 2018-02-24 17:36:54 +05:30
parent a7a2b51ceb
commit 4432f2ca1a
8 changed files with 18 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import android.accounts.AccountManager;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView; import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout; 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(); Toast.makeText(this, R.string.no_email_client, Toast.LENGTH_SHORT).show();
} }
return true; 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: case R.id.action_logout:
new AlertDialog.Builder(this) new AlertDialog.Builder(this)
.setMessage(R.string.logout_verification) .setMessage(R.string.logout_verification)

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -30,6 +30,11 @@
android:icon="@drawable/ic_feedback_black_24dp" android:icon="@drawable/ic_feedback_black_24dp"
android:title="@string/navigation_item_feedback"/> android:title="@string/navigation_item_feedback"/>
<item
android:id="@+id/action_rate"
android:icon="@drawable/ic_star_black_24dp"
android:title="@string/navigation_item_rate"/>
<item <item
android:id="@+id/action_logout" android:id="@+id/action_logout"
android:icon="@drawable/ic_exit_to_app_black_24dp" android:icon="@drawable/ic_exit_to_app_black_24dp"

View file

@ -225,4 +225,5 @@
<string name="notifications_thank_you_edit">Thank you for making an edit</string> <string name="notifications_thank_you_edit">Thank you for making an edit</string>
<string name="notifications_mention">%1$s mentioned you on %2$s.</string> <string name="notifications_mention">%1$s mentioned you on %2$s.</string>
<string name="toggle_view_button">Toggle view</string> <string name="toggle_view_button">Toggle view</string>
<string name="navigation_item_rate">Rate Us</string>
</resources> </resources>