Improve monitor activity with LinearLayout and helper text
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/LinearLayout1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
@@ -9,64 +11,46 @@
|
||||
tools:context="protect.babymonitor.MonitorActivity" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:id="@+id/childDeviceTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/childDevice"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dip" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/serviceTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="40dp"
|
||||
android:text="Child Device"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
android:text="@string/serviceTitle"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TableLayout
|
||||
<TextView
|
||||
android:id="@+id/textService"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginTop="124dp" >
|
||||
android:text="@string/loading"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/TableRow01"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
<TextView
|
||||
android:id="@+id/serviceDescription"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/serviceDescription" />
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<Space
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dip" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textService"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="20sp" />
|
||||
<TextView
|
||||
android:id="@+id/textStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textSize="20sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:id="@+id/tableRow1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
@@ -7,5 +7,12 @@
|
||||
<string name="useAsChildDevice">Use as Child Device</string>
|
||||
<string name="childDescription">Device is placed with baby, and sends audio to a paired parent device</string>
|
||||
<string name="parentDescription">Pairs with child device and plays received audio</string>
|
||||
<string name="childDevice">Child Device</string>
|
||||
<string name="serviceTitle">Service:</string>
|
||||
<string name="serviceDescription">Name of the service that parent must pair to</string>
|
||||
<string name="loading">Loading...</string>
|
||||
<string name="stopped">Stopped</string>
|
||||
<string name="streaming">Streaming...</string>
|
||||
<string name="waitingForParent">Waiting for Parent...</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user