diff --git a/xwords4/android/XWords4/res/layout/game_config.xml b/xwords4/android/XWords4/res/layout/game_config.xml index b7d0c3dbe..f8e0744e7 100644 --- a/xwords4/android/XWords4/res/layout/game_config.xml +++ b/xwords4/android/XWords4/res/layout/game_config.xml @@ -47,6 +47,18 @@ android:layout_height="fill_parent" android:orientation="vertical"> + + + + + - - - - 2 || (m_notNetworkedGame && names.length > 1); LayoutInflater factory = LayoutInflater.from(this); + View.OnClickListener lstnr = new View.OnClickListener() { + @Override + public void onClick( View view ) { + m_whichPlayer = ((XWListItem)view).getPosition(); + showDialog( PLAYER_EDIT ); + } + }; + for ( int ii = 0; ii < names.length; ++ii ) { - final XWListItem view = (XWListItem)factory.inflate( R.layout.list_item, null ); view.setPosition( ii ); view.setText( names[ii] ); - view.setGravity( Gravity.CENTER ); + if ( m_gi.players[ii].isLocal ) { + view.setComment( m_gi.dictName(ii) ); + } if ( canDelete ) { view.setDeleteCallback( this ); } - view.setOnClickListener( new View.OnClickListener() { - @Override - public void onClick( View view ) { - m_whichPlayer = ((XWListItem)view).getPosition(); - showDialog( PLAYER_EDIT ); - } - } ); + view.setOnClickListener( lstnr ); m_playerLayout.addView( view ); view.setEnabled( !m_isLocked ); @@ -675,20 +678,6 @@ public class GameConfig extends XWActivity adjustPlayersLabel(); } // loadPlayersList - private String[] buildListWithBrowse( String[] input ) - { - Arrays.sort( input ); - int browsePosn = input.length; - String[] result = new String[browsePosn+1]; - result[browsePosn] = getString( R.string.download_dicts ); - - for ( int ii = 0; ii < browsePosn; ++ii ) { - String lang = input[ii]; - result[ii] = lang; - } - return result; - } - private void configDictSpinner( final Dialog dialog, LocalPlayer lp ) { Spinner dictsSpinner = @@ -738,6 +727,7 @@ public class GameConfig extends XWActivity m_gi.setLang( DictLangCache. getLangLangCode( GameConfig.this, chosen ) ); + loadPlayersList(); } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java index b49dc41c9..18e930bdc 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CurGameInfo.java @@ -303,6 +303,12 @@ public class CurGameInfo { return dname; } + public String dictName( int indx ) + { + LocalPlayer lp = players[indx]; + return dictName( lp ); + } + public boolean addPlayer() { boolean added = nPlayers < MAX_NUM_PLAYERS;