diff options
| author | Keith Packard <keithp@keithp.com> | 2012-08-29 11:29:24 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-08-29 11:29:24 -0700 |
| commit | 583458772746317b98fced907ec780edff465888 (patch) | |
| tree | 8ba200b22edf19d554fe896eeea894f916cef87c /altosdroid/res | |
| parent | aea10c107dff2643677a9c8d1fc41e14f4a66049 (diff) | |
| parent | 17b6ffb6c090112367eac944494f0fa58da453c7 (diff) | |
Merge remote-tracking branch 'mjb/master'
Pull in Mike's fancy new AltosDroid bits
Diffstat (limited to 'altosdroid/res')
| -rw-r--r-- | altosdroid/res/layout/altosdroid.xml | 350 | ||||
| -rw-r--r-- | altosdroid/res/layout/main.xml | 22 | ||||
| -rw-r--r-- | altosdroid/res/layout/telemetry_service_binding.xml | 42 | ||||
| -rw-r--r-- | altosdroid/res/layout/telemetry_service_controller.xml | 42 | ||||
| -rw-r--r-- | altosdroid/res/menu/option_menu.xml | 6 | ||||
| -rw-r--r-- | altosdroid/res/values/strings.xml | 47 |
6 files changed, 373 insertions, 136 deletions
diff --git a/altosdroid/res/layout/altosdroid.xml b/altosdroid/res/layout/altosdroid.xml new file mode 100644 index 00000000..33d89d52 --- /dev/null +++ b/altosdroid/res/layout/altosdroid.xml @@ -0,0 +1,350 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2009 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. +--> + <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_weight="0" > + + <RelativeLayout + android:id="@+id/strut" + android:layout_width="10dip" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" > + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/callsign_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_toLeftOf="@+id/strut" > + + <TextView + android:id="@+id/callsign_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/callsign_label" /> + + <TextView + android:id="@+id/callsign_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@id/callsign_label" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/state_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_toRightOf="@+id/strut" > + + <TextView + android:id="@+id/state_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/state_label" /> + + <TextView + android:id="@+id/state_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@+id/state_label" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/speed_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_below="@+id/callsign_container" + android:layout_toLeftOf="@+id/strut" > + + <TextView + android:id="@+id/speed_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/speed_label" /> + + <TextView + android:id="@+id/speed_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/speed_label" + android:layout_toLeftOf="@+id/speed_units" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/speed_units" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@id/speed_value" + android:layout_alignParentRight="true" + android:layout_below="@id/speed_label" + android:gravity="right" + android:paddingLeft="10dip" + android:text="@string/speed_units" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/accel_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@+id/state_container" + android:layout_toRightOf="@+id/strut" > + + <TextView + android:id="@+id/accel_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/accel_label" /> + + <TextView + android:id="@+id/accel_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/accel_label" + android:layout_toLeftOf="@+id/accel_units" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/accel_units" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/accel_value" + android:layout_alignParentRight="true" + android:layout_below="@+id/accel_label" + android:gravity="right" + android:paddingLeft="10dip" + android:text="@string/accel_units" + android:textAppearance="?android:attr/textAppearanceMedium" /> + </RelativeLayout> + + <RelativeLayout + android:id="@+id/range_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_below="@+id/speed_container" + android:layout_toLeftOf="@+id/strut" > + + <TextView + android:id="@+id/range_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/range_label" /> + + <TextView + android:id="@+id/range_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/range_label" + android:layout_toLeftOf="@+id/range_units" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/range_units" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/range_value" + android:layout_alignParentRight="true" + android:layout_below="@+id/range_label" + android:gravity="right" + android:paddingLeft="10dip" + android:text="@string/range_units" + android:textAppearance="?android:attr/textAppearanceMedium" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/altitude_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@id/accel_container" + android:layout_toRightOf="@id/strut" > + + <TextView + android:id="@+id/altitude_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/altitude_label" /> + + <TextView + android:id="@+id/altitude_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/altitude_label" + android:layout_toLeftOf="@+id/altitude_units" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/altitude_units" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/altitude_value" + android:layout_alignParentRight="true" + android:layout_below="@+id/altitude_label" + android:gravity="right" + android:paddingLeft="10dip" + android:text="@string/altitude_units" + android:textAppearance="?android:attr/textAppearanceMedium" /> + </RelativeLayout> + + <RelativeLayout + android:id="@+id/azimuth_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_below="@id/range_container" + android:layout_toLeftOf="@id/strut" > + + <TextView + android:id="@+id/azimuth_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/azimuth_label" /> + + <TextView + android:id="@+id/azimuth_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/azimuth_label" + android:layout_toLeftOf="@+id/azimuth_units" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/azimuth_units" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@+id/azimuth_label" + android:gravity="right" + android:paddingLeft="10dip" + android:text="@string/azimuth_units" + android:textAppearance="?android:attr/textAppearanceMedium" /> + </RelativeLayout> + + <RelativeLayout + android:id="@+id/bearing_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@+id/altitude_container" + android:layout_toRightOf="@+id/strut" > + + <TextView + android:id="@+id/bearing_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/bearing_label" /> + + <TextView + android:id="@+id/bearing_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/bearing_label" + android:layout_toLeftOf="@+id/bearing_units" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + <TextView + android:id="@+id/bearing_units" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@+id/bearing_label" + android:gravity="right" + android:paddingLeft="10dip" + android:text="@string/bearing_units" + android:textAppearance="?android:attr/textAppearanceMedium" /> + </RelativeLayout> + + <RelativeLayout + android:id="@+id/latitude_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/azimuth_container" > + + <TextView + android:id="@+id/latitude_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/latitude_label" /> + + <TextView + android:id="@+id/latitude_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@+id/latitude_label" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + </RelativeLayout> + + <RelativeLayout + android:id="@+id/longitude_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/latitude_container" > + + <TextView + android:id="@+id/longitude_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/longitude_label" /> + + <TextView + android:id="@+id/longitude_value" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_below="@+id/longitude_label" + android:text="" + android:textAppearance="?android:attr/textAppearanceLarge" /> + + </RelativeLayout> + + <TextView + android:id="@+id/text" + android:layout_width="fill_parent" + android:layout_height="0dip" + android:layout_alignParentBottom="true" + android:layout_below="@id/longitude_container" + android:gravity="bottom" + android:scrollbars="vertical" + android:textSize="7dp" + android:typeface="monospace" /> + + </RelativeLayout> diff --git a/altosdroid/res/layout/main.xml b/altosdroid/res/layout/main.xml index 070928a5..00ca63c8 100644 --- a/altosdroid/res/layout/main.xml +++ b/altosdroid/res/layout/main.xml @@ -23,31 +23,11 @@ <TextView android:id="@+id/in" android:layout_width="fill_parent" - android:layout_height="fill_parent" + android:layout_height="0dip" android:layout_weight="1" android:gravity="bottom" android:scrollbars="vertical" android:textSize="7dp" android:typeface="monospace" /> - <LinearLayout - android:orientation="horizontal" - android:layout_width="match_parent" - android:layout_height="wrap_content" - > - - <EditText - android:id="@+id/edit_text_out" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:layout_weight="1" - android:inputType="text|textNoSuggestions" /> - - <Button android:id="@+id/button_send" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/send" - /> - </LinearLayout> </LinearLayout> diff --git a/altosdroid/res/layout/telemetry_service_binding.xml b/altosdroid/res/layout/telemetry_service_binding.xml deleted file mode 100644 index 950d0d3a..00000000 --- a/altosdroid/res/layout/telemetry_service_binding.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 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. ---> - -<!-- Demonstrates starting and stopping a local service. - See corresponding Java code com.android.sdk.app.LocalSerice.java. --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip" - android:gravity="center_horizontal" - android:layout_width="match_parent" android:layout_height="match_parent"> - - <TextView - android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="0" - android:paddingBottom="4dip" - android:text="@string/telemetry_service_binding"/> - - <Button android:id="@+id/bind" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/bind_service"> - <requestFocus /> - </Button> - - <Button android:id="@+id/unbind" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/unbind_service"> - </Button> - -</LinearLayout> - diff --git a/altosdroid/res/layout/telemetry_service_controller.xml b/altosdroid/res/layout/telemetry_service_controller.xml deleted file mode 100644 index 189d2f6c..00000000 --- a/altosdroid/res/layout/telemetry_service_controller.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 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. ---> - -<!-- Demonstrates starting and stopping a local service. - See corresponding Java code com.android.sdk.app.LocalSerice.java. --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip" - android:gravity="center_horizontal" - android:layout_width="match_parent" android:layout_height="match_parent"> - - <TextView - android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="0" - android:paddingBottom="4dip" - android:text="@string/telemetry_service_controller"/> - - <Button android:id="@+id/start" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/start_service"> - <requestFocus /> - </Button> - - <Button android:id="@+id/stop" - android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/stop_service"> - </Button> - -</LinearLayout> - diff --git a/altosdroid/res/menu/option_menu.xml b/altosdroid/res/menu/option_menu.xml index feb5668e..6946e298 100644 --- a/altosdroid/res/menu/option_menu.xml +++ b/altosdroid/res/menu/option_menu.xml @@ -17,10 +17,4 @@ <item android:id="@+id/connect_scan" android:icon="@android:drawable/ic_menu_search" android:title="@string/connect_device" /> - <item android:id="@+id/telemetry_service_control" - android:icon="@android:drawable/ic_menu_manage" - android:title="@string/telemetry_service_control" /> - <item android:id="@+id/telemetry_service_bind" - android:icon="@android:drawable/ic_menu_rotate" - android:title="@string/telemetry_service_bind" /> </menu> diff --git a/altosdroid/res/values/strings.xml b/altosdroid/res/values/strings.xml index 72a4ddec..59f4f827 100644 --- a/altosdroid/res/values/strings.xml +++ b/altosdroid/res/values/strings.xml @@ -17,14 +17,15 @@ <resources> <string name="app_name">AltosDroid</string> - <!-- BluetoothChat --> - <string name="send">Send</string> - <string name="not_connected">You are not connected to a device</string> - <string name="bt_not_enabled_leaving">Bluetooth was not enabled. Leaving Bluetooth Chat.</string> + <!-- AltosDroid --> + <string name="bt_not_enabled">Bluetooth was not enabled.</string> <string name="title_connecting">connecting…</string> <string name="title_connected_to">connected: </string> <string name="title_not_connected">not connected</string> + <!-- Options Menu --> + <string name="connect_device">Connect a device</string> + <!-- DeviceListActivity --> <string name="scanning">scanning for devices…</string> <string name="select_device">select a device to connect</string> @@ -34,33 +35,29 @@ <string name="title_other_devices">Other Available Devices</string> <string name="button_scan">Scan for devices</string> - <!-- Options Menu --> - <string name="connect_device">Connect a device</string> - <string name="telemetry_service_control">Control Service</string> - <string name="telemetry_service_bind">(Un)Bind Service</string> - - - <!-- Service --> <string name="telemetry_service_label">AltosDroid Telemetry Service</string> <string name="telemetry_service_started">Telemetry Service Started</string> <string name="telemetry_service_stopped">Telemetry Service Stopped</string> - <!-- Service control activity - temporary! --> - <string name="activity_telemetry_service_controller">Telemetry Service Controller</string> - <string name="telemetry_service_controller">Use the following buttons to start and stop the Telemetry - service.</string> - <string name="start_service">Start Service</string> - <string name="stop_service">Stop Service</string> - <string name="activity_telemetry_service_binding">Telemetry Service Binding</string> - <string name="telemetry_service_binding">This demonstrates how you can connect with a persistent - service. Notice how it automatically starts for you, and play around with the - interaction between this and Local Service Controller.</string> - <string name="bind_service">Bind Service</string> - <string name="unbind_service">Unbind Service</string> + <!-- UI fields --> + <string name="callsign_label">Callsign</string> + <string name="state_label">State</string> + <string name="speed_label">Speed</string> + <string name="speed_units">m/s</string> + <string name="accel_label">Acceleration</string> + <string name="accel_units">m/s²</string> + <string name="range_label">Range</string> + <string name="range_units">m</string> + <string name="altitude_label">Altitude</string> + <string name="altitude_units">m</string> + <string name="azimuth_label">Azimuth</string> + <string name="azimuth_units">°</string> + <string name="bearing_label">Bearing</string> + <string name="bearing_units">°</string> + <string name="latitude_label">Latitude</string> + <string name="longitude_label">Longitude</string> - <string name="telemetry_service_connected">Connected to local service</string> - <string name="telemetry_service_disconnected">Disconnected from local service</string> </resources> |
