From de2c938f41f195fb1ea25baffd1691564dcdb418 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 7 Sep 2013 00:31:55 -0700 Subject: [PATCH 1/8] stop menu button (or "action bar overflow") from being invisible on tablet devices. --- xwords4/android/XWords4/AndroidManifest.xml | 1 - xwords4/android/XWords4/res/layout/board.xml | 1 + .../XWords4/src/org/eehouse/android/xw4/BoardActivity.java | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/AndroidManifest.xml b/xwords4/android/XWords4/AndroidManifest.xml index 644834e4a..88740d022 100644 --- a/xwords4/android/XWords4/AndroidManifest.xml +++ b/xwords4/android/XWords4/AndroidManifest.xml @@ -107,7 +107,6 @@ /> diff --git a/xwords4/android/XWords4/res/layout/board.xml b/xwords4/android/XWords4/res/layout/board.xml index a6acf5fb5..a4770fac5 100644 --- a/xwords4/android/XWords4/res/layout/board.xml +++ b/xwords4/android/XWords4/res/layout/board.xml @@ -1,6 +1,7 @@ Date: Sat, 7 Sep 2013 08:16:44 -0700 Subject: [PATCH 2/8] up version strings --- xwords4/android/XWords4/AndroidManifest.xml | 2 +- xwords4/android/XWords4/res/raw/changes | 7 +++---- xwords4/android/XWords4/res/values/app_name.xml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/xwords4/android/XWords4/AndroidManifest.xml b/xwords4/android/XWords4/AndroidManifest.xml index 88740d022..0693bd4c7 100644 --- a/xwords4/android/XWords4/AndroidManifest.xml +++ b/xwords4/android/XWords4/AndroidManifest.xml @@ -22,7 +22,7 @@ to come from a domain that you own or have control over. --> diff --git a/xwords4/android/XWords4/res/raw/changes b/xwords4/android/XWords4/res/raw/changes index ce04d4a73..34f5ebf1f 100644 --- a/xwords4/android/XWords4/res/raw/changes +++ b/xwords4/android/XWords4/res/raw/changes @@ -5,17 +5,16 @@ -Crosswords 4.4 beta 65 release +Crosswords 4.4 beta 66 release

New with this release

    -
  • Fix crash upgrading directly from two-year-old version. C'mon, - people!
  • +
  • Fix menu missing on some tablets

Next up

    -
  • Improve communication with relay, part 2
  • +
  • Improve communication with relay, part 2. (Really, I'm almost done!)

(The full changelog diff --git a/xwords4/android/XWords4/res/values/app_name.xml b/xwords4/android/XWords4/res/values/app_name.xml index 0760f9156..a21423989 100644 --- a/xwords4/android/XWords4/res/values/app_name.xml +++ b/xwords4/android/XWords4/res/values/app_name.xml @@ -1,5 +1,5 @@ - 4.4 beta 65 + 4.4 beta 66 From 04eeebc3a41b9349c263e93e091b69cd0b9a85c4 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 8 Sep 2013 19:08:58 -0700 Subject: [PATCH 3/8] fix so still compiles when chat feature is disabled --- xwords4/android/XWords4/jni/utilwrapper.c | 4 ++++ xwords4/android/XWords4/jni/xwjni.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/xwords4/android/XWords4/jni/utilwrapper.c b/xwords4/android/XWords4/jni/utilwrapper.c index d29d610c0..d0f82d6a7 100644 --- a/xwords4/android/XWords4/jni/utilwrapper.c +++ b/xwords4/android/XWords4/jni/utilwrapper.c @@ -446,6 +446,7 @@ and_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi, return result; } +#ifdef XWFEATURE_CHAT static void and_util_showChat( XW_UtilCtxt* uc, const XP_UCHAR const* msg ) { @@ -455,6 +456,7 @@ and_util_showChat( XW_UtilCtxt* uc, const XP_UCHAR const* msg ) deleteLocalRef( env, jmsg ); UTIL_CBK_TAIL(); } +#endif static void and_util_remSelected(XW_UtilCtxt* uc) @@ -672,7 +674,9 @@ makeUtil( MPFORMAL JNIEnv** envp, jobject jutil, CurGameInfo* gi, SET_PROC(makeEmptyDict); SET_PROC(getUserString); SET_PROC(warnIllegalWord); +#ifdef XWFEATURE_CHAT SET_PROC(showChat); +#endif SET_PROC(remSelected); #ifndef XWFEATURE_MINIWIN diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index 535405ece..d1139c35e 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -1362,6 +1362,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_server_1endGame XWJNI_END(); } +#ifdef XWFEATURE_CHAT JNIEXPORT void JNICALL Java_org_eehouse_android_xw4_jni_XwJNI_server_1sendChat ( JNIEnv* env, jclass C, jint gamePtr, jstring jmsg ) @@ -1373,6 +1374,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_server_1sendChat (*env)->ReleaseStringUTFChars( env, jmsg, msg ); XWJNI_END(); } +#endif #ifdef XWFEATURE_WALKDICT //////////////////////////////////////////////////////////// From 5d7cc9e9e8c9310a6adc4779349ca4bb462b4a06 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 8 Sep 2013 19:09:49 -0700 Subject: [PATCH 4/8] disable chat, and include reason in change log --- xwords4/android/XWords4/jni/Android.mk | 1 - xwords4/android/XWords4/res/raw/changes | 4 ++ .../eehouse/android/xw4/BoardActivity.java | 58 ++++++++++++------- .../src/org/eehouse/android/xw4/XWApp.java | 1 + 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/xwords4/android/XWords4/jni/Android.mk b/xwords4/android/XWords4/jni/Android.mk index 2c72a0f92..18203564a 100644 --- a/xwords4/android/XWords4/jni/Android.mk +++ b/xwords4/android/XWords4/jni/Android.mk @@ -17,7 +17,6 @@ local_DEFINES += \ -DXWFEATURE_SMS \ -DXWFEATURE_COMMSACK \ -DXWFEATURE_TURNCHANGENOTIFY \ - -DXWFEATURE_CHAT \ -DCOMMS_XPORT_FLAGSPROC \ -DKEY_SUPPORT \ -DXWFEATURE_CROSSHAIRS \ diff --git a/xwords4/android/XWords4/res/raw/changes b/xwords4/android/XWords4/res/raw/changes index 34f5ebf1f..5469751b3 100644 --- a/xwords4/android/XWords4/res/raw/changes +++ b/xwords4/android/XWords4/res/raw/changes @@ -10,6 +10,10 @@

New with this release

  • Fix menu missing on some tablets
  • + +
  • Disable in-game Chat feature. (It has bugs that cause games to + stop syncing moves. I&ll fix eventually. Let me know if you + use this feature and I&ll up the priority.)

Next up

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 bc8cf5718..26d854451 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -127,7 +127,7 @@ public class BoardActivity extends XWActivity private Button m_exchCommmitButton; private Button m_exchCancelButton; - private ArrayList m_pendingChats = new ArrayList(); + private ArrayList m_pendingChats; private String m_dlgBytes = null; private EditText m_passwdEdit = null; @@ -512,6 +512,10 @@ public class BoardActivity extends XWActivity requestWindowFeature( Window.FEATURE_NO_TITLE ); } + if ( XWApp.CHAT_SUPPORTED ) { + m_pendingChats = new ArrayList(); + } + m_utils = new BoardUtilCtxt(); m_jniu = JNIUtilsImpl.get( this ); setContentView( R.layout.board ); @@ -601,10 +605,12 @@ public class BoardActivity extends XWActivity if ( Activity.RESULT_CANCELED != resultCode ) { switch ( requestCode ) { case CHAT_REQUEST: - String msg = data.getStringExtra( INTENT_KEY_CHAT ); - if ( null != msg && msg.length() > 0 ) { - m_pendingChats.add( msg ); - trySendChats(); + if ( XWApp.CHAT_SUPPORTED ) { + String msg = data.getStringExtra( INTENT_KEY_CHAT ); + if ( null != msg && msg.length() > 0 ) { + m_pendingChats.add( msg ); + trySendChats(); + } } break; case BT_INVITE_RESULT: @@ -1660,13 +1666,15 @@ public class BoardActivity extends XWActivity @Override public void showChat( final String msg ) { - post( new Runnable() { - public void run() { - DBUtils.appendChatHistory( BoardActivity.this, - m_rowid, msg, false ); - startChatActivity(); - } - } ); + if ( XWApp.CHAT_SUPPORTED ) { + post( new Runnable() { + public void run() { + DBUtils.appendChatHistory( BoardActivity.this, + m_rowid, msg, false ); + startChatActivity(); + } + } ); + } } } // class BoardUtilCtxt @@ -1846,10 +1854,12 @@ public class BoardActivity extends XWActivity R.string.not_again_undo, R.string.key_notagain_undo, UNDO_ACTION ); - m_toolbar.setListener( Toolbar.BUTTON_CHAT, - R.string.not_again_chat, - R.string.key_notagain_chat, - CHAT_ACTION ); + if ( XWApp.CHAT_SUPPORTED ) { + m_toolbar.setListener( Toolbar.BUTTON_CHAT, + R.string.not_again_chat, + R.string.key_notagain_chat, + CHAT_ACTION ); + } } // populateToolbar private OnDismissListener makeODLforBlocking( final int id ) @@ -1933,9 +1943,11 @@ public class BoardActivity extends XWActivity private void startChatActivity() { - Intent intent = new Intent( this, ChatActivity.class ); - intent.putExtra( GameUtils.INTENT_KEY_ROWID, m_rowid ); - startActivityForResult( intent, CHAT_REQUEST ); + if ( XWApp.CHAT_SUPPORTED ) { + Intent intent = new Intent( this, ChatActivity.class ); + intent.putExtra( GameUtils.INTENT_KEY_ROWID, m_rowid ); + startActivityForResult( intent, CHAT_REQUEST ); + } } private void waitCloseGame( boolean save ) @@ -1979,7 +1991,7 @@ public class BoardActivity extends XWActivity private void trySendChats() { - if ( null != m_jniThread ) { + if ( XWApp.CHAT_SUPPORTED && null != m_jniThread ) { Iterator iter = m_pendingChats.iterator(); while ( iter.hasNext() ) { m_jniThread.handle( JNICmd.CMD_SENDCHAT, iter.next() ); @@ -2026,7 +2038,8 @@ public class BoardActivity extends XWActivity m_toolbar.update( Toolbar.BUTTON_UNDO, m_gsi.canRedo ); m_toolbar.update( Toolbar.BUTTON_HINT_PREV, m_gsi.canHint ); m_toolbar.update( Toolbar.BUTTON_HINT_NEXT, m_gsi.canHint ); - m_toolbar.update( Toolbar.BUTTON_CHAT, m_gsi.gameIsConnected ); + m_toolbar.update( Toolbar.BUTTON_CHAT, + XWApp.CHAT_SUPPORTED && m_gsi.gameIsConnected ); m_toolbar.update( Toolbar.BUTTON_BROWSE_DICT, null != m_gi.dictName( m_view.getCurPlayer() ) ); } @@ -2048,7 +2061,8 @@ public class BoardActivity extends XWActivity hideShowItem( menu, R.id.board_menu_undo_current, m_gsi.canRedo ); hideShowItem( menu, R.id.board_menu_hint_prev, m_gsi.canHint ); hideShowItem( menu, R.id.board_menu_hint_next, m_gsi.canHint ); - hideShowItem( menu, R.id.board_menu_chat, m_gsi.gameIsConnected ); + hideShowItem( menu, R.id.board_menu_chat, + XWApp.CHAT_SUPPORTED && m_gsi.gameIsConnected ); } } 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 1f0790181..6ace129e7 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java @@ -31,6 +31,7 @@ public class XWApp extends Application { public static final boolean BTSUPPORTED = false; public static final boolean SMSSUPPORTED = true; public static final boolean GCMSUPPORTED = true; + public static final boolean CHAT_SUPPORTED = false; public static final boolean ATTACH_SUPPORTED = true; public static final boolean REMATCH_SUPPORTED = false; public static final boolean DEBUG = false; From 4c3620782240ba7b01f93071120691a3b327adbf Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 15 Aug 2013 22:20:44 -0700 Subject: [PATCH 5/8] comment out toast that's showing on every connection -- too annoying --- .../src/org/eehouse/android/xw4/BoardActivity.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 26d854451..7b9b9f81a 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -1212,10 +1212,14 @@ public class BoardActivity extends XWActivity // All players have now joined the game. The device that // created the room will assign tiles. Then it will be // the first player's turn - toastStr = getString( R.string.msg_relay_all_heref, room ); - if ( devOrder > 1 ) { - naMsg = R.string.not_again_conndall; - naKey = R.string.key_notagain_conndall; + + // Skip this until there's a way to show it only once per game + if ( false ) { + toastStr = getString( R.string.msg_relay_all_heref, room ); + if ( devOrder > 1 ) { + naMsg = R.string.not_again_conndall; + naKey = R.string.key_notagain_conndall; + } } } else if ( nMissing > 0 ) { if ( !m_haveInvited ) { From 94b2eddda6f8ccd3b3a1048c93ba4b45b2c85f2c Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 9 Sep 2013 07:42:00 -0700 Subject: [PATCH 6/8] fix crash by adding byte protocol expects --- xwords4/common/server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xwords4/common/server.c b/xwords4/common/server.c index 400f05977..db7aa5046 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -2491,6 +2491,7 @@ endGameInternal( ServerCtxt* server, GameEndReason XP_UNUSED(why), XP_S16 quitte XWStreamCtxt* stream; stream = messageStreamWithHeader( server, SERVER_DEVICE, XWPROTO_CLIENT_REQ_END_GAME ); + putQuitter( server, stream, quitter ); stream_destroy( stream ); /* Do I want to change the state I'm in? I don't think so.... */ From cf7147993163682fcec6b28116bb8cf5f96ba8a6 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 9 Sep 2013 07:42:27 -0700 Subject: [PATCH 7/8] cleanup formatting --- .../XWords4/src/org/eehouse/android/xw4/BoardActivity.java | 6 ++---- 1 file changed, 2 insertions(+), 4 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 7b9b9f81a..38452f001 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -813,13 +813,11 @@ public class BoardActivity extends XWActivity break; case R.id.board_menu_game_history: - m_jniThread.handle( JNICmd.CMD_HISTORY, - R.string.history_title ); + m_jniThread.handle( JNICmd.CMD_HISTORY, R.string.history_title ); break; case R.id.board_menu_game_resign: - m_jniThread.handle( JNICmd.CMD_FINAL, - R.string.history_title ); + m_jniThread.handle( JNICmd.CMD_FINAL, R.string.history_title ); break; case R.id.board_menu_game_resend: From bd81eb4bbe7634521811d55759eacc253b2f09ab Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 9 Sep 2013 07:44:46 -0700 Subject: [PATCH 8/8] list another change --- xwords4/android/XWords4/res/raw/changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xwords4/android/XWords4/res/raw/changes b/xwords4/android/XWords4/res/raw/changes index 5469751b3..7019c3ddc 100644 --- a/xwords4/android/XWords4/res/raw/changes +++ b/xwords4/android/XWords4/res/raw/changes @@ -14,6 +14,8 @@
  • Disable in-game Chat feature. (It has bugs that cause games to stop syncing moves. I&ll fix eventually. Let me know if you use this feature and I&ll up the priority.)
  • + +
  • Fix crash triggered by resignation
  • Next up