aboutsummaryrefslogtreecommitdiff
path: root/tests/GarageModeTestApp
diff options
context:
space:
mode:
authorSerik Beketayev <serikb@google.com>2018-07-19 14:21:11 -0700
committerSerik Beketayev <serikb@google.com>2018-07-24 05:07:55 +0000
commite47688a240a971ec2feeab3341a59b9b7d847276 (patch)
tree6a55f54329e052955155ecf8a8baf431471abdb0 /tests/GarageModeTestApp
parent2310282b3e817a1c723787b68cf6e9db5c76946c (diff)
downloadCar-e47688a240a971ec2feeab3341a59b9b7d847276.tar.gz
[GarageModeTestApp] UI improvements
* Add border and label to sections - GarageMode settings - Job Configuration, change button name to schedule job - Events log - Scheduled Jobs * Add label for the network connectivity dropdown * Decrease checkbox font sizes * Increase text labels font size * Make dropdown to wrap content Test: Mostly UI changes Bug: 111353018 Change-Id: Ia12b5b07612b5560a3dc7b2f86b6efa2f6c613ec (cherry picked from commit 07f14c413d681ee4d2277f3a6ca2d3eb1408b69f)
Diffstat (limited to 'tests/GarageModeTestApp')
-rw-r--r--tests/GarageModeTestApp/AndroidManifest.xml2
-rw-r--r--tests/GarageModeTestApp/res/drawable/border.xml26
-rw-r--r--tests/GarageModeTestApp/res/layout/activity_content.xml1
-rw-r--r--tests/GarageModeTestApp/res/layout/job_info_row.xml43
-rw-r--r--tests/GarageModeTestApp/res/layout/offcar_testing.xml215
-rw-r--r--tests/GarageModeTestApp/res/values/strings.xml29
-rw-r--r--tests/GarageModeTestApp/res/values/styles.xml54
7 files changed, 245 insertions, 125 deletions
diff --git a/tests/GarageModeTestApp/AndroidManifest.xml b/tests/GarageModeTestApp/AndroidManifest.xml
index e7255ba220..b33520f21b 100644
--- a/tests/GarageModeTestApp/AndroidManifest.xml
+++ b/tests/GarageModeTestApp/AndroidManifest.xml
@@ -25,7 +25,7 @@
<application android:label="GarageModeTestApp">
<activity android:name=".MainActivity"
- android:theme="@style/Theme.Car.Light.NoActionBar.Drawer"
+ android:theme="@style/GarageModeTheme"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
diff --git a/tests/GarageModeTestApp/res/drawable/border.xml b/tests/GarageModeTestApp/res/drawable/border.xml
new file mode 100644
index 0000000000..de84a3c23d
--- /dev/null
+++ b/tests/GarageModeTestApp/res/drawable/border.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <corners
+ android:bottomRightRadius="5dp"
+ android:bottomLeftRadius="5dp"
+ android:topLeftRadius="5dp"
+ android:topRightRadius="5dp"/>
+ <stroke
+ android:width="2dip"
+ android:color="#212121" />
+</shape> \ No newline at end of file
diff --git a/tests/GarageModeTestApp/res/layout/activity_content.xml b/tests/GarageModeTestApp/res/layout/activity_content.xml
index b98799dc5e..4ae4c8df8d 100644
--- a/tests/GarageModeTestApp/res/layout/activity_content.xml
+++ b/tests/GarageModeTestApp/res/layout/activity_content.xml
@@ -13,7 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
<!-- We use this container to place app fragments. It insets the fragment contents -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_content"
diff --git a/tests/GarageModeTestApp/res/layout/job_info_row.xml b/tests/GarageModeTestApp/res/layout/job_info_row.xml
index 6ba32058a6..64d0619e30 100644
--- a/tests/GarageModeTestApp/res/layout/job_info_row.xml
+++ b/tests/GarageModeTestApp/res/layout/job_info_row.xml
@@ -13,32 +13,27 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent" >
- <Button
- android:id="@+id/jobInfoButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:text="@string/job_info_btn"
- android:layout_margin="5dp"/>
+ android:layout_height="match_parent"
+ android:weightSum="3">
<TextView
+ style="@style/ListEntryField"
android:id="@+id/jobId"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:textStyle="bold"
- android:layout_toLeftOf="@id/jobInfoButton"/>
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_weight="1"/>
<TextView
+ style="@style/ListEntryField"
android:id="@+id/jobState"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentBottom="true"
- android:textStyle="bold"
- android:layout_toLeftOf="@id/jobInfoButton"
- android:layout_below="@id/jobId"/>
-</RelativeLayout> \ No newline at end of file
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_weight="1"/>
+ <Button
+ style="@style/Button"
+ android:id="@+id/jobInfoButton"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/button_job_info"
+ android:layout_weight="1"/>
+</LinearLayout>
diff --git a/tests/GarageModeTestApp/res/layout/offcar_testing.xml b/tests/GarageModeTestApp/res/layout/offcar_testing.xml
index 3fdc087784..fd57fb1a64 100644
--- a/tests/GarageModeTestApp/res/layout/offcar_testing.xml
+++ b/tests/GarageModeTestApp/res/layout/offcar_testing.xml
@@ -21,140 +21,177 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
- android:weightSum="3"
android:orientation="vertical">
<LinearLayout
+ style="@style/SectionContainer"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:weightSum="2"
+ android:orientation="vertical">
+ <TextView
+ style="@style/SectionHeader"
+ android:text="@string/section_header_garage_mode_config"/>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="horizontal">
+ <TextView
+ style="@style/SpinnerLabel"
+ android:layout_height="match_parent"
+ android:text="@string/spinner_label_garage_mode_duration"/>
+ <LinearLayout
+ style="@style/SectionContainer"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <Spinner
+ style="@style/Spinner"
+ android:id="@+id/garageModeDuration"/>
+ </LinearLayout>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:weightSum="2">
+ <Button
+ style="@style/Button"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:text="@string/button_enter_garage_mode"/>
+ <Button
+ style="@style/Button"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:text="@string/button_exit_garage_mode"/>
+ </LinearLayout>
+ </LinearLayout>
+ <LinearLayout
+ style="@style/SectionContainer"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <TextView
+ style="@style/SectionHeader"
+ android:text="@string/section_header_watchdog"/>
+ <TextView
+ android:id="@+id/garageModeWatchdog"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textSize="18sp"
+ android:text="@string/no_results"
+ android:scrollbars="vertical"/>
+ </LinearLayout>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical">
+ <LinearLayout
+ style="@style/SectionContainer"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:orientation="vertical"
- android:weightSum="3">
+ android:weightSum="5">
+ <TextView
+ style="@style/SectionHeader"
+ android:layout_weight="1"
+ android:text="@string/section_header_job_configuration"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
- <Spinner
- android:id="@+id/networkType"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
- </Spinner>
+ <TextView
+ style="@style/SpinnerLabel"
+ android:text="@string/spinner_label_network_type"/>
+ <LinearLayout
+ style="@style/SectionContainer"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <Spinner
+ style="@style/Spinner"
+ android:id="@+id/networkType"/>
+ </LinearLayout>
+ </LinearLayout>
<CheckBox
+ style="@style/Checkbox"
android:id="@+id/requirePersistedCheckbox"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
- android:text="@string/require_persisted"/>
+ android:text="@string/checkbox_require_persisted"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_weight="1">
+ android:layout_weight="1"
+ android:weightSum="2">
<CheckBox
+ style="@style/Checkbox"
android:id="@+id/requireIdlenessCheckbox"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
- android:text="@string/require_idleness"/>
+ android:text="@string/checkbox_require_idleness"/>
<CheckBox
+ style="@style/Checkbox"
android:id="@+id/requireChargingCheckbox"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
- android:text="@string/require_charging"/>
+ android:text="@string/checkbox_require_charging"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
- android:weightSum="2"
android:orientation="horizontal">
<TextView
- android:layout_width="250px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:textStyle="bold"
- android:gravity="center_vertical|end"
- android:text="@string/job_duration_label"/>
- <Spinner
- android:id="@+id/jobDuration"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"/>
+ style="@style/SpinnerLabel"
+ android:text="@string/spinner_label_job_duration"/>
+ <LinearLayout
+ style="@style/SectionContainer"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <Spinner
+ style="@style/Spinner"
+ android:id="@+id/jobDuration"/>
+ </LinearLayout>
</LinearLayout>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:weightSum="3"
- android:orientation="vertical">
<Button
+ style="@style/Button"
android:id="@+id/addJobBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:text="@string/add_job_btn"
- android:layout_weight="1"
- android:layout_margin="5dp"/>
- <LinearLayout
+ android:text="@string/button_schedule_job"
+ android:layout_weight="1"/>
+ </LinearLayout>
+ <LinearLayout
+ style="@style/SectionContainer"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <TextView
+ style="@style/SectionHeader"
+ android:text="@string/section_header_jobs_list"/>
+ <ListView
+ android:id="@+id/jobsListView"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:orientation="horizontal">
- <TextView
- android:layout_width="250px"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:textStyle="bold"
- android:gravity="center_vertical|end"
- android:text="@string/garage_mode_duration_label"/>
- <Spinner
- android:id="@+id/garageModeDuration"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"/>
- </LinearLayout>
- <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:focusable="false"/>
+ <TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_weight="1"
- android:weightSum="2">
- <Button
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:text="@string/enter_garage_mode"
- android:layout_margin="5dp"/>
- <Button
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:text="@string/exit_garage_mode"
- android:layout_margin="5dp"/>
- </LinearLayout>
+ android:text="@string/no_results"/>
</LinearLayout>
- <TextView
- android:id="@+id/garageModeWatchdog"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:textSize="14sp"
- android:text="@string/empty_list_txt"
- android:scrollbars = "vertical"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1">
- <ListView
- android:id="@+id/jobsListView"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:focusable="false"/>
- <TextView android:id="@android:id/empty"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:text="@string/empty_list_txt"/>
</LinearLayout>
</LinearLayout> \ No newline at end of file
diff --git a/tests/GarageModeTestApp/res/values/strings.xml b/tests/GarageModeTestApp/res/values/strings.xml
index 72a40ff733..e41aa0a722 100644
--- a/tests/GarageModeTestApp/res/values/strings.xml
+++ b/tests/GarageModeTestApp/res/values/strings.xml
@@ -16,16 +16,25 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">GarageMode Test App</string>
- <string name="job_info_btn">Job Info</string>
- <string name="require_persisted">Persisted?</string>
- <string name="require_idleness">Require idleness?</string>
- <string name="require_charging">Require charging?</string>
- <string name="add_job_btn">Add job</string>
- <string name="enter_garage_mode">Enter GarageMode</string>
- <string name="exit_garage_mode">Exit GarageMode</string>
- <string name="empty_list_txt">No Results</string>
- <string name="job_duration_label">Job duration:</string>
- <string name="garage_mode_duration_label">GarageMode max duration:</string>
+ <string name="button_schedule_job">Schedule Job</string>
+ <string name="button_job_info">Job Info</string>
+ <string name="button_enter_garage_mode">Enter GarageMode</string>
+ <string name="button_exit_garage_mode">Exit GarageMode</string>
+
+ <string name="checkbox_require_persisted">Persisted?</string>
+ <string name="checkbox_require_idleness">Require idleness?</string>
+ <string name="checkbox_require_charging">Require charging?</string>
+
+ <string name="no_results">No Results</string>
+
+ <string name="section_header_garage_mode_config">GarageMode Settings</string>
+ <string name="section_header_job_configuration">Job Configuration</string>
+ <string name="section_header_jobs_list">Scheduled Jobs</string>
+ <string name="section_header_watchdog">Watchdog</string>
+
+ <string name="spinner_label_garage_mode_duration">GarageMode max duration:</string>
+ <string name="spinner_label_job_duration">Job duration:</string>
+ <string name="spinner_label_network_type">Network type:</string>
<string-array name="network_types_list">
<item>ANY</item>
diff --git a/tests/GarageModeTestApp/res/values/styles.xml b/tests/GarageModeTestApp/res/values/styles.xml
new file mode 100644
index 0000000000..6d482a1aba
--- /dev/null
+++ b/tests/GarageModeTestApp/res/values/styles.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <style name="GarageModeTheme" parent="Theme.Car.Light.NoActionBar.Drawer">
+ <item name="android:textSize">24sp</item>
+ </style>
+ <style name="SectionContainer">
+ <!-- Customize your theme here. -->
+ <item name="android:background">@drawable/border</item>
+ <item name="android:padding">3dp</item>
+ <item name="android:layout_margin">5dp</item>
+ </style>
+ <style name="Button">
+ <item name="android:layout_margin">5dp</item>
+ </style>
+ <style name="Checkbox">
+ <item name="android:background">@drawable/border</item>
+ </style>
+ <style name="SpinnerLabel">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:textStyle">bold</item>
+ <item name="android:gravity">center_vertical|end</item>
+ <item name="android:layout_height">match_parent</item>
+ </style>
+ <style name="Spinner">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">match_parent</item>
+ </style>
+ <style name="SectionHeader">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:textStyle">bold</item>
+ <item name="android:textSize">26sp</item>
+ <item name="android:layout_marginBottom">5dp</item>
+ <item name="android:gravity">center</item>
+ </style>
+ <style name="ListEntryField">
+ <item name="android:layout_margin">5dp</item>
+ <item name="android:gravity">center_vertical</item>
+ </style>
+</resources> \ No newline at end of file