From 4d24fd38f57dd3b2cecc4d8374776b6fe78ce1dc Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 22 Jul 2016 15:59:50 -0700 Subject: [PATCH] disable delete context menuitem when game open --- .../src/org/eehouse/android/xw4/GamesListDelegate.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java index df02cef41..a38f6a1d7 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java @@ -1568,16 +1568,18 @@ public class GamesListDelegate extends ListDelegateBase Utils.setItemVisible( menu, hideId, false ); if ( null != item ) { - enable = BoardDelegate.rematchSupported( m_activity, - item.getRowID() ); + long rowID = item.getRowID(); + enable = BoardDelegate.rematchSupported( m_activity, rowID ); Utils.setItemVisible( menu, R.id.games_game_rematch, enable ); enable = item.getSummary().isMultiGame() && (BuildConfig.DEBUG || XWPrefs.getDebugEnabled( m_activity )); Utils.setItemVisible( menu, R.id.games_game_invites, enable ); + + enable = !m_launchedGames.contains( rowID ); + Utils.setItemVisible( menu, R.id.games_game_delete, enable ); } } - } public boolean onContextItemSelected( MenuItem item )