From c294ad45cfe2236958c2398660b3747409da58e8 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 1 Oct 2013 07:48:58 -0700 Subject: [PATCH] don't recomment tapping the pts area of tray when it's not visible --- .../src/org/eehouse/android/xw4/BoardActivity.java | 11 +++++++++-- .../XWords4/src/org/eehouse/android/xw4/XWApp.java | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index 0c21aa5d3..91690df21 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -772,8 +772,15 @@ public class BoardActivity extends XWActivity int id = item.getItemId(); switch ( id ) { case R.id.board_menu_done: - showNotAgainDlgThen( R.string.not_again_done, - R.string.key_notagain_done, COMMIT_ACTION ); + int nTiles = XwJNI.model_getNumTilesInTray( m_jniGamePtr, + m_view.getCurPlayer() ); + DbgUtils.logf( "getNumTilesInTray=>%d", nTiles ); + if ( XWApp.MAX_TRAY_TILES > nTiles ) { + showNotAgainDlgThen( R.string.not_again_done, + R.string.key_notagain_done, COMMIT_ACTION ); + } else { + dlgButtonClicked( COMMIT_ACTION, AlertDialog.BUTTON_POSITIVE ); + } break; case R.id.board_menu_trade_commit: diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java index 795517028..2c5caf68c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java @@ -40,6 +40,7 @@ public class XWApp extends Application { public static final boolean UDP_ENABLED = true; public static final String SMS_PUBLIC_HEADER = "-XW4"; + public static final int MAX_TRAY_TILES = 7; // comtypes.h private static UUID s_UUID = null; private static Boolean s_onEmulator = null;