mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
add buttons, text etc. still to be determined, to start BT games. Add
text and unimplemented button to turn BT on if it's not there.
This commit is contained in:
parent
6d93fcfdd3
commit
81e29482fe
4 changed files with 120 additions and 0 deletions
|
@ -105,6 +105,69 @@
|
|||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Bluetooth -->
|
||||
<TextView style="@style/config_separator"
|
||||
android:layout_marginTop="10dip"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="@string/newgame_bt_header"
|
||||
/>
|
||||
|
||||
<LinearLayout android:id="@+id/bt_disabled"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<TextView android:text="@string/bt_disabled"
|
||||
style="@style/relay_explain"
|
||||
/>
|
||||
<Button android:id="@+id/newgame_enable_bt"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/newgame_enable_bt"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/bt_stuff"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dip"
|
||||
android:layout_marginBottom="10dip"
|
||||
>
|
||||
<ImageView android:src="@android:drawable/stat_sys_data_bluetooth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
/>
|
||||
<TextView android:text="@string/bt_networked_desc"
|
||||
style="@style/relay_explain"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<Button android:id="@+id/newgame_invite_bt"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/newgame_invite"
|
||||
/>
|
||||
|
||||
<Button android:id="@+id/newgame_bt_config"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/newgame_net_config"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
|
@ -1169,6 +1169,23 @@
|
|||
this and you'll get taken to the "Game configure" screen -->
|
||||
<string name="newgame_net_config">Configure first</string>
|
||||
|
||||
<!-- section separator (white-on-gray bar) for third section:
|
||||
bluetooth games -->
|
||||
<string name="newgame_bt_header">New Bluetooth game</string>
|
||||
|
||||
<!-- EXPLAIN ME -->
|
||||
<string name="bt_disabled">Bluetooth is not available. This may
|
||||
mean that your device doesn\'t support it, or that it\'s been
|
||||
turned off.</string>
|
||||
|
||||
<!-- EXPLAIN ME -->
|
||||
<string name="bt_networked_desc">Create a game that will be played
|
||||
via Bluetooth with devices that are nearby and paired with
|
||||
yours. Both buttons will initiate a game with other devices
|
||||
(one or more) that you choose (from paired devices that already
|
||||
have Crosswords installed.) The first uses defaults; the second
|
||||
lets you change them before beginning the game.</string>
|
||||
|
||||
<!-- The invitation process beging with this query. The choice is
|
||||
between html and plaintext formatting but I also provide some
|
||||
explanation/guidance. -->
|
||||
|
@ -1819,4 +1836,6 @@
|
|||
version: \"%s\"; and make/model of your phone or
|
||||
tablet.)"</string>
|
||||
|
||||
<string name="newgame_enable_bt">Turn Bluetooth on</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -183,4 +183,10 @@ public class BTConnection extends BroadcastReceiver {
|
|||
pt.start();
|
||||
}
|
||||
|
||||
public static boolean BTDisabled()
|
||||
{
|
||||
boolean disabled = null == s_btAdapter;
|
||||
return disabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,6 +85,34 @@ public class NewGameActivity extends XWActivity {
|
|||
}
|
||||
} );
|
||||
|
||||
if ( BTConnection.BTDisabled() ) {
|
||||
findViewById( R.id.bt_stuff ).setVisibility( View.GONE );
|
||||
button = (Button)findViewById( R.id.newgame_enable_bt );
|
||||
button.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
Utils.notImpl( NewGameActivity.this );
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
findViewById( R.id.bt_disabled ).setVisibility( View.GONE );
|
||||
|
||||
button = (Button)findViewById( R.id.newgame_invite_bt );
|
||||
button.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
makeNewBTGame( true );
|
||||
}
|
||||
} );
|
||||
button = (Button)findViewById( R.id.newgame_bt_config );
|
||||
button.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
makeNewBTGame( false );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// DlgDelegate.DlgClickNotify interface
|
||||
|
@ -143,4 +171,8 @@ public class NewGameActivity extends XWActivity {
|
|||
finish();
|
||||
}
|
||||
|
||||
private void makeNewBTGame( boolean useDefaults )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue