replace menuitem to juggle players with button; place it and add

player button below player list; remove heading above phonies, adding
"phonies" to each spinner text; add "game settings" heading.  Still
need to find a way to make the headings pop visually.
This commit is contained in:
eehouse 2010-04-23 08:54:04 +00:00
parent ccd68bf3ef
commit f78ff6786a
4 changed files with 35 additions and 30 deletions

View file

@ -61,10 +61,6 @@
android:text="@string/configure_role" android:text="@string/configure_role"
/> />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:layout_height="wrap_content" <TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginLeft="20dip" android:layout_marginLeft="20dip"
@ -73,14 +69,6 @@
android:gravity="left" android:gravity="left"
/> />
<Button android:id="@+id/add_player"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/button_add_player"
/>
</LinearLayout>
<!-- players --> <!-- players -->
<LinearLayout android:id="@+id/player_list" <LinearLayout android:id="@+id/player_list"
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -88,6 +76,23 @@
android:orientation="vertical"> android:orientation="vertical">
</LinearLayout> </LinearLayout>
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom|center"
>
<Button android:id="@+id/add_player"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_add_player"
/>
<Button android:id="@+id/juggle_players"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_juggle_players"
/>
</LinearLayout>
<TextView android:layout_height="wrap_content" <TextView android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_marginLeft="20dip" android:layout_marginLeft="20dip"
@ -101,6 +106,13 @@
android:drawSelectorOnTop="true" android:drawSelectorOnTop="true"
/> />
<TextView android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:text="@string/settings_label"
/>
<CheckBox android:id="@+id/hints_allowed" <CheckBox android:id="@+id/hints_allowed"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -149,13 +161,6 @@
android:text="@string/smart_robot" android:text="@string/smart_robot"
/> />
<TextView android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:text="@string/phonies_label"
/>
<Spinner android:id="@+id/phonies_spinner" <Spinner android:id="@+id/phonies_spinner"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -4,7 +4,4 @@
<item android:id="@+id/game_config_revert" <item android:id="@+id/game_config_revert"
android:title="@string/game_config_revert" android:title="@string/game_config_revert"
/> />
<item android:id="@+id/game_config_juggle"
android:title="@string/game_config_juggle"
/>
</menu> </menu>

View file

@ -147,6 +147,7 @@
<string name="players_label">Players</string> <string name="players_label">Players</string>
<string name="button_add_player">Add player</string> <string name="button_add_player">Add player</string>
<string name="button_juggle_players">Juggle players</string>
<string name="game_config_juggle">Juggle players</string> <string name="game_config_juggle">Juggle players</string>
@ -160,7 +161,7 @@
<string name="connect_via_label">Connect via</string> <string name="connect_via_label">Connect via</string>
<string name="configure_role">Configure connection</string> <string name="configure_role">Configure connection</string>
<string name="phonies_label">Phonies</string> <string name="settings_label">Game settings</string>
<string name="minutes_label">Minutes in game</string> <string name="minutes_label">Minutes in game</string>
<string name="smart_robot">Smart robot</string> <string name="smart_robot">Smart robot</string>
@ -197,9 +198,9 @@
<string name="role_host">Host</string> <string name="role_host">Host</string>
<string name="role_guest">Guest</string> <string name="role_guest">Guest</string>
<string name="phonies_ignore">Ignore</string> <string name="phonies_ignore">Ignore phonies</string>
<string name="phonies_warn">Warn</string> <string name="phonies_warn">Warn if phonies</string>
<string name="phonies_disallow">Disallow</string> <string name="phonies_disallow">Disallow phonies</string>
<string name="gamel_menu_prefs">Preferences</string> <string name="gamel_menu_prefs">Preferences</string>
<string name="gamel_menu_dicts">Dictionaries</string> <string name="gamel_menu_dicts">Dictionaries</string>

View file

@ -65,6 +65,7 @@ public class GameConfig extends Activity implements View.OnClickListener {
private static final int CONFIRM_CHANGE = 6; private static final int CONFIRM_CHANGE = 6;
private Button m_addPlayerButton; private Button m_addPlayerButton;
private Button m_jugglePlayersButton;
private Button m_configureButton; private Button m_configureButton;
private String m_path; private String m_path;
private CurGameInfo m_gi; private CurGameInfo m_gi;
@ -361,6 +362,8 @@ public class GameConfig extends Activity implements View.OnClickListener {
m_addPlayerButton = (Button)findViewById(R.id.add_player); m_addPlayerButton = (Button)findViewById(R.id.add_player);
m_addPlayerButton.setOnClickListener( this ); m_addPlayerButton.setOnClickListener( this );
m_jugglePlayersButton = (Button)findViewById(R.id.juggle_players);
m_jugglePlayersButton.setOnClickListener( this );
m_configureButton = (Button)findViewById(R.id.configure_role); m_configureButton = (Button)findViewById(R.id.configure_role);
m_configureButton.setOnClickListener( this ); m_configureButton.setOnClickListener( this );
@ -486,10 +489,6 @@ public class GameConfig extends Activity implements View.OnClickListener {
boolean handled = true; boolean handled = true;
switch( item.getItemId() ) { switch( item.getItemId() ) {
case R.id.game_config_juggle:
m_gi.juggle();
loadPlayers();
break;
case R.id.game_config_revert: case R.id.game_config_revert:
Utils.notImpl( this ); Utils.notImpl( this );
break; break;
@ -507,6 +506,9 @@ public class GameConfig extends Activity implements View.OnClickListener {
m_gi.addPlayer(); // ups nPlayers m_gi.addPlayer(); // ups nPlayers
loadPlayers(); loadPlayers();
} }
} else if ( m_jugglePlayersButton == view ) {
m_gi.juggle();
loadPlayers();
} else if ( m_configureButton == view ) { } else if ( m_configureButton == view ) {
int position = m_connectSpinner.getSelectedItemPosition(); int position = m_connectSpinner.getSelectedItemPosition();
switch ( m_types[ position ] ) { switch ( m_types[ position ] ) {