add name field to and use a style for bulleted items in simplified

relay-connect dialog; remove not-again text and dialog attached to
new-relay-game button; tweak text.
This commit is contained in:
Andy2 2010-11-06 14:55:57 -07:00
parent 98716b755a
commit a72e029f40
7 changed files with 49 additions and 31 deletions

View file

@ -16,23 +16,17 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/explain_b1"
android:paddingLeft="8dp"
<TextView android:text="@string/explain_b1"
style="@style/relay_explain"
/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/explain_b2"
android:paddingLeft="8dp"
<TextView android:text="@string/explain_b2"
style="@style/relay_explain"
/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/explain_b3"
android:paddingLeft="8dp"
<TextView android:text="@string/explain_b3"
style="@style/relay_explain"
/>
<TextView android:text="@string/explain_b4"
style="@style/relay_explain"
/>
<EditText android:id="@+id/room_edit"
@ -43,9 +37,21 @@
android:capitalize="none"
android:singleLine="true"
android:selectAllOnFocus="true"
android:maxLength="31"
android:hint="@string/new_room_hint"
/>
<EditText android:id="@+id/local_name_edit"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:scrollHorizontally="false"
android:autoText="false"
android:capitalize="none"
android:singleLine="true"
android:selectAllOnFocus="true"
android:hint="@string/local_name_hint"
/>
<Button android:id="@+id/play_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"

View file

@ -41,7 +41,6 @@
<string name="key_notagain_chat">key_notagain_chat</string>
<string name="key_notagain_relay">key_notagain_relay</string>
<string name="key_notagain_newgame">key_notagain_newgame</string>
<string name="key_notagain_newgamenet">key_notagain_newgamenet</string>
<string name="key_notagain_hintprev">key_notagain_hintprev</string>
<string name="key_notagain_hintnext">key_notagain_hintnext</string>
<string name="key_notagain_juggle">key_notagain_juggle</string>

View file

@ -428,12 +428,6 @@
two players, the first a robot, both on this device. Tap it to
play; long-tap it to change its configuration or for other
options.</string>
<string name="not_again_newgamenet">The new game you have created
has two players but only one is on this device. To play the
game, tap it, and it will begin by connecting over the internet
looking for that other player in the default no-name
room. Long-tap it to configure - e.g. change the room name - or
for other options.</string>
<string name="not_again_hintprev">This button shows all possible
moves in ascending order (using tiles to the right of the rack
@ -473,14 +467,19 @@
device[s] have joined your room and play can begin.</string>
<string name="relay_game_explainf">To start a basic networked two-player
game in %s over the network:</string>
game in %s:</string>
<string name="explain_b1">• Agree on a room name with your friend</string>
<string name="explain_b2">• Put it in the box below and on
your friend\'s Android smartphone</string>
<string name="explain_b3">• Press the \"Play game\" button</string>
<string name="explain_b1">• Agree on a room name with the other
player.</string>
<string name="explain_b2">• Enter the new room name in the first
box below. The room names on your two phones must be
identical.</string>
<string name="explain_b3">• Optionally, enter player names in the
second box (one per phone)</string>
<string name="explain_b4">• Press the \"Play game\" button on both
phones to start the game.</string>
<string name="advanced_config">Advanced game settings</string>
<string name="local_name_hint">Player name</string>
</resources>

View file

@ -52,5 +52,11 @@
<item name="android:textColor">#FFFFFFFF</item>
</style>
<style name="relay_explain">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingLeft">12dp</item>
</style>
</resources>

View file

@ -87,9 +87,6 @@ public class GamesList extends XWListActivity
@Override
public void onClick( View v ) {
String path = addGame( true );
showNotAgainDlgThen( R.string.not_again_newgamenet,
R.string.key_notagain_newgamenet, null );
GameUtils.doConfig( GamesList.this, path,
RelayGameActivity.class );
}

View file

@ -90,6 +90,8 @@ public class RelayGameActivity extends XWActivity
{
if ( view == m_playButton ) {
m_car.ip_relay_invite = Utils.getText( this, R.id.room_edit ).trim();
String name = Utils.getText( this, R.id.local_name_edit );
m_gi.setFirstLocalName( name );
GameUtils.applyChanges( this, m_gi, m_car, m_path, false );
GameUtils.launchGame( this, m_path );
} else if ( view == m_configButton ) {

View file

@ -302,6 +302,15 @@ public class CurGameInfo {
return added;
}
public void setFirstLocalName( String name ) {
for ( int ii = 0; ii < nPlayers; ++ii ) {
if ( players[ii].isLocal ) {
players[ii].name = name;
break;
}
}
}
public boolean moveUp( int which )
{
boolean canMove = which > 0 && which < nPlayers;