From 2d669133239104a50ec87a727c43abaf53d66a1e Mon Sep 17 00:00:00 2001 From: Andy2 Date: Sun, 17 Oct 2010 21:13:14 -0700 Subject: [PATCH] populate public rooms list as soon as checkbox set -- and mention language and number of players in failure message --- xwords4/android/XWords4/res/values/strings.xml | 6 +++--- .../src/org/eehouse/android/xw4/GameConfig.java | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 186663098..cc262b5c5 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -167,7 +167,7 @@ Make new room public Join public room New room name - Pick room to play in + Select public room Configure connection Configure %s connection @@ -385,8 +385,8 @@ Fetching public rooms for %d-player games in %s. - No public rooms found. Try - refreshing or creating your own. + No public rooms found for %d-player + games in %s. Try refreshing or creating your own. Message received Send diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java index 1d54b393d..7afacd89d 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java @@ -242,11 +242,13 @@ public class GameConfig extends XWActivity case NO_NAME_FOUND: dialog = new AlertDialog.Builder( this ) .setPositiveButton( R.string.button_ok, null ) - .setMessage( R.string.no_name_found ) + // message added below since varies with language etc. + .setMessage("") // if not set here can't change later .create(); + break; } return dialog; - } + } // onCreateDialog @Override protected void onPrepareDialog( int id, Dialog dialog ) @@ -267,6 +269,12 @@ public class GameConfig extends XWActivity ListView listview = (ListView)dialog.findViewById( R.id.players ); listview.setAdapter( new RemoteChoices() ); break; + case NO_NAME_FOUND: + String format = getString( R.string.no_name_found_f ); + String msg = String.format( format, m_gi.nPlayers, DictLangCache. + getLangName( this, m_gi.dictLang ) ); + ((AlertDialog)dialog).setMessage( msg ); + break; } super.onPrepareDialog( id, dialog ); } @@ -726,6 +734,8 @@ public class GameConfig extends XWActivity private void adjustConnectStuff() { if ( m_joinPublicCheck.isChecked() ) { + new RefreshNamesTask( this, this, m_gi.dictLang, + m_gi.nPlayers, m_roomChoose ).execute(); m_privateRoomsSet.setVisibility( View.GONE ); m_publicRoomsSet.setVisibility( View.VISIBLE );