summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-07 14:05:12 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-07 14:05:12 +0100
commit845713f1d1302dcbf60a6ce0a095af330157b0d2 (patch)
treef878289190f64ea9c1b127406bd6025bbfbd56a5
parenta203162a09591803fca8411c87337bd916ebf51b (diff)
Improve layout code.
Descriptive ids in layout.
-rw-r--r--same-android/res/layout/controller.xml14
-rw-r--r--same-android/src/main/java/com/orbekk/SameControllerActivity.java4
2 files changed, 10 insertions, 8 deletions
diff --git a/same-android/res/layout/controller.xml b/same-android/res/layout/controller.xml
index c3c4717..6cfea80 100644
--- a/same-android/res/layout/controller.xml
+++ b/same-android/res/layout/controller.xml
@@ -6,33 +6,35 @@
>
<TextView
- android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Commands"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
- android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="createNetwork"
android:text="Create" />
<EditText
- android:id="@+id/editText1"
+ android:id="@+id/master_service_url"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
- android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="joinNetwork"
- android:text="Search" />
+ android:text="Join" />
+
+ <ListView
+ android:id="@+id/network_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+ </ListView>
<Button
- android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="doneClicked"
diff --git a/same-android/src/main/java/com/orbekk/SameControllerActivity.java b/same-android/src/main/java/com/orbekk/SameControllerActivity.java
index fb9b103..76e6416 100644
--- a/same-android/src/main/java/com/orbekk/SameControllerActivity.java
+++ b/same-android/src/main/java/com/orbekk/SameControllerActivity.java
@@ -30,7 +30,7 @@ public class SameControllerActivity extends Activity {
Intent intent = new Intent(this, SameService.class);
intent.setAction("join");
// InetAddress address = new Broadcaster(this).getBroadcastAddress();
- EditText t = (EditText)findViewById(R.id.editText1);
+ EditText t = (EditText)findViewById(R.id.master_service_url);
intent.putExtra("masterUrl", t.getText().toString());
startService(intent);
}
@@ -42,7 +42,7 @@ public class SameControllerActivity extends Activity {
}
private void showBroadcastAddress() {
- EditText t = (EditText)findViewById(R.id.editText1);
+ EditText t = (EditText)findViewById(R.id.master_service_url);
t.setText(new Broadcaster(this).getBroadcastAddress().getHostAddress());
}