diff --git a/xwords4/android/XWords4/res/menu/games_list_menu.xml b/xwords4/android/XWords4/res/menu/games_list_menu.xml index d3d0cc658..4af9b6ea4 100644 --- a/xwords4/android/XWords4/res/menu/games_list_menu.xml +++ b/xwords4/android/XWords4/res/menu/games_list_menu.xml @@ -16,6 +16,11 @@ android:icon="@drawable/prefs__gen" android:showAsAction="ifRoom" /> + + + + + Rate Crosswords + Google Play app not found diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index 7f52fc85c..2d3f00999 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -710,7 +710,12 @@ public class GamesList extends XWExpandableListActivity Utils.setItemVisible( menu, R.id.games_game_move, (1 < m_adapter.getGroupCount() && 0 < nGamesSelected) ); - Utils.setItemVisible( menu, R.id.games_game_reset, 0 < nGamesSelected ); + Utils.setItemVisible( menu, R.id.games_game_reset, + 0 < nGamesSelected ); + + // Hide rate-me if not a google play app + enable = nothingSelected && Utils.isGooglePlayApp( this ); + Utils.setItemVisible( menu, R.id.games_menu_rateme, enable ); m_menuPrepared = super.onPrepareOptionsMenu( menu ); } else { @@ -770,6 +775,16 @@ public class GamesList extends XWExpandableListActivity Utils.launchSettings( this ); break; + case R.id.games_menu_rateme: + String str = String.format( "market://details?id=%s", + getPackageName() ); + try { + startActivity( new Intent( Intent.ACTION_VIEW, Uri.parse( str ) ) ); + } catch ( android.content.ActivityNotFoundException anf ) { + showOKOnlyDialog( R.string.no_market ); + } + break; + case R.id.games_menu_about: showAboutDialog(); break; @@ -1389,10 +1404,11 @@ public class GamesList extends XWExpandableListActivity public static Intent makeRematchIntent( Context context, CurGameInfo gi, long rowid ) { - Intent intent = makeSelfIntent( context ); + Intent intent = null; if ( CurGameInfo.DeviceRole.SERVER_STANDALONE == gi.serverRole ) { - intent.putExtra( REMATCH_ROWID_EXTRA, rowid ); + intent = makeSelfIntent( context ) + .putExtra( REMATCH_ROWID_EXTRA, rowid ); } else { Utils.notImpl( context ); }