From ea29a0f4eb637226f26dd6acb5b3378c1fd1bc8f Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Sun, 27 Dec 2015 16:20:22 -0500 Subject: [PATCH] Improve monitor activity with LinearLayout and helper text --- res/layout/activity_monitor.xml | 90 ++++++++------------ res/values/strings.xml | 7 ++ src/protect/babymonitor/MonitorActivity.java | 9 +- 3 files changed, 47 insertions(+), 59 deletions(-) diff --git a/res/layout/activity_monitor.xml b/res/layout/activity_monitor.xml index b202fe5..566286e 100644 --- a/res/layout/activity_monitor.xml +++ b/res/layout/activity_monitor.xml @@ -1,7 +1,9 @@ - + + + + + android:text="@string/serviceTitle" + android:textSize="20sp" /> - + android:text="@string/loading" + android:textSize="20sp" /> - + - + - + - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 0bf716a..7e325b4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -7,5 +7,12 @@ Use as Child Device Device is placed with baby, and sends audio to a paired parent device Pairs with child device and plays received audio + Child Device + Service: + Name of the service that parent must pair to + Loading... + Stopped + Streaming... + Waiting for Parent... diff --git a/src/protect/babymonitor/MonitorActivity.java b/src/protect/babymonitor/MonitorActivity.java index 699ccdf..ba41b1f 100644 --- a/src/protect/babymonitor/MonitorActivity.java +++ b/src/protect/babymonitor/MonitorActivity.java @@ -53,7 +53,7 @@ public class MonitorActivity extends Activity public void run() { final TextView statusText = (TextView) findViewById(R.id.textStatus); - statusText.setText("Streaming..."); + statusText.setText(R.string.streaming); } }); @@ -94,9 +94,6 @@ public class MonitorActivity extends Activity super.onCreate(savedInstanceState); setContentView(R.layout.activity_monitor); - final TextView text = (TextView) findViewById(R.id.textStatus); - text.setText("Loading..."); - try { // Initialize a server socket on the next available port. @@ -137,7 +134,7 @@ public class MonitorActivity extends Activity public void run() { final TextView statusText = (TextView) findViewById(R.id.textStatus); - statusText.setText("Stopped"); + statusText.setText(R.string.stopped); } }); } @@ -216,7 +213,7 @@ public class MonitorActivity extends Activity public void run() { final TextView statusText = (TextView) findViewById(R.id.textStatus); - statusText.setText("Waiting for connection..."); + statusText.setText(R.string.waitingForParent); final TextView serviceText = (TextView) findViewById(R.id.textService); serviceText.setText(serviceName);