show dict as comment beside player name in players list. And since

dicts change when language does, put language choice above players
list.
This commit is contained in:
Andy2 2011-10-12 18:37:31 -07:00
parent 0dfa69b1b2
commit 01459285d5
3 changed files with 31 additions and 34 deletions

View file

@ -47,6 +47,18 @@
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView style="@style/config_separator"
android:text="@string/lang_label"
/>
<Spinner android:id="@+id/lang_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/title_langs_list"
/>
<!-- players -->
<TextView style="@style/config_separator"
android:id="@+id/players_label"
@ -77,17 +89,6 @@
/>
</LinearLayout>
<TextView style="@style/config_separator"
android:text="@string/lang_label"
/>
<Spinner android:id="@+id/lang_spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/title_langs_list"
/>
<LinearLayout android:id="@+id/connect_set"
android:layout_width="fill_parent"
android:layout_height="wrap_content"

View file

@ -632,24 +632,27 @@ public class GameConfig extends XWActivity
boolean canDelete = names.length > 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();
}
}

View file

@ -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;