mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +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)
|
||||
|
|
|
|||
BIN
app/src/main/res/drawable-hdpi/ic_star_black_24dp.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_star_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 440 B |
BIN
app/src/main/res/drawable-mdpi/ic_star_black_24dp.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_star_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 296 B |
BIN
app/src/main/res/drawable-xhdpi/ic_star_black_24dp.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_star_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 577 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 844 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -30,6 +30,11 @@
|
|||
android:icon="@drawable/ic_feedback_black_24dp"
|
||||
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
|
||||
android:id="@+id/action_logout"
|
||||
android:icon="@drawable/ic_exit_to_app_black_24dp"
|
||||
|
|
|
|||
|
|
@ -225,4 +225,5 @@
|
|||
<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="toggle_view_button">Toggle view</string>
|
||||
<string name="navigation_item_rate">Rate Us</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue