Skip to content

Commit 6451b0d

Browse files
committed
Added connecting message
1 parent eb7f435 commit 6451b0d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/src/main/java/com/henrykvdb/sttt/BtService.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ class BtService : Service() {
7070
closeThread()
7171

7272
val device = btAdapter.getRemoteDevice(address)
73-
Log.e(LOG_TAG, "connect to: " + device)
73+
sendToast(this, device.name?.let { getString(R.string.connecting_to, it) } ?: getString(R.string.connecting))
74+
Log.e(LOG_TAG, "connecting to: " + device)
7475

7576
btThread = ConnectingThread(device)
7677
btThread?.start()

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<string name="new_local_title">Start a new game?</string>
5454
<string name="starting_player">Beginning player</string>
5555
<string name="enemy_turn">The enemy is playing!</string>
56+
<string name="connecting_to">Connecting to %1$s</string>
5657
<string name="connection_lost">Connection lost</string>
5758
<string name="no_prev_moves">No previous moves</string>
5859
<string name="game_winner">%1$s won the game!</string>
@@ -65,6 +66,7 @@
6566
<string name="tie_message">It is a tie!</string>
6667
<string name="bt_game">Bluetooth Game</string>
6768
<string name="human_game">Human Game</string>
69+
<string name="connecting">Connecting</string>
6870
<string name="choose_one">Choose one</string>
6971
<string name="no_thanks">No, thanks</string>
7072
<string name="you_lost">You lost!</string>

0 commit comments

Comments
 (0)