From c57b5a232fa74b1ee8556de666ae35430bdf3b5d Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 20 Jul 2016 09:30:01 -0700 Subject: [PATCH] cleanup: chat delegate no longer "returns" a result --- .../src/org/eehouse/android/xw4/BoardDelegate.java | 13 ++----------- .../src/org/eehouse/android/xw4/ChatDelegate.java | 9 ++++----- .../src/org/eehouse/android/xw4/RequestCode.java | 1 - 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index 0354cfea5..e83fb32f0 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -702,15 +702,6 @@ public class BoardDelegate extends DelegateBase if ( Activity.RESULT_CANCELED != resultCode ) { InviteMeans missingMeans = null; switch ( requestCode ) { - case CHAT_REQUEST: - if ( BuildConstants.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: missingMeans = InviteMeans.BLUETOOTH; break; @@ -2334,8 +2325,8 @@ public class BoardDelegate extends DelegateBase int curPlayer = XwJNI.board_getSelPlayer( m_jniGamePtr ); String[] names = m_gi.playerNames(); boolean[] locs = m_gi.playersLocal(); // to convert old histories - ChatDelegate.startForResult( getDelegator(), RequestCode.CHAT_REQUEST, - m_rowid, curPlayer, names, locs ); + ChatDelegate.start( getDelegator(), m_rowid, curPlayer, + names, locs ); } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java index 8317057f4..c61e5c8c2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java @@ -252,10 +252,9 @@ public class ChatDelegate extends DelegateBase { return handled; } - public static void startForResult( Delegator delegator, - RequestCode requestCode, - long rowID, int curPlayer, - String[] names, boolean[] locs ) + public static void start( Delegator delegator, + long rowID, int curPlayer, + String[] names, boolean[] locs ) { Assert.assertFalse( -1 == curPlayer ); Bundle bundle = new Bundle(); @@ -270,7 +269,7 @@ public class ChatDelegate extends DelegateBase { Activity activity = delegator.getActivity(); Intent intent = new Intent( activity, ChatActivity.class ); intent.putExtras( bundle ); - activity.startActivityForResult( intent, requestCode.ordinal() ); + activity.startActivity( intent ); } } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RequestCode.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RequestCode.java index dfba107cc..788b7a70c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RequestCode.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RequestCode.java @@ -25,7 +25,6 @@ public enum RequestCode { __UNUSED, // BoardDelegate - CHAT_REQUEST, BT_INVITE_RESULT, SMS_INVITE_RESULT, RELAY_INVITE_RESULT,