diff options
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_sensor.xml | 7 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_device.xml | 11 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_main_sensor.xml | 28 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_sensor.xml | 34 | ||||
-rw-r--r-- | app/src/main/res/menu/menu_sensor.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/values/colors.xml | 6 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 1 |
7 files changed, 78 insertions, 17 deletions
diff --git a/app/src/main/res/layout/activity_sensor.xml b/app/src/main/res/layout/activity_sensor.xml new file mode 100644 index 0000000..c91e018 --- /dev/null +++ b/app/src/main/res/layout/activity_sensor.xml @@ -0,0 +1,7 @@ +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/container" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context="io.trygvis.soilmoisture.SensorActivity" + tools:ignore="MergeRootFrame"/> diff --git a/app/src/main/res/layout/fragment_device.xml b/app/src/main/res/layout/fragment_device.xml index e6a2f25..097ba34 100644 --- a/app/src/main/res/layout/fragment_device.xml +++ b/app/src/main/res/layout/fragment_device.xml @@ -6,12 +6,19 @@ android:clickable="true"> <TextView + android:layout_width="match_parent" + android:layout_height="10sp" + android:id="@+id/status_bar" + android:layout_alignParentEnd="true" + android:layout_marginTop="0dp" + android:background="@color/red"/> + + <TextView android:id="@+id/device_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="24sp" - android:layout_alignParentTop="true" - android:layout_marginTop="0dp"/> + android:layout_below="@+id/status_bar"/> <TextView android:id="@+id/device_address" diff --git a/app/src/main/res/layout/fragment_main_sensor.xml b/app/src/main/res/layout/fragment_main_sensor.xml new file mode 100644 index 0000000..157dcc2 --- /dev/null +++ b/app/src/main/res/layout/fragment_main_sensor.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_height="wrap_content" + android:layout_width="wrap_content"> + + <TextView + android:layout_width="match_parent" + android:layout_height="10dp" + android:id="@+id/status_bar" + android:layout_alignParentEnd="true" + android:layout_marginTop="0dp" + android:background="@color/red"/> + + <TextView + android:id="@+id/description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/status_bar"/> + + <ProgressBar + style="?android:attr/progressBarStyleHorizontal" + android:id="@+id/sensor_progress" + android:layout_width="fill_parent" + android:layout_height="20dp" + android:layout_below="@id/description"/> + +</RelativeLayout> diff --git a/app/src/main/res/layout/fragment_sensor.xml b/app/src/main/res/layout/fragment_sensor.xml index 82d0d77..4d911ca 100644 --- a/app/src/main/res/layout/fragment_sensor.xml +++ b/app/src/main/res/layout/fragment_sensor.xml @@ -1,21 +1,25 @@ -<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_height="wrap_content" - android:layout_width="wrap_content"> + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingTop="@dimen/activity_vertical_margin" + android:paddingBottom="@dimen/activity_vertical_margin" + tools:context="io.trygvis.soilmoisture.SensorActivity$PlaceholderFragment"> <TextView - android:id="@+id/description" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:layout_marginTop="0dp"/> + android:text="@string/hello_world" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> - <ProgressBar - style="?android:attr/progressBarStyleHorizontal" - android:id="@+id/sensor_progress" - android:layout_width="fill_parent" - android:layout_height="20dp" - android:layout_below="@id/description"/> + <Button + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/refresh" + android:id="@+id/button" + android:layout_alignParentBottom="true" + android:layout_alignParentStart="true" + android:layout_alignParentEnd="true"/> </RelativeLayout> diff --git a/app/src/main/res/menu/menu_sensor.xml b/app/src/main/res/menu/menu_sensor.xml new file mode 100644 index 0000000..1b2de78 --- /dev/null +++ b/app/src/main/res/menu/menu_sensor.xml @@ -0,0 +1,8 @@ +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:context="io.trygvis.soilmoisture.SensorActivity"> + <item android:id="@+id/action_settings" + android:title="@string/action_settings" + android:orderInCategory="100" + android:showAsAction="never"/> +</menu> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..1df95ce --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="red">#ff0000</color> + <color name="yellow">#ffff00</color> + <color name="green">#00ff00</color> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 26f42fe..d1934f0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -37,5 +37,6 @@ <string name="yes">Yes</string> <string name="no">No</string> <string name="error_could_not_read_value">Could not read value</string> + <string name="title_activity_sensor">Sensor</string> </resources> |