diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java index ea99ca298..48aba6952 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java @@ -971,7 +971,7 @@ public class BTService extends XWService { private void postNotification( int gameID, int title, String body, long rowid ) { - Intent intent = GamesListActivity.makeGameIDIntent( this, gameID ); + Intent intent = GamesListDelegate.makeGameIDIntent( this, gameID ); Utils.postNotification( this, intent, R.string.new_btmove_title, body, (int)rowid ); } 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 69b261c76..1bd223c5a 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -2258,7 +2258,7 @@ public class BoardDelegate extends DelegateBase private void doRematch() { - Intent intent = GamesListActivity.makeRematchIntent( m_activity, m_gi, m_rowid ); + Intent intent = GamesListDelegate.makeRematchIntent( m_activity, m_gi, m_rowid ); if ( null != intent ) { startActivity( intent ); m_delegator.finish(); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java index 4514d4af8..5cee9c3dc 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DispatchNotify.java @@ -40,7 +40,7 @@ public class DispatchNotify extends Activity { Uri data = getIntent().getData(); if ( null != data ) { // relay invite redirected URL case - GamesListActivity.openGame( this, data ); + GamesListDelegate.openGame( this, data ); } finish(); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index e8e3f472a..ce009646a 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -724,10 +724,14 @@ public class GameUtils { public static void launchGame( Activity activity, long rowid, boolean invited ) { - Intent intent = new Intent( activity, BoardActivity.class ); Bundle extras = makeLaunchExtras( rowid, invited ); - intent.putExtras( extras ); - activity.startActivity( intent ); + if ( activity instanceof FragActivity ) { + FragActivity.addFragment( new BoardFrag(), extras ); + } else { + Intent intent = new Intent( activity, BoardActivity.class ); + intent.putExtras( extras ); + activity.startActivity( intent ); + } } public static void launchGame( Activity activity, long rowid ) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java index 4c0990a94..85cdcd962 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListActivity.java @@ -62,61 +62,4 @@ public class GamesListActivity extends XWListActivity implements GamesListDelega { GameUtils.launchGame( this, rowID, invited ); } - - public static void onGameDictDownload( Context context, Intent intent ) - { - intent.setClass( context, GamesListActivity.class ); - context.startActivity( intent ); - } - - private static Intent makeSelfIntent( Context context ) - { - Intent intent = new Intent( context, GamesListActivity.class ); - intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP - | Intent.FLAG_ACTIVITY_NEW_TASK ); - return intent; - } - - public static Intent makeRowidIntent( Context context, long rowid ) - { - Intent intent = makeSelfIntent( context ); - intent.putExtra( ROWID_EXTRA, rowid ); - return intent; - } - - public static Intent makeGameIDIntent( Context context, int gameID ) - { - Intent intent = makeSelfIntent( context ); - intent.putExtra( GAMEID_EXTRA, gameID ); - return intent; - } - - public static Intent makeRematchIntent( Context context, CurGameInfo gi, - long rowid ) - { - Intent intent = null; - - if ( CurGameInfo.DeviceRole.SERVER_STANDALONE == gi.serverRole ) { - intent = makeSelfIntent( context ) - .putExtra( REMATCH_ROWID_EXTRA, rowid ); - } else { - Utils.notImpl( context ); - } - - return intent; - } - - public static Intent makeAlertIntent( Context context, String msg ) - { - Intent intent = makeSelfIntent( context ); - intent.putExtra( ALERT_MSG, msg ); - return intent; - } - - public static void openGame( Context context, Uri data ) - { - Intent intent = makeSelfIntent( context ); - intent.setData( data ); - context.startActivity( intent ); - } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/MultiService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/MultiService.java index e1707c6e0..5ac1b562a 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/MultiService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/MultiService.java @@ -172,7 +172,7 @@ public class MultiService { SMSService.onGameDictDownload( context, intent ); break; case OWNER_RELAY: - GamesListActivity.onGameDictDownload( context, intent ); + GamesListDelegate.onGameDictDownload( context, intent ); break; default: DbgUtils.logf( "unexpected OWNER" ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java index 049dd6ac9..fcf9e705c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayService.java @@ -379,7 +379,7 @@ public class RelayService extends XWService private void setupNotification( long rowid ) { - Intent intent = GamesListActivity.makeRowidIntent( this, rowid ); + Intent intent = GamesListDelegate.makeRowidIntent( this, rowid ); String msg = LocUtils.getString( this, R.string.notify_body_fmt, GameUtils.getName( this, rowid ) ); Utils.postNotification( this, intent, R.string.notify_title, @@ -580,7 +580,7 @@ public class RelayService extends XWService break; case XWPDEV_ALERT: str = getVLIString( dis ); - Intent intent = GamesListActivity.makeAlertIntent( this, str ); + Intent intent = GamesListDelegate.makeAlertIntent( this, str ); Utils.postNotification( this, intent, R.string.relay_alert_title, str, str.hashCode() ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java index e3a58e3e2..7903ba3b9 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java @@ -789,7 +789,7 @@ public class SMSService extends XWService { private void postNotification( int gameID, int title, String body, long rowid ) { - Intent intent = GamesListActivity.makeGameIDIntent( this, gameID ); + Intent intent = GamesListDelegate.makeGameIDIntent( this, gameID ); Utils.postNotification( this, intent, title, body, (int)rowid ); }