瀏覽代碼

Working horizontal layout

Closes #21
tags/SensorLogger/0.1.4
Chris Smith 14 年之前
父節點
當前提交
9973aa1f64

+ 1
- 1
code/SensorLogger/AndroidManifest.xml 查看文件

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
-     package="uk.co.md87.android.sensorlogger" android:versionCode="9" android:versionName="0.1.3">
3
+     package="uk.co.md87.android.sensorlogger" android:versionCode="10" android:versionName="0.1.4">
4 4
     <application android:label="Sensor Logger">
5 5
          <activity android:name=".MainActivity" android:label="Sensor Logger">
6 6
             <intent-filter>

二進制
code/SensorLogger/dist/SensorLogger.apk 查看文件


+ 60
- 0
code/SensorLogger/res/layout-land/main.xml 查看文件

@@ -0,0 +1,60 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:orientation="horizontal"
4
+    android:layout_width="fill_parent"
5
+    android:layout_height="fill_parent"
6
+    android:weightSum="100">
7
+    <RelativeLayout
8
+        android:orientation="vertical"
9
+        android:layout_height="fill_parent"
10
+        android:layout_width="0px"
11
+        android:layout_weight="70"
12
+        android:padding="5px"
13
+        android:id="@+id/left">
14
+        <TextView
15
+            android:id="@+id/text"
16
+            android:layout_width="fill_parent"
17
+            android:layout_height="wrap_content"
18
+            android:text="Hello Android from NetBeans"/>
19
+        <TextView
20
+            android:id="@+id/viewcaption"
21
+            android:layout_width="fill_parent"
22
+            android:layout_height="wrap_content"
23
+            android:layout_below="@id/text"
24
+            android:layout_marginTop="10dip"
25
+            android:text="View your uploaded data at:"/>
26
+    </RelativeLayout>
27
+    <RelativeLayout
28
+        android:orientation="vertical"
29
+        android:layout_height="fill_parent"
30
+        android:layout_width="0px"
31
+        android:padding="5px"
32
+        android:layout_weight="30">
33
+        <TextView
34
+            android:id="@+id/caption"
35
+            android:layout_width="fill_parent"
36
+            android:layout_height="wrap_content"
37
+            android:layout_below="@id/text"
38
+            android:gravity="center"
39
+            android:text="Caption"/>
40
+        <EditText
41
+            android:id="@+id/entry"
42
+            android:layout_width="fill_parent"
43
+            android:layout_height="wrap_content"
44
+            android:background="@android:drawable/editbox_background"
45
+            android:layout_below="@id/caption" />
46
+        <Button
47
+            android:id="@+id/start"
48
+            android:layout_width="fill_parent"
49
+            android:layout_height="wrap_content"
50
+            android:layout_below="@id/entry"
51
+            android:layout_marginTop="40dip"
52
+            android:text="Start recording"/>
53
+        <Button
54
+            android:id="@+id/upload"
55
+            android:layout_width="fill_parent"
56
+            android:layout_height="wrap_content"
57
+            android:layout_below="@id/start"
58
+            android:text="Upload data"/>
59
+    </RelativeLayout>
60
+</LinearLayout>

+ 8
- 4
code/SensorLogger/res/layout/main.xml 查看文件

@@ -2,12 +2,14 @@
2 2
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     android:orientation="vertical"
4 4
     android:layout_width="fill_parent"
5
-    android:layout_height="fill_parent">" 
5
+    android:layout_height="fill_parent"
6
+    android:padding="5px">
6 7
     <TextView
7 8
         android:id="@+id/text"
8 9
         android:layout_width="fill_parent"
9 10
         android:layout_height="wrap_content"
10
-        android:text="Hello Android from NetBeans"/>
11
+        android:text="Hello Android from NetBeans"
12
+        android:layout_marginBottom="15dip"/>
11 13
     <TextView
12 14
         android:id="@+id/caption"
13 15
         android:layout_width="fill_parent"
@@ -19,7 +21,8 @@
19 21
         android:layout_width="fill_parent"
20 22
         android:layout_height="wrap_content"
21 23
         android:background="@android:drawable/editbox_background"
22
-        android:layout_below="@id/caption" />
24
+        android:layout_below="@id/caption"
25
+        android:layout_marginBottom="15dip"/>
23 26
     <Button
24 27
         android:id="@+id/start"
25 28
         android:layout_width="wrap_content"
@@ -38,5 +41,6 @@
38 41
         android:layout_width="fill_parent"
39 42
         android:layout_height="wrap_content"
40 43
         android:layout_below="@id/upload"
41
-        android:text="View your uploaded data at:"/>
44
+        android:text="View your uploaded data at:"
45
+        android:layout_marginTop="15dip"/>
42 46
 </RelativeLayout>

+ 2
- 4
code/SensorLogger/src/uk/co/md87/android/sensorlogger/MainActivity.java 查看文件

@@ -23,7 +23,7 @@ import android.widget.TextView;
23 23
  */
24 24
 public class MainActivity extends Activity implements OnClickListener {
25 25
 
26
-    static final String VERSION = "0.1.3";
26
+    static final String VERSION = "0.1.4";
27 27
 
28 28
     static String ACTIVITY = "Unknown";
29 29
 
@@ -38,9 +38,7 @@ public class MainActivity extends Activity implements OnClickListener {
38 38
         ((Button) findViewById(R.id.upload)).setOnClickListener(this);
39 39
         ((Button) findViewById(R.id.upload)).setEnabled(false);
40 40
 
41
-        ((TextView) findViewById(R.id.text)).setText("Welcome to sensor logger v"
42
-                + VERSION + "..."
43
-                + "\n\nThis application records any changes in your phone's "
41
+        ((TextView) findViewById(R.id.text)).setText("This application records any changes in your phone's "
44 42
                 + "accelerometer and magnetic field sensors to a text file, "
45 43
                 + "along with the timestamp that the change occured at.\n\n"
46 44
                 + "Once 1,000 entries have been recorded (~50 seconds), the data will be "

+ 1
- 0
code/SensorLogger/src/uk/co/md87/android/sensorlogger/R.java 查看文件

@@ -13,6 +13,7 @@ public final class R {
13 13
     public static final class id {
14 14
         public static final int caption=0x7f040001;
15 15
         public static final int entry=0x7f040002;
16
+        public static final int left=0x7f040006;
16 17
         public static final int start=0x7f040003;
17 18
         public static final int text=0x7f040000;
18 19
         public static final int upload=0x7f040004;

二進制
website/SensorLogger.apk 查看文件


Loading…
取消
儲存