mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
add rate-me menu
This commit is contained in:
parent
cb9f095d93
commit
acb090154d
3 changed files with 27 additions and 3 deletions
|
@ -16,6 +16,11 @@
|
||||||
android:icon="@drawable/prefs__gen"
|
android:icon="@drawable/prefs__gen"
|
||||||
android:showAsAction="ifRoom"
|
android:showAsAction="ifRoom"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<item android:id="@+id/games_menu_rateme"
|
||||||
|
android:title="@string/menu_rateme"
|
||||||
|
/>
|
||||||
|
|
||||||
<item android:id="@+id/games_menu_dicts"
|
<item android:id="@+id/games_menu_dicts"
|
||||||
android:title="@string/gamel_menu_dicts"
|
android:title="@string/gamel_menu_dicts"
|
||||||
android:icon="@drawable/dict__gen"
|
android:icon="@drawable/dict__gen"
|
||||||
|
|
|
@ -2197,4 +2197,7 @@
|
||||||
browsers for viewing the wordlists downloads page, DO NOT choose
|
browsers for viewing the wordlists downloads page, DO NOT choose
|
||||||
Firefox. Some versions have a bug that can cause the wordlists to
|
Firefox. Some versions have a bug that can cause the wordlists to
|
||||||
be lost.</string>
|
be lost.</string>
|
||||||
|
|
||||||
|
<string name="menu_rateme">Rate Crosswords</string>
|
||||||
|
<string name="no_market">Google Play app not found</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -710,7 +710,12 @@ public class GamesList extends XWExpandableListActivity
|
||||||
Utils.setItemVisible( menu, R.id.games_game_move,
|
Utils.setItemVisible( menu, R.id.games_game_move,
|
||||||
(1 < m_adapter.getGroupCount()
|
(1 < m_adapter.getGroupCount()
|
||||||
&& 0 < nGamesSelected) );
|
&& 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 );
|
m_menuPrepared = super.onPrepareOptionsMenu( menu );
|
||||||
} else {
|
} else {
|
||||||
|
@ -770,6 +775,16 @@ public class GamesList extends XWExpandableListActivity
|
||||||
Utils.launchSettings( this );
|
Utils.launchSettings( this );
|
||||||
break;
|
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:
|
case R.id.games_menu_about:
|
||||||
showAboutDialog();
|
showAboutDialog();
|
||||||
break;
|
break;
|
||||||
|
@ -1389,10 +1404,11 @@ public class GamesList extends XWExpandableListActivity
|
||||||
public static Intent makeRematchIntent( Context context, CurGameInfo gi,
|
public static Intent makeRematchIntent( Context context, CurGameInfo gi,
|
||||||
long rowid )
|
long rowid )
|
||||||
{
|
{
|
||||||
Intent intent = makeSelfIntent( context );
|
Intent intent = null;
|
||||||
|
|
||||||
if ( CurGameInfo.DeviceRole.SERVER_STANDALONE == gi.serverRole ) {
|
if ( CurGameInfo.DeviceRole.SERVER_STANDALONE == gi.serverRole ) {
|
||||||
intent.putExtra( REMATCH_ROWID_EXTRA, rowid );
|
intent = makeSelfIntent( context )
|
||||||
|
.putExtra( REMATCH_ROWID_EXTRA, rowid );
|
||||||
} else {
|
} else {
|
||||||
Utils.notImpl( context );
|
Utils.notImpl( context );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue