diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java index d34ea5f45..d6e2ca002 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java @@ -448,22 +448,34 @@ public abstract class DelegateBase implements DlgClickNotify, final CommsConnTypeSet conTypes = summary.conTypes; ab.setMessage( msg ) .setPositiveButton( android.R.string.ok, null ); - if ( BuildConfig.DEBUG && null != conTypes - && (conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) - || conTypes.contains( CommsConnType.COMMS_CONN_P2P )) ) { - OnClickListener lstnr = new OnClickListener() { - public void onClick( DialogInterface dlg, - int whichButton ) { - NetStateCache.reset( m_activity ); - if ( conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) { - RelayService.reset( getActivity() ); + + if ( BuildConfig.NON_RELEASE && null != conTypes ) { + if ( conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) + || conTypes.contains( CommsConnType.COMMS_CONN_P2P ) ) { + OnClickListener lstnr = new OnClickListener() { + @Override + public void onClick( DialogInterface dlg, + int whichButton ) { + NetStateCache.reset( m_activity ); + if ( conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) { + RelayService.reset( getActivity() ); + } + if ( conTypes.contains( CommsConnType.COMMS_CONN_P2P ) ) { + WiDirService.reset( getActivity() ); + } } - if ( conTypes.contains( CommsConnType.COMMS_CONN_P2P ) ) { - WiDirService.reset( getActivity() ); + }; + ab.setNegativeButton( R.string.button_reconnect, lstnr ); + } else if ( conTypes.contains( CommsConnType.COMMS_CONN_MQTT ) ) { + final int gameID = summary.gameID; + OnClickListener lstnr = new OnClickListener() { + @Override + public void onClick( DialogInterface dlg, int whichButton ) { + NetUtils.showGamePage( m_activity, gameID ); } - } - }; - ab.setNegativeButton( R.string.button_reconnect, lstnr ); + }; + ab.setNegativeButton( R.string.list_item_relaypage, lstnr ); + } } dialog = ab.create(); } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index 1b7ec84a5..7508b6ebe 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -1911,6 +1911,8 @@ public class GamesListDelegate extends ListDelegateBase } Utils.setItemVisible( menu, R.id.games_game_invites, enable ); Utils.setItemVisible( menu, R.id.games_game_netstats, isMultiGame ); + Utils.setItemVisible( menu, R.id.games_game_relaypage, + BuildConfig.NON_RELEASE && isMultiGame ); enable = BuildConfig.DEBUG || XWPrefs.getDebugEnabled( m_activity ); Utils.setItemVisible( menu, R.id.games_game_markbad, enable ); @@ -2123,6 +2125,11 @@ public class GamesListDelegate extends ListDelegateBase onStatusClicked( selRowIDs[0] ); break; + case R.id.games_game_relaypage: + GameSummary summary = GameUtils.getSummary( m_activity, selRowIDs[0] ); + NetUtils.showGamePage( m_activity, summary.gameID ); + break; + // DEBUG only case R.id.games_game_invites: String msg = GameUtils.getSummary( m_activity, selRowIDs[0] ) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java index aff714afa..c5ec6d475 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/NetUtils.java @@ -125,6 +125,17 @@ public class NetUtils { } } + static void showGamePage( Context context, int gameID ) + { + // Requires a login, so only of use to me right now.... + String url = String.format( "https://eehouse.org/xw4/ui/games?gameid=%d", + gameID ); + Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( url ) ); + if ( null != intent.resolveActivity( context.getPackageManager() ) ) { + context.startActivity( intent ); + } + } + public static byte[][][] queryRelay( Context context, String[] ids ) { byte[][][] msgs = null; diff --git a/xwords4/android/app/src/main/res/menu/games_list_game_menu.xml b/xwords4/android/app/src/main/res/menu/games_list_game_menu.xml index 79a391fd1..faa2c91a4 100644 --- a/xwords4/android/app/src/main/res/menu/games_list_game_menu.xml +++ b/xwords4/android/app/src/main/res/menu/games_list_game_menu.xml @@ -28,6 +28,10 @@ + + diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 004021c4e..962e4f01d 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -126,6 +126,9 @@ list_item_rename) --> Connections… + + Game traffic… Games that have already connected