Merge to head

This commit is contained in:
Rodrigo Damazio
2012-01-02 19:03:07 -02:00
parent 1bd6e53f04
commit c3912042e9
125 changed files with 1852 additions and 3675 deletions
+3 -3
View File
@@ -17,8 +17,8 @@ limitations under the License.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.maps.mytracks"
android:installLocation="auto"
android:versionCode="34"
android:versionName="1.1.11">
android:versionCode="36"
android:versionName="1.1.13">
<application android:icon="@drawable/arrow_icon"
android:label="@string/my_tracks_app_name"
android:name="com.google.android.apps.mytracks.MyTracksApplication"
@@ -84,7 +84,7 @@ limitations under the License.
android:value="com.google.android.apps.mytracks.SearchActivity" />
</activity>
<activity android:name="com.google.android.apps.mytracks.TrackDetails"
<activity android:name="com.google.android.apps.mytracks.TrackDetail"
android:label="@string/track_detail_title">
<intent-filter>
<action android:name="android.intent.action.EDIT" />
+1 -1
View File
@@ -11,5 +11,5 @@
split.density=false
proguard.config=proguard.cfg
# Project target.
target=Google Inc.:Google APIs:14
target=Google Inc.:Google APIs:15
android.library.reference.1=../MyTracksLib
Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 275 B

+82 -77
View File
@@ -17,86 +17,91 @@ limitations under the License.
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TableLayout
android:layout_width="fill_parent">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingBottom="2dp"
android:stretchColumns="1">
<TableRow style="@style/AboutTableRow">
<ImageView
android:layout_column="0"
android:scaleType="center"
android:src="@drawable/arrow_icon"/>
<LinearLayout
android:layout_column="1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:orientation="vertical"
android:padding="10dp">
<!-- Title -->
<TableLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:padding="2dp"
android:shrinkColumns="0"
android:stretchColumns="1">
<TableRow>
<ImageView
android:layout_column="0"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/my_tracks_app_name"
android:textSize="30sp" />
<TextView
android:scaleType="center"
android:src="@drawable/arrow_icon"/>
<LinearLayout
android:layout_column="1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/about_copyright_notice"
android:textSize="15sp" />
</LinearLayout>
</TableRow>
<TableRow style="@style/AboutTableRow">
<TextView
android:text="@string/about_team"
style="@style/AboutTextView.Column0"/>
<LinearLayout
android:layout_column="1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">
<TextView
android:text="@string/about_bart"
style="@style/AboutTextView"/>
<TextView
android:text="@string/about_dylan"
style="@style/AboutTextView"/>
<TextView
android:text="@string/about_jimmy"
style="@style/AboutTextView"/>
<TextView
android:text="@string/about_leif"
style="@style/AboutTextView"/>
<TextView
android:text="@string/about_rodrigo"
style="@style/AboutTextView"/>
<TextView
android:text="@string/about_sandor"
style="@style/AboutTextView"/>
</LinearLayout>
</TableRow>
<TableRow style="@style/AboutTableRow">
<TextView
android:text="@string/about_version"
style="@style/AboutTextView.Column0"/>
<TextView
android:id="@+id/about_version"
style="@style/AboutTextView"/>
</TableRow>
<TableRow style="@style/AboutTableRow">
<TextView
android:text="@string/about_support"
style="@style/AboutTextView.Column0"/>
<TextView
android:text="@string/my_tracks_web_url"
style="@style/AboutTextView.Url"/>
</TableRow>
<TableRow style="@style/AboutTableRow">
<TextView
android:text="@string/about_privacy"
style="@style/AboutTextView.Column0"/>
<TextView
android:text="@string/my_tracks_privacy_url"
style="@style/AboutTextView.Url"/>
</TableRow>
</TableLayout>
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/my_tracks_app_name"
android:textSize="30sp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/about_copyright_notice"
android:textSize="15sp"/>
</LinearLayout>
</TableRow>
</TableLayout>
<!-- Team -->
<TextView
android:text="@string/about_team"
style="@style/AboutLabel"/>
<TextView
android:text="@string/about_bart"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_dylan"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_jimmy"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_leif"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_rodrigo"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_sandor"
style="@style/AboutItem"/>
<!-- Version -->
<TextView
android:text="@string/about_version"
style="@style/AboutLabel"/>
<TextView
android:id="@+id/about_version"
style="@style/AboutItem"/>
<!-- Support -->
<TextView
android:text="@string/about_support"
style="@style/AboutLabel"/>
<TextView
android:text="@string/my_tracks_web_url"
style="@style/AboutUrl"/>
<!-- Privacy -->
<TextView
android:text="@string/about_privacy"
style="@style/AboutLabel"/>
<TextView
android:text="@string/my_tracks_privacy_url"
style="@style/AboutUrl"/>
</LinearLayout>
</ScrollView>
+76 -106
View File
@@ -17,120 +17,90 @@ limitations under the License.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:minWidth="300dp"
android:orientation="vertical">
<LinearLayout
android:background="@drawable/list_bar"
<TableLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<TextView
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_width="fill_parent"
android:text="@string/menu_chart_view_chart_settings"
android:textColor="#fff"
android:textSize="20sp"/>
</LinearLayout>
android:layout_width="fill_parent"
android:shrinkColumns="0"
android:stretchColumns="0">
<TableRow>
<TextView
android:background="@drawable/list_bar"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:paddingLeft="10dp"
android:text="@string/menu_chart_view_chart_settings"
android:textColor="@color/white"
android:textSize="20sp"/>
</TableRow>
</TableLayout>
<ScrollView
android:layout_height="0dp"
android:layout_weight="1"
android:layout_width="fill_parent">
<TableLayout
<LinearLayout
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_width="fill_parent"
android:stretchColumns="1">
<TableRow>
<LinearLayout
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_width="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/x_axis"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/chart_settings_x_axis"
android:textSize="20sp"/>
</LinearLayout>
<RadioGroup
android:id="@+id/chart_settings_x"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<RadioButton
android:id="@+id/chart_settings_by_distance"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/chart_settings_by_distance"/>
<RadioButton
android:id="@+id/chart_settings_by_time"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/chart_settings_by_time"/>
</RadioGroup>
</LinearLayout>
</TableRow>
<TableRow>
<LinearLayout
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_width="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/y_axis"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/chart_settings_y_axis"
android:textSize="20sp" />
</LinearLayout>
<CheckBox
android:id="@+id/chart_settings_elevation"
android:checked="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/stat_elevation"/>
<CheckBox
android:id="@+id/chart_settings_speed"
android:checked="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/stat_speed"/>
<CheckBox
android:id="@+id/chart_settings_power"
android:checked="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/sensor_state_power"/>
<CheckBox
android:id="@+id/chart_settings_cadence"
android:checked="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/sensor_state_cadence"/>
<CheckBox
android:id="@+id/chart_settings_heart_rate"
android:checked="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/sensor_state_heart_rate"/>
</LinearLayout>
</TableRow>
</TableLayout>
android:orientation="vertical"
android:padding="10dp">
<!-- X axis -->
<LinearLayout style="@style/ChartSettingsAxisLayout">
<ImageView
android:src="@drawable/x_axis"
style="@style/ChartSettingsAxisImage"/>
<TextView
android:text="@string/chart_settings_x_axis"
style="@style/ChartSettingsAxisText"/>
</LinearLayout>
<RadioGroup
android:id="@+id/chart_settings_x"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<RadioButton
android:id="@+id/chart_settings_by_distance"
android:text="@string/chart_settings_by_distance"
style="@style/ChartSettingsRadioButton"/>
<RadioButton
android:id="@+id/chart_settings_by_time"
android:text="@string/chart_settings_by_time"
style="@style/ChartSettingsRadioButton"/>
</RadioGroup>
<!-- Y axis -->
<LinearLayout
android:paddingTop="10dp"
style="@style/ChartSettingsAxisLayout">
<ImageView
android:src="@drawable/y_axis"
style="@style/ChartSettingsAxisImage"/>
<TextView
android:text="@string/chart_settings_y_axis"
style="@style/ChartSettingsAxisText"/>
</LinearLayout>
<CheckBox
android:id="@+id/chart_settings_elevation"
android:text="@string/stat_elevation"
style="@style/ChartSettingsCheckbox"/>
<CheckBox
android:id="@+id/chart_settings_speed"
android:text="@string/stat_speed"
style="@style/ChartSettingsCheckbox"/>
<CheckBox
android:id="@+id/chart_settings_power"
android:text="@string/sensor_state_power"
style="@style/ChartSettingsCheckbox"/>
<CheckBox
android:id="@+id/chart_settings_cadence"
android:text="@string/sensor_state_cadence"
style="@style/ChartSettingsCheckbox"/>
<CheckBox
android:id="@+id/chart_settings_heart_rate"
android:text="@string/sensor_state_heart_rate"
style="@style/ChartSettingsCheckbox"/>
</LinearLayout>
</ScrollView>
<LinearLayout style="@style/ButtonLayout">
<LinearLayout style="@style/ButtonSpacer"/>
-83
View File
@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010 Google Inc.
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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="10dip"
android:background="#c000">
<TextView android:text="@string/track_detail_track_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView android:id="@+id/trackdetails_icon"
android:src="@drawable/track"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="4dip"
android:paddingRight="4dip"/>
<EditText android:id="@+id/trackdetails_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:autoText="true"
android:capitalize="words"
android:selectAllOnFocus="true"
android:hint="@string/track_detail_track_name"
android:imeOptions="actionNext"/>
</LinearLayout>
<TextView android:text="@string/track_detail_activity_type"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<AutoCompleteTextView android:id="@+id/trackdetails_category"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:hint="@string/track_detail_activity_type_hint"
android:imeOptions="actionNext"/>
<TextView android:text="@string/track_detail_track_description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<EditText android:id="@+id/trackdetails_description"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:singleLine="false"
android:autoText="true"
android:capitalize="sentences"
android:selectAllOnFocus="true"
android:maxLines="50"
android:gravity="top"
android:layout_weight="1"
android:hint="@string/track_detail_track_description"
android:imeOptions="actionDone"/>
<LinearLayout style="@style/ButtonLayout">
<LinearLayout style="@style/ButtonSpacer"/>
<Button android:id="@+id/trackdetails_save"
android:layout_gravity="left"
android:text="@string/generic_save"
style="@style/Button"/>
<Button android:id="@+id/trackdetails_cancel"
android:layout_gravity="right"
android:text="@string/generic_cancel"
style="@style/Button"/>
<LinearLayout style="@style/ButtonSpacer"/>
</LinearLayout>
</LinearLayout>
@@ -100,7 +100,7 @@ limitations under the License.
</TableRow>
<!-- Google Docs -->
<TableRow>
<TableRow android:id="@+id/send_google_docs_table_row">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
+57 -129
View File
@@ -14,139 +14,67 @@ 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
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="fill_parent">
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">
<ScrollView
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_width="fill_parent">
<LinearLayout
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent">
android:layout_width="fill_parent"
android:orientation="vertical">
<TableLayout
android:layout_height="wrap_content"
android:stretchColumns="1,4"
android:layout_width="fill_parent">
<!-- Layout the sensor state on one line. -->
<TableRow>
<TextView
android:layout_span="5"
android:text="@string/menu_sensor_state" />
</TableRow>
<TableRow
android:background="@color/stat_label_background">
<TextView
android:id="@+id/sensor_state_register"
android:layout_column="1"
android:layout_span="5"
style="@style/StatsRegister" />
</TableRow>
<!-- Layout the sensor data age on one line. -->
<TableRow>
<TextView
android:layout_span="5"
android:text="@string/sensor_state_last_sensor_time" />
</TableRow>
<TableRow
android:background="@color/stat_label_background">
<TextView
android:id="@+id/sensor_data_time_register"
android:layout_column="1"
android:layout_span="5"
style="@style/StatsRegister" />
</TableRow>
<!-- Power meter -->
<TableRow
android:padding="1dip">
<TextView
android:layout_column="1"
android:layout_span="3"
android:text="@string/sensor_state_power" />
</TableRow>
<TableRow
android:background="@color/stat_label_background">
<TextView
style="@style/StatsRegister.Big"
android:id="@+id/power_state_register"
android:layout_column="1"
android:layout_span="4" />
<TextView
style="@style/StatsUnitSolo" />
android:layout_column="5"
android:text="@string/watts" />
</TableRow>
<!-- Cadence -->
<TableRow
android:padding="1dip">
<TextView
android:layout_column="1"
android:layout_span="3"
android:text="@string/sensor_state_cadence" />
</TableRow>
<TableRow
android:background="@color/stat_label_background">
<TextView
style="@style/StatsRegister.Big"
android:id="@+id/cadence_state_register"
android:layout_column="4" />
<TextView
style="@style/StatsUnitSolo" />
android:layout_column="2"
android:text="@string/revolutions_per_minute" />
</TableRow>
<!-- Heart Rate -->
<TableRow
android:padding="1dip">
<TextView
android:layout_column="1"
android:layout_span="3"
android:text="@string/sensor_state_heart_rate" />
</TableRow>
<TableRow
android:background="@color/stat_label_background">
<TextView
style="@style/StatsRegister.Big"
android:id="@+id/heart_rate_register"
android:layout_column="1"
android:layout_span="4" />
<TextView
style="@style/StatsUnitSolo"
android:layout_column="5"
android:text="@string/unit_beat_per_minute" />
</TableRow>
<!-- Battery Level -->
<TableRow
android:padding="1dip">
<TextView
android:layout_column="1"
android:layout_span="3"
android:text="@string/sensor_state_battery" />
</TableRow>
<TableRow
android:background="@color/stat_label_background">
<TextView
style="@style/StatsRegister.Big"
android:id="@+id/battery_level_register"
android:layout_column="1"
android:layout_span="4" />
<TextView
style="@style/StatsUnitSolo"
android:layout_column="5"
android:text="@string/unit_percent" />
</TableRow>
</TableLayout>
<!-- Sensor state -->
<TextView
android:text="@string/menu_sensor_state"
style="@style/SensorStateLabel"/>
<TextView
android:id="@+id/sensor_state"
style="@style/SensorStateValue"/>
<!-- Last sensor time -->
<TextView
android:text="@string/sensor_state_last_sensor_time"
style="@style/SensorStateLabel"/>
<TextView
android:id="@+id/sensor_state_last_sensor_time"
style="@style/SensorStateValue"/>
<!-- Power -->
<TextView
android:text="@string/sensor_state_power"
style="@style/SensorStateLabel"/>
<TextView
android:id="@+id/sensor_state_power"
style="@style/SensorStateValue"/>
<!-- Cadence -->
<TextView
android:text="@string/sensor_state_cadence"
style="@style/SensorStateLabel"/>
<TextView
android:id="@+id/sensor_state_cadence"
style="@style/SensorStateValue"/>
<!-- Heart rate -->
<TextView
android:text="@string/sensor_state_heart_rate"
style="@style/SensorStateLabel"/>
<TextView
android:id="@+id/sensor_state_heart_rate"
style="@style/SensorStateValue"/>
<!-- Battery level -->
<TextView
android:text="@string/sensor_state_battery"
style="@style/SensorStateLabel"/>
<TextView
android:id="@+id/sensor_state_battery"
style="@style/SensorStateValue"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
</LinearLayout>
+112
View File
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010 Google Inc.
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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical"
>
<ScrollView
android:background="@color/black"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_width="fill_parent"
>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical"
android:padding="4dp"
>
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/track_detail_track_name"
/>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
>
<ImageView
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:src="@drawable/track"
/>
<EditText
android:autoText="true"
android:capitalize="words"
android:hint="@string/track_detail_track_name"
android:id="@+id/track_detail_track_name"
android:imeOptions="actionNext"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:selectAllOnFocus="true"
android:singleLine="true"
/>
</LinearLayout>
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/track_detail_activity_type"
/>
<AutoCompleteTextView
android:id="@+id/track_detail_activity_type"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:hint="@string/track_detail_activity_type_hint"
android:imeOptions="actionNext"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/track_detail_track_description"
/>
<EditText
android:autoText="true"
android:capitalize="sentences"
android:hint="@string/track_detail_track_description"
android:id="@+id/track_detail_track_description"
android:imeOptions="actionDone"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:maxLines="50"
android:selectAllOnFocus="true"
android:singleLine="false"
/>
</LinearLayout>
</ScrollView>
<LinearLayout style="@style/ButtonLayout">
<LinearLayout style="@style/ButtonSpacer"/>
<Button
android:id="@+id/track_detail_save"
android:layout_gravity="left"
android:text="@string/generic_save"
style="@style/Button"
/>
<Button
android:id="@+id/track_detail_cancel"
android:layout_gravity="right"
android:text="@string/generic_cancel"
style="@style/Button"
/>
<LinearLayout style="@style/ButtonSpacer"/>
</LinearLayout>
</LinearLayout>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-35
View File
@@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010 Google Inc.
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>
<string name="about_license">Licencia</string>
<string name="about_privacy">Privacidad:</string>
<string name="about_support">Soporte:</string>
<string name="about_version">Versión:</string>
<string name="generic_save">Guardar</string>
<string name="menu_markers">Señales</string>
<string name="sd_card_error_read_file">No es posible leer del fichero.</string>
<string name="sd_card_success_read_file">Lectura de tarjeta SD terminada.</string>
<string name="sd_card_success_write_file">Grabación a tarjeta SD terminada.</string>
<string name="send_google_choose_account_title">Elegir cuenta</string>
<string name="send_google_no_account_message">No se ha encontrado la cuenta a la que subir los recorridos.</string>
<string name="send_google_no_account_title">No se ha encontrado la cuenta</string>
<string name="settings_display_speed">Mostrar velocidad</string>
<string name="settings_recording_voice_not_available">No está disponible en su versión de Android</string>
<string name="settings_sensor_type_ant">ANT+ Sensores</string>
<string name="settings_sensor_type_none">Ninguna</string>
<string name="settings_sensor_type_srm">SRM ANT+ Puente</string>
</resources>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -22,6 +22,9 @@ limitations under the License.
<string name="about_leif">Leif Wilden</string>
<string name="about_rodrigo">Rodrigo Damazio</string>
<string name="about_sandor">Sandor Dornbush</string>
<string name="color_mode_dynamic_percentage_default">25</string>
<string name="color_mode_fixed_medium_default">15</string>
<string name="color_mode_fixed_slow_default">9</string>
<string name="display_track_color_value_dynamic">DYNAMIC</string>
<string name="display_track_color_value_fixed">FIXED</string>
<string name="display_track_color_value_none">NONE</string>
@@ -49,6 +52,5 @@ limitations under the License.
<string name="track_action_end">com.google.android.apps.mytracks.END_CURRENT_TRACK</string>
<string name="track_action_save">android.intent.action.SAVE</string>
<string name="track_action_start">com.google.android.apps.mytracks.START_NEW_TRACK</string>
<string name="unit_percent">%</string>
<string name="value_unknown">-</string>
</resources>
File diff suppressed because it is too large Load Diff
+87 -34
View File
@@ -15,42 +15,42 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- About dialog TableRow -->
<style name="AboutTableRow">
<item name="android:paddingBottom">2dp</item>
</style>
<!-- About dialog TextView -->
<style name="AboutTextView">
<!-- About page label -->
<style name="AboutLabel">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textSize">20sp</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingBottom">2dp</item>
<item name="android:textSize">20sp</item>
</style>
<!-- About dialog TextView column 0 -->
<style name="AboutTextView.Column0">
<item name="android:gravity">right</item>
<item name="android:layout_column">0</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:paddingRight">10dp</item>
<!-- About page item -->
<style name="AboutItem">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingBottom">2dp</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:textSize">18sp</item>
</style>
<!-- About dialog TextView Url -->
<style name="AboutTextView.Url">
<!-- About page url -->
<style name="AboutUrl">
<item name="android:autoLink">web</item>
<item name="android:textSize">18sp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingBottom">2dp</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:textSize">18sp</item>
</style>
<!-- Button -->
<style name="Button">
<item name="android:layout_height">48dip</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_width">0dip</item>
<item name="android:maxLines">2</item>
<item name="android:textSize">14dip</item>
</style>
<!-- Button layout -->
<style name="ButtonLayout">
<item name="android:background">@drawable/list_bar</item>
@@ -61,7 +61,7 @@ limitations under the License.
<item name="android:paddingRight">2dip</item>
<item name="android:paddingTop">4dip</item>
</style>
<!-- Button spacer -->
<style name="ButtonSpacer">
<item name="android:layout_height">wrap_content</item>
@@ -70,14 +70,67 @@ limitations under the License.
<item name="android:orientation">horizontal</item>
<item name="android:visibility">gone</item>
</style>
<!-- Chart settings axis image -->
<style name="ChartSettingsAxisImage">
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_width">wrap_content</item>
</style>
<!-- Chart settings axis layout -->
<style name="ChartSettingsAxisLayout">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:orientation">horizontal</item>
</style>
<!-- Chart settings axis text -->
<style name="ChartSettingsAxisText">
<item name="android:gravity">bottom</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:textSize">20sp</item>
</style>
<!-- Chart settings checkbox -->
<style name="ChartSettingsCheckbox">
<item name="android:checked">true</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
</style>
<!-- Chart settings radio button -->
<style name="ChartSettingsRadioButton">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
</style>
<style name="SensorStateLabel">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
</style>
<style name="SensorStateValue">
<item name="android:background">@color/stat_label_background</item>
<item name="android:gravity">right</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:textColor">@color/stat_label_text</item>
<item name="android:textSize">40sp</item>
</style>
<!-- The style for a view which divides the numerator and denominator of the units on the statistics activity. -->
<style name="StatsDivider" parent="@android:Widget.TextView">
<item name="android:background">@color/black</item>
<item name="android:layout_height">3dip</item>
<item name="android:layout_width">fill_parent</item>
</style>
<!-- The style for a text view for displaying a value on the statistics activity. -->
<style name="StatsRegister" parent="@android:Widget.TextView">
<item name="android:gravity">right</item>
@@ -112,7 +165,7 @@ limitations under the License.
<item name="android:layout_width">5dip</item>
<item name="android:textSize">40sp</item>
</style>
<!-- The style for the unit on the statistics activity. -->
<style name="StatsUnit" parent="@android:Widget.TextView">
<item name="android:gravity">bottom</item>
@@ -129,8 +182,8 @@ limitations under the License.
<item name="android:layout_marginBottom">-9dip</item>
<item name="android:layout_marginTop">-9dip</item>
<item name="android:textColor">@color/stat_label_text</item>
</style>
</style>
<!-- Welcome page TextView -->
<style name="WelcomeTextView">
<item name="android:layout_height">wrap_content</item>
@@ -139,13 +192,13 @@ limitations under the License.
<item name="android:paddingRight">10sp</item>
<item name="android:textColor">@color/black</item>
<item name="android:textSize">16sp</item>
</style>
</style>
<!-- Welcome page TextView question -->
<style name="WelcomeTextView.Question">
<item name="android:paddingTop">10sp</item>
<item name="android:textStyle">bold</item>
</style>
</style>
<!-- Widget TextView -->
<style name="WidgetTextView">
@@ -154,9 +207,9 @@ limitations under the License.
<item name="android:textColor">@color/appwidget_text</item>
<item name="android:textSize">14sp</item>
</style>
<!-- Widget TextView value -->
<style name="WidgetTextView.Value">
<item name="android:width">160px</item>
</style>
</resources>
</resources>
+27 -27
View File
@@ -32,7 +32,7 @@ limitations under the License.
android:summaryOn="@string/settings_display_speed_summary_on"
android:summaryOff="@string/settings_display_speed_summary_off"
android:defaultValue="true" />
<ListPreference android:key="@string/track_color_mode_key"
android:title="@string/settings_display_track_color"
android:summary="@string/settings_display_track_color_summary"
@@ -40,46 +40,46 @@ limitations under the License.
android:entryValues="@array/display_track_color_values"
android:defaultValue="@string/display_track_color_value_none"/>
<PreferenceCategory android:title="@string/settings_display_track_color_fixed"
<PreferenceCategory android:title="@string/settings_display_track_color_fixed"
android:key="@string/track_color_mode_fixed_speed_options_key">
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_slow_key"
android:title="@string/settings_display_track_color_fixed_slow"
android:summary="@string/settings_display_track_color_fixed_slow_summary"
android:defaultValue="9"
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_slow_key"
android:title="@string/settings_display_track_color_fixed_slow"
android:summary="@string/settings_display_track_color_fixed_slow_summary"
android:defaultValue="@string/color_mode_fixed_slow_default"
android:inputType="number"
android:maxLength="3">
</EditTextPreference>
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_slow_display_key"
android:title="@string/settings_display_track_color_fixed_slow"
android:summary="@string/settings_display_track_color_fixed_slow_summary"
android:defaultValue="9"
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_slow_display_key"
android:title="@string/settings_display_track_color_fixed_slow"
android:summary="@string/settings_display_track_color_fixed_slow_summary"
android:defaultValue="@string/color_mode_fixed_slow_default"
android:inputType="number"
android:maxLength="3">
</EditTextPreference>
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_medium_key"
android:title="@string/settings_display_track_color_fixed_medium"
android:summary="@string/settings_display_track_color_fixed_medium_summary"
android:defaultValue="15"
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_medium_key"
android:title="@string/settings_display_track_color_fixed_medium"
android:summary="@string/settings_display_track_color_fixed_medium_summary"
android:defaultValue="@string/color_mode_fixed_medium_default"
android:inputType="number"
android:maxLength="3">
</EditTextPreference>
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_medium_display_key"
android:title="@string/settings_display_track_color_fixed_medium"
android:summary="@string/settings_display_track_color_fixed_medium_summary"
android:defaultValue="15"
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_medium_display_key"
android:title="@string/settings_display_track_color_fixed_medium"
android:summary="@string/settings_display_track_color_fixed_medium_summary"
android:defaultValue="@string/color_mode_fixed_medium_default"
android:inputType="number"
android:maxLength="3">
</EditTextPreference>
</PreferenceCategory>
<PreferenceCategory android:title="@string/settings_display_track_color_dynamic">
<EditTextPreference android:key="@string/track_color_mode_dynamic_speed_variation_key"
android:title="@string/settings_display_track_color_dynamic_medium"
android:summary="@string/settings_display_track_color_dynamic_medium_summary"
android:defaultValue="25"
<EditTextPreference android:key="@string/track_color_mode_dynamic_speed_variation_key"
android:title="@string/settings_display_track_color_dynamic_medium"
android:summary="@string/settings_display_track_color_dynamic_medium_summary"
android:defaultValue="@string/color_mode_dynamic_percentage_default"
android:inputType="number"
android:maxLength="2">
</EditTextPreference>
@@ -143,7 +143,7 @@ limitations under the License.
android:summaryOn="@string/settings_recording_name_summary_on"
android:summaryOff="@string/settings_recording_name_summary_off"
android:defaultValue="true" />
<com.google.android.apps.mytracks.AutoCompleteTextPreference
android:key="@string/default_activity_key"
android:title="@string/settings_recording_default_activity"
@@ -167,7 +167,7 @@ limitations under the License.
<ListPreference android:key="@string/bluetooth_sensor_key"
android:title="@string/settings_sensor_bluetooth_sensor"
android:summary="@string/settings_sensor_bluetooth_sensor_summary"
android:defaultValue="any" />
android:defaultValue="" />
<Preference android:key="@string/bluetooth_pairing_key"
android:title="@string/settings_sensor_bluetooth_pairing"
@@ -77,8 +77,8 @@ public class ChartActivity extends Activity implements TrackDataListener {
private double trackMaxSpeed;
// Modes of operation
private boolean metricUnits;
private boolean reportSpeed;
private boolean metricUnits = true;
private boolean reportSpeed = true;
/*
* UI elements:
@@ -240,6 +240,7 @@ public class ChartActivity extends Activity implements TrackDataListener {
private void prepareSettingsDialog(ChartSettingsDialog settingsDialog) {
settingsDialog.setMode(chartView.getMode());
settingsDialog.setDisplaySpeed(reportSpeed);
for (int i = 0; i < ChartView.NUM_SERIES; i++) {
settingsDialog.setSeriesEnabled(i, chartView.isChartValueSeriesEnabled(i));
}
@@ -452,26 +453,33 @@ public class ChartActivity extends Activity implements TrackDataListener {
@Override
public boolean onUnitsChanged(boolean metric) {
boolean changed = metric != this.metricUnits;
if (!changed) return false;
this.metricUnits = metric;
chartView.setMetricUnits(metric);
return true; // Reload data
if (metricUnits == metric) {
return false;
}
metricUnits = metric;
chartView.setMetricUnits(metricUnits);
runOnUiThread(new Runnable() {
@Override
public void run() {
chartView.requestLayout();
}
});
return true;
}
@SuppressWarnings("hiding")
@Override
public boolean onReportSpeedChanged(boolean reportSpeed) {
boolean changed = reportSpeed != this.reportSpeed;
if (!changed) return false;
this.reportSpeed = reportSpeed;
chartView.setReportSpeed(reportSpeed, this);
return true; // Reload data
public boolean onReportSpeedChanged(boolean speed) {
if (reportSpeed == speed) {
return false;
}
reportSpeed = speed;
chartView.setReportSpeed(speed, this);
runOnUiThread(new Runnable() {
@Override
public void run() {
chartView.requestLayout();
}
});
return true;
}
}
@@ -89,6 +89,15 @@ public class ChartSettingsDialog extends Dialog {
? R.id.chart_settings_by_distance
: R.id.chart_settings_by_time);
}
/**
* Sets whether to display speed or pace.
*
* @param displaySpeed true to display speed
*/
public void setDisplaySpeed(boolean displaySpeed) {
series[ChartView.SPEED_SERIES].setText(displaySpeed ? R.string.stat_speed : R.string.stat_pace);
}
public void setSeriesEnabled(int seriesIdx, boolean enabled) {
series[seriesIdx].setChecked(enabled);
@@ -91,7 +91,7 @@ public class ChartView extends View {
*/
private int bottomBorder;
private static final int RIGHT_BORDER = 17;
private static final int RIGHT_BORDER = 40;
/** Space to leave for drawing the unit labels */
private static final int UNIT_BORDER = 15;
@@ -116,7 +116,7 @@ public class ImportAllTracks {
Log.i(Constants.TAG, "ImportAllTracks: Releasing wake lock.");
}
activity.runOnUiThread(new Thread() {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
showDoneDialog();
@@ -219,7 +219,7 @@ public class ImportAllTracks {
* Attempts to import a GPX file. Returns true on success, issues error
* notifications and returns false on failure.
*/
private boolean importFile(File gpxFile, MyTracksProviderUtils providerUtils) {
private boolean importFile(final File gpxFile, MyTracksProviderUtils providerUtils) {
Log.i(Constants.TAG, "ImportAllTracks: importing: " + gpxFile.getName());
try {
importedTrackIds = GpxImporter.importGPXFile(new FileInputStream(gpxFile), providerUtils);
@@ -234,8 +234,13 @@ public class ImportAllTracks {
} catch (IOException e) {
Log.w(Constants.TAG, "Error reading file: " + gpxFile.getAbsolutePath(), e);
}
Toast.makeText(activity, activity.getString(R.string.import_error, gpxFile.getName()),
Toast.LENGTH_LONG).show();
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(activity, activity.getString(R.string.import_error, gpxFile.getName()),
Toast.LENGTH_LONG).show();
}
});
return false;
}
@@ -420,9 +420,8 @@ public class MapActivity extends com.google.android.maps.MapActivity
Constants.getActionFromMenuId(item.getItemId()));
return true;
case Constants.MENU_EDIT: {
Intent intent = new Intent(this, TrackDetails.class);
// TODO: Pass in a content URI
intent.putExtra("trackid", dataHub.getSelectedTrackId());
Intent intent = new Intent(this, TrackDetail.class);
intent.putExtra(TrackDetail.TRACK_ID, dataHub.getSelectedTrackId());
startActivity(intent);
return true;
}
@@ -269,7 +269,7 @@ public class MyTracks extends TabActivity implements OnTouchListener {
case DIALOG_EULA_ID:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.eula_title);
builder.setMessage(R.string.eula_message);
builder.setMessage(EulaUtil.getEulaMessage(this));
builder.setPositiveButton(R.string.eula_accept, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@@ -477,9 +477,9 @@ public class MyTracks extends TabActivity implements OnTouchListener {
serviceConnection.stop();
if (currentTrackId > 0) {
Intent intent = new Intent(MyTracks.this, TrackDetails.class);
intent.putExtra("trackid", currentTrackId);
intent.putExtra("hasCancelButton", false);
Intent intent = new Intent(MyTracks.this, TrackDetail.class);
intent.putExtra(TrackDetail.TRACK_ID, currentTrackId);
intent.putExtra(TrackDetail.SHOW_CANCEL, false);
startActivity(intent);
}
}
@@ -80,7 +80,7 @@ public class SensorStateActivity extends Activity {
/**
* A temporary sensor manager, when none is available.
*/
SensorManager tempSensorManager = null;
private SensorManager tempSensorManager = null;
/**
* A state flag set to true when the activity is active/visible,
@@ -91,7 +91,7 @@ public class SensorStateActivity extends Activity {
* it could cause the {@link #tempSensorManager} to be recreated, after it
* is destroyed at the pause event.
*/
boolean isVisible = false;
private boolean isVisible = false;
public SensorStateActivity() {
utils = new StatsUtilities(this);
@@ -139,7 +139,7 @@ public class SensorStateActivity extends Activity {
super.onDestroy();
}
protected void updateState() {
private void updateState() {
Log.d(TAG, "Updating SensorStateActivity");
ITrackRecordingService service = serviceConnection.getServiceIfBound();
@@ -162,8 +162,7 @@ public class SensorStateActivity extends Activity {
}
}
private void updateFromTempSensorManager()
{
private void updateFromTempSensorManager() {
// Use variables to hold the sensor state and data set.
Sensor.SensorState currentState = null;
Sensor.SensorDataSet currentDataSet = null;
@@ -186,8 +185,7 @@ public class SensorStateActivity extends Activity {
updateSensorStateAndData(currentState, currentDataSet);
}
private void updateFromSysSensorManager()
{
private void updateFromSysSensorManager() {
// Use variables to hold the sensor state and data set.
Sensor.SensorState currentState = null;
Sensor.SensorDataSet currentDataSet = null;
@@ -228,91 +226,115 @@ public class SensorStateActivity extends Activity {
/**
* Stops the temporary sensor manager, if one exists.
*/
private void stopTempSensorManager()
{
private void stopTempSensorManager() {
if (tempSensorManager != null) {
tempSensorManager.shutdown();
tempSensorManager = null;
}
}
private void updateSensorStateAndData(Sensor.SensorState state, Sensor.SensorDataSet dataSet)
{
private void updateSensorStateAndData(Sensor.SensorState state, Sensor.SensorDataSet dataSet) {
updateSensorState(state == null ? Sensor.SensorState.NONE : state);
updateSensorData(dataSet);
}
private void updateSensorState(Sensor.SensorState state) {
TextView sensorTime =
((TextView) findViewById(R.id.sensor_state_register));
sensorTime.setText(SensorUtils.getStateAsString(state, this));
((TextView) findViewById(R.id.sensor_state)).setText(SensorUtils.getStateAsString(state, this));
}
protected void updateSensorData(Sensor.SensorDataSet sds) {
private void updateSensorData(Sensor.SensorDataSet sds) {
if (sds == null) {
utils.setUnknown(R.id.sensor_data_time_register);
utils.setUnknown(R.id.cadence_state_register);
utils.setUnknown(R.id.power_state_register);
utils.setUnknown(R.id.heart_rate_register);
utils.setUnknown(R.id.battery_level_register);
return;
utils.setUnknown(R.id.sensor_state_last_sensor_time);
utils.setUnknown(R.id.sensor_state_power);
utils.setUnknown(R.id.sensor_state_cadence);
utils.setUnknown(R.id.sensor_state_battery);
} else {
((TextView) findViewById(R.id.sensor_state_last_sensor_time)).setText(getLastSensorTime(sds));
((TextView) findViewById(R.id.sensor_state_power)).setText(getPower(sds));
((TextView) findViewById(R.id.sensor_state_cadence)).setText(getCadence(sds));
((TextView) findViewById(R.id.sensor_state_heart_rate)).setText(getHeartRate(sds));
((TextView) findViewById(R.id.sensor_state_battery)).setText(getBattery(sds));
}
}
TextView sensorTime =
((TextView) findViewById(R.id.sensor_data_time_register));
sensorTime.setText(
TIMESTAMP_FORMAT.format(new Date(sds.getCreationTime())));
/**
* Gets the last sensor time.
*
* @param sds sensor data set
*/
private String getLastSensorTime(Sensor.SensorDataSet sds) {
return TIMESTAMP_FORMAT.format(new Date(sds.getCreationTime()));
}
/**
* Gets the power.
*
* @param sds sensor data set
*/
private String getPower(Sensor.SensorDataSet sds) {
String value;
if (sds.hasPower() && sds.getPower().hasValue()
&& sds.getPower().getState() == Sensor.SensorState.SENDING) {
utils.setText(R.id.power_state_register,
Integer.toString(sds.getPower().getValue()));
String format = getString(R.string.sensor_state_power_value);
value = String.format(format, sds.getPower().getValue());
} else {
utils.setText(R.id.power_state_register,
SensorUtils.getStateAsString(
sds.hasPower()
? sds.getPower().getState()
: Sensor.SensorState.NONE,
this));
value = SensorUtils.getStateAsString(
sds.hasPower() ? sds.getPower().getState() : Sensor.SensorState.NONE, this);
}
return value;
}
/**
* Gets the cadence.
*
* @param sds sensor data set
*/
private String getCadence(Sensor.SensorDataSet sds) {
String value;
if (sds.hasCadence() && sds.getCadence().hasValue()
&& sds.getCadence().getState() == Sensor.SensorState.SENDING) {
utils.setText(R.id.cadence_state_register,
Integer.toString(sds.getCadence().getValue()));
String format = getString(R.string.sensor_state_cadence_value);
value = String.format(format, sds.getCadence().getValue());
} else {
utils.setText(R.id.cadence_state_register,
SensorUtils.getStateAsString(
sds.hasCadence()
? sds.getCadence().getState()
: Sensor.SensorState.NONE,
this));
value = SensorUtils.getStateAsString(
sds.hasCadence() ? sds.getCadence().getState() : Sensor.SensorState.NONE, this);
}
return value;
}
/**
* Gets the heart rate.
*
* @param sds sensor data set
*/
private String getHeartRate(Sensor.SensorDataSet sds) {
String value;
if (sds.hasHeartRate() && sds.getHeartRate().hasValue()
&& sds.getHeartRate().getState() == Sensor.SensorState.SENDING) {
utils.setText(R.id.heart_rate_register,
Integer.toString(sds.getHeartRate().getValue()));
String format = getString(R.string.sensor_state_heart_rate_value);
value = String.format(format, sds.getHeartRate().getValue());
} else {
utils.setText(R.id.heart_rate_register,
SensorUtils.getStateAsString(
sds.hasHeartRate()
? sds.getHeartRate().getState()
: Sensor.SensorState.NONE,
this));
value = SensorUtils.getStateAsString(
sds.hasHeartRate() ? sds.getHeartRate().getState() : Sensor.SensorState.NONE, this);
}
return value;
}
/**
* Gets the battery.
*
* @param sds sensor data set
*/
private String getBattery(Sensor.SensorDataSet sds) {
String value;
if (sds.hasBatteryLevel() && sds.getBatteryLevel().hasValue()
&& sds.getBatteryLevel().getState() == Sensor.SensorState.SENDING) {
utils.setText(R.id.battery_level_register,
Integer.toString(sds.getBatteryLevel().getValue()));
String format = getString(R.string.sensor_state_battery_value);
value = String.format(format, sds.getBatteryLevel().getValue());
} else {
utils.setText(R.id.battery_level_register,
SensorUtils.getStateAsString(
sds.hasBatteryLevel()
? sds.getBatteryLevel().getState()
: Sensor.SensorState.NONE,
this));
value = SensorUtils.getStateAsString(
sds.hasBatteryLevel() ? sds.getBatteryLevel().getState() : Sensor.SensorState.NONE, this);
}
return value;
}
}
}

Some files were not shown because too many files have changed in this diff Show More