merge heads

This commit is contained in:
Jimmy Shih
2011-11-04 14:11:47 -07:00
43 changed files with 601 additions and 281 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ limitations under the License.
</activity> </activity>
<activity android:name="com.google.android.apps.mytracks.SettingsActivity" <activity android:name="com.google.android.apps.mytracks.SettingsActivity"
android:label="@string/mytracks_settings" > android:label="@string/settings_title" >
<intent-filter> <intent-filter>
<category android:name="android.intent.category.PREFERENCE" /> <category android:name="android.intent.category.PREFERENCE" />
</intent-filter> </intent-filter>
+3 -3
View File
@@ -165,12 +165,12 @@ limitations under the License.
<string name="waypointdetails_category_hint">Tipus de marcador</string> <string name="waypointdetails_category_hint">Tipus de marcador</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Paràmetres de My Tracks</string> <string name="settings_title">Paràmetres de My Tracks</string>
<string name="settings_display">Visualització</string> <string name="settings_display">Visualització</string>
<string name="settings_recording">Enregistrament</string> <string name="settings_recording">Enregistrament</string>
<string name="settings_sharing">Compartició</string> <string name="settings_sharing">Compartició</string>
<string name="settings_not_available_summary">No es troba disponible a la vostra versió de l\'Android</string> <string name="settings_announcement_frequency_not_available">No es troba disponible a la vostra versió de l\'Android</string>
<string name="settings_announcement_frequency">Freqüència d\'avís</string> <string name="settings_announcement_frequency">Freqüència d\'avís</string>
<string name="settings_announcement_frequency_summary">Temps mínim entre dos avisos de veu</string> <string name="settings_announcement_frequency_summary">Temps mínim entre dos avisos de veu</string>
@@ -391,7 +391,7 @@ limitations under the License.
<string name="bluetooth_pairing">Associació de dispositius</string> <string name="bluetooth_pairing">Associació de dispositius</string>
<string name="bluetooth_pairing_summary">Obriu els paràmetres de bluetooth de l\'Android per associar un dispositiu</string> <string name="bluetooth_pairing_summary">Obriu els paràmetres de bluetooth de l\'Android per associar un dispositiu</string>
<string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string> <string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string>
<string name="sensor_options">Opcions del sensor</string> <string name="settings_sensor">Opcions del sensor</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">Connectat a %s</string> <string name="bluetooth_connected">Connectat a %s</string>
+3 -3
View File
@@ -168,12 +168,12 @@ limitations under the License.
<string name="waypointdetails_category_hint">Art des Wegpunktes</string> <string name="waypointdetails_category_hint">Art des Wegpunktes</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Einstellungen für My Tracks</string> <string name="settings_title">Einstellungen für My Tracks</string>
<string name="settings_display">Anzeige</string> <string name="settings_display">Anzeige</string>
<string name="settings_recording">Aufzeichnung</string> <string name="settings_recording">Aufzeichnung</string>
<string name="settings_sharing">Mit Freunden teilen</string> <string name="settings_sharing">Mit Freunden teilen</string>
<string name="settings_not_available_summary">In dieser Android-Version nicht verfügbar</string> <string name="settings_announcement_frequency_not_available">In dieser Android-Version nicht verfügbar</string>
<string name="settings_announcement_frequency">Dauer zwischen Ansagen</string> <string name="settings_announcement_frequency">Dauer zwischen Ansagen</string>
<string name="settings_announcement_frequency_summary">Kürzeste Zeit zwischen zwei Ansagen</string> <string name="settings_announcement_frequency_summary">Kürzeste Zeit zwischen zwei Ansagen</string>
@@ -424,7 +424,7 @@ limitations under the License.
<string name="bluetooth_pairing">Geräteverbindung</string> <string name="bluetooth_pairing">Geräteverbindung</string>
<string name="bluetooth_pairing_summary">Öffnet Androids Bluetooth-Einstellungen, um Geräte zu verbinden.</string> <string name="bluetooth_pairing_summary">Öffnet Androids Bluetooth-Einstellungen, um Geräte zu verbinden.</string>
<!--string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string--> <!--string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string-->
<string name="sensor_options">Sensor-Einstellungen</string> <string name="settings_sensor">Sensor-Einstellungen</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">Verbunden mit %s</string> <string name="bluetooth_connected">Verbunden mit %s</string>
+1 -1
View File
@@ -55,7 +55,7 @@ limitations under the License.
<!-- MyTracks Waypoint Details --> <!-- MyTracks Waypoint Details -->
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="settings_not_available_summary">No está disponible en su versión de Android</string> <string name="settings_announcement_frequency_not_available">No está disponible en su versión de Android</string>
<string name="settings_report_speed_or_pace">Mostrar velocidad</string> <string name="settings_report_speed_or_pace">Mostrar velocidad</string>
+3 -3
View File
@@ -197,12 +197,12 @@ limitations under the License.
<string name="waypointdetails_category_hint">Tipo de señal</string> <string name="waypointdetails_category_hint">Tipo de señal</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Configuraciones de My Tracks</string> <string name="settings_title">Configuraciones de My Tracks</string>
<string name="settings_display">Visualizador</string> <string name="settings_display">Visualizador</string>
<string name="settings_recording">Grabando</string> <string name="settings_recording">Grabando</string>
<string name="settings_sharing">Compartiendo</string> <string name="settings_sharing">Compartiendo</string>
<string name="settings_not_available_summary">No disponible para tu versión de Android</string> <string name="settings_announcement_frequency_not_available">No disponible para tu versión de Android</string>
<string name="settings_not_while_recording">No disponible mientras se graba el recorrido</string> <string name="settings_not_while_recording">No disponible mientras se graba el recorrido</string>
<string name="settings_allow_access">Permitir acceso</string> <string name="settings_allow_access">Permitir acceso</string>
@@ -480,7 +480,7 @@ limitations under the License.
<string name="bluetooth_pairing_summary">Abrir la configuración Bluetooth de Android para conectar un dispositivo</string> <string name="bluetooth_pairing_summary">Abrir la configuración Bluetooth de Android para conectar un dispositivo</string>
<string name="sensor_bluetooth_options_key">Sensor Bluetooth activado</string> <string name="sensor_bluetooth_options_key">Sensor Bluetooth activado</string>
<string name="ant_options">Optiones ANT</string> <string name="ant_options">Optiones ANT</string>
<string name="sensor_options">Opciones del sensor</string> <string name="settings_sensor">Opciones del sensor</string>
<string name="track_color_mode">Modo de Recorrido Coloreado</string> <string name="track_color_mode">Modo de Recorrido Coloreado</string>
<string name="fixed_speed_options">Opciones de velocidad fija</string> <string name="fixed_speed_options">Opciones de velocidad fija</string>
<string name="dynamic_speed_options">Opciones de velocidad dinámica</string> <string name="dynamic_speed_options">Opciones de velocidad dinámica</string>
+3 -3
View File
@@ -197,12 +197,12 @@ limitations under the License.
<string name="waypointdetails_category_hint">Merkinnän tyyppi</string> <string name="waypointdetails_category_hint">Merkinnän tyyppi</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">My Tracks Asetukset</string> <string name="settings_title">My Tracks Asetukset</string>
<string name="settings_display">Näyttö</string> <string name="settings_display">Näyttö</string>
<string name="settings_recording">Tallennus</string> <string name="settings_recording">Tallennus</string>
<string name="settings_sharing">Jakaminen</string> <string name="settings_sharing">Jakaminen</string>
<string name="settings_not_available_summary">Ei tuettu tässä Android-versiossa</string> <string name="settings_announcement_frequency_not_available">Ei tuettu tässä Android-versiossa</string>
<string name="settings_not_while_recording">Ei saatavilla reittiä tallennettaessa.</string> <string name="settings_not_while_recording">Ei saatavilla reittiä tallennettaessa.</string>
<string name="settings_announcement_frequency">Äänimerkki</string> <string name="settings_announcement_frequency">Äänimerkki</string>
@@ -477,7 +477,7 @@ limitations under the License.
<string name="bluetooth_pairing_summary">Avaa Androidin bluetooth-asetukset luodaksesi laitepareja</string> <string name="bluetooth_pairing_summary">Avaa Androidin bluetooth-asetukset luodaksesi laitepareja</string>
<string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string> <string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string>
<string name="ant_options">ANT asetukset</string> <string name="ant_options">ANT asetukset</string>
<string name="sensor_options">Sensorien asetukset</string> <string name="settings_sensor">Sensorien asetukset</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">Yhdistetty %s</string> <string name="bluetooth_connected">Yhdistetty %s</string>
+2 -2
View File
@@ -158,7 +158,7 @@ limitations under the License.
<string name="waypointdetails_category_hint">Nom de balise</string> <string name="waypointdetails_category_hint">Nom de balise</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Paramètres My Tracks</string> <string name="settings_title">Paramètres My Tracks</string>
<string name="settings_display">Affichage</string> <string name="settings_display">Affichage</string>
<string name="settings_recording">Enregistrement</string> <string name="settings_recording">Enregistrement</string>
<string name="settings_sharing">Partage</string> <string name="settings_sharing">Partage</string>
@@ -380,7 +380,7 @@ limitations under the License.
<string name="bluetooth_pairing">Association d\'un appareil</string> <string name="bluetooth_pairing">Association d\'un appareil</string>
<string name="bluetooth_pairing_summary">Visitez les paramètres Bluetooth d\'Android pour associer un nouvel appareil</string> <string name="bluetooth_pairing_summary">Visitez les paramètres Bluetooth d\'Android pour associer un nouvel appareil</string>
<string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string> <string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string>
<string name="sensor_options">Options du capteur</string> <string name="settings_sensor">Options du capteur</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">Connecté à %s</string> <string name="bluetooth_connected">Connecté à %s</string>
+1 -1
View File
@@ -161,7 +161,7 @@ limitations under the License.
<string name="waypointdetails_category_hint">Tipo di segnaposto</string> <string name="waypointdetails_category_hint">Tipo di segnaposto</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Impostazioni di My Tracks</string> <string name="settings_title">Impostazioni di My Tracks</string>
<string name="settings_display">Visualizzazione</string> <string name="settings_display">Visualizzazione</string>
<string name="settings_recording">Registrazione</string> <string name="settings_recording">Registrazione</string>
<string name="settings_sharing">Condivisione</string> <string name="settings_sharing">Condivisione</string>
+3 -3
View File
@@ -190,12 +190,12 @@ limitations under the License.
<string name="waypointdetails_category_hint">マーカータイプ</string> <string name="waypointdetails_category_hint">マーカータイプ</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">My Tracks設定</string> <string name="settings_title">My Tracks設定</string>
<string name="settings_display">表示</string> <string name="settings_display">表示</string>
<string name="settings_recording">記録</string> <string name="settings_recording">記録</string>
<string name="settings_sharing">共有</string> <string name="settings_sharing">共有</string>
<string name="settings_not_available_summary">このAndroidバージョンでは使用できません</string> <string name="settings_announcement_frequency_not_available">このAndroidバージョンでは使用できません</string>
<string name="settings_announcement_frequency">定期通知</string> <string name="settings_announcement_frequency">定期通知</string>
<string name="settings_announcement_frequency_summary">音声通知間隔の最小時間</string> <string name="settings_announcement_frequency_summary">音声通知間隔の最小時間</string>
@@ -446,7 +446,7 @@ limitations under the License.
<string name="bluetooth_pairing_summary">ペアリングを行うには「Bluetooth設定」を開いて下さい</string> <string name="bluetooth_pairing_summary">ペアリングを行うには「Bluetooth設定」を開いて下さい</string>
<string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string> <string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string>
<string name="ant_options">ANTオプション</string> <string name="ant_options">ANTオプション</string>
<string name="sensor_options">センサーオプション</string> <string name="settings_sensor">センサーオプション</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">%sに接続しました</string> <string name="bluetooth_connected">%sに接続しました</string>
+2 -2
View File
@@ -163,7 +163,7 @@ limitations under the License.
<string name="waypointdetails_category_hint">Typ znacznika</string> <string name="waypointdetails_category_hint">Typ znacznika</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Ustawienia My Tracks</string> <string name="settings_title">Ustawienia My Tracks</string>
<string name="settings_display">Wyświetlanie</string> <string name="settings_display">Wyświetlanie</string>
<string name="settings_recording">Rejestrowanie</string> <string name="settings_recording">Rejestrowanie</string>
<string name="settings_sharing">Dzielenie</string> <string name="settings_sharing">Dzielenie</string>
@@ -395,7 +395,7 @@ limitations under the License.
<string name="bluetooth_pairing_summary">Przejdź do ustawień Bluetooth Androida aby sparować urządzenie</string> <string name="bluetooth_pairing_summary">Przejdź do ustawień Bluetooth Androida aby sparować urządzenie</string>
<string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string> <string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string>
<string name="ant_options">Opce ANT</string> <string name="ant_options">Opce ANT</string>
<string name="sensor_options">Opcje Czujników</string> <string name="settings_sensor">Opcje Czujników</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">Połączony z %s</string> <string name="bluetooth_connected">Połączony z %s</string>
+2 -2
View File
@@ -158,11 +158,11 @@ limitations under the License.
<string name="waypointdetails_category_hint">Tipo do Marcador</string> <string name="waypointdetails_category_hint">Tipo do Marcador</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Configurações do My Tracks</string> <string name="settings_title">Configurações do My Tracks</string>
<string name="settings_display">Exibição</string> <string name="settings_display">Exibição</string>
<string name="settings_recording">Gravação</string> <string name="settings_recording">Gravação</string>
<string name="settings_sharing">Compartilhamento</string> <string name="settings_sharing">Compartilhamento</string>
<string name="settings_not_available_summary">Não disponível na sua versão do Android</string> <string name="settings_announcement_frequency_not_available">Não disponível na sua versão do Android</string>
<string name="settings_not_while_recording">Não disponível durante a gravação de uma trilha</string> <string name="settings_not_while_recording">Não disponível durante a gravação de uma trilha</string>
<string name="settings_announcement_frequency">Tempo entre anúncios</string> <string name="settings_announcement_frequency">Tempo entre anúncios</string>
<string name="settings_announcement_frequency_summary">Tempo mínimo entre dois anúncios de voz</string> <string name="settings_announcement_frequency_summary">Tempo mínimo entre dois anúncios de voz</string>
+3 -3
View File
@@ -193,12 +193,12 @@ limitations under the License.
<string name="waypointdetails_category_hint">Тип маркера</string> <string name="waypointdetails_category_hint">Тип маркера</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">Настройки My Tracks</string> <string name="settings_title">Настройки My Tracks</string>
<string name="settings_display">Отображение</string> <string name="settings_display">Отображение</string>
<string name="settings_recording">Запись</string> <string name="settings_recording">Запись</string>
<string name="settings_sharing">Обмен</string> <string name="settings_sharing">Обмен</string>
<string name="settings_not_available_summary">Не доступен в вашем версии Android</string> <string name="settings_announcement_frequency_not_available">Не доступен в вашем версии Android</string>
<string name="settings_not_while_recording">Не доступно во время записи трека</string> <string name="settings_not_while_recording">Не доступно во время записи трека</string>
<string name="settings_announcement_frequency">Частота объявлений</string> <string name="settings_announcement_frequency">Частота объявлений</string>
@@ -473,7 +473,7 @@ limitations under the License.
<string name="bluetooth_pairing_summary">Открыть настройки Android по bluetooth для подключения устройства</string> <string name="bluetooth_pairing_summary">Открыть настройки Android по bluetooth для подключения устройства</string>
<string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string> <string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string>
<string name="ant_options">Параметры ANT</string> <string name="ant_options">Параметры ANT</string>
<string name="sensor_options">Параметры датчика</string> <string name="settings_sensor">Параметры датчика</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">Подключен к %s</string> <string name="bluetooth_connected">Подключен к %s</string>
+1 -1
View File
@@ -163,7 +163,7 @@ limitations under the License.
<string name="waypointdetails_category_hint">Markörtyp</string> <string name="waypointdetails_category_hint">Markörtyp</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">My Tracks inställningar</string> <string name="settings_title">My Tracks inställningar</string>
<string name="settings_display">Visning</string> <string name="settings_display">Visning</string>
<string name="settings_recording">Inspelning</string> <string name="settings_recording">Inspelning</string>
<string name="settings_sharing">Delning</string> <string name="settings_sharing">Delning</string>
+3 -3
View File
@@ -194,12 +194,12 @@ limitations under the License.
<string name="waypointdetails_category_hint">标记类型</string> <string name="waypointdetails_category_hint">标记类型</string>
<!-- MyTracks Settings --> <!-- MyTracks Settings -->
<string name="mytracks_settings">My Tracks 设置</string> <string name="settings_title">My Tracks 设置</string>
<string name="settings_display">显示</string> <string name="settings_display">显示</string>
<string name="settings_recording">记录</string> <string name="settings_recording">记录</string>
<string name="settings_sharing">分享</string> <string name="settings_sharing">分享</string>
<string name="settings_not_available_summary">不支持当前使用的 Android 版本</string> <string name="settings_announcement_frequency_not_available">不支持当前使用的 Android 版本</string>
<string name="settings_not_while_recording">在记录轨迹时不可用</string> <string name="settings_not_while_recording">在记录轨迹时不可用</string>
<string name="settings_announcement_frequency">通知频度</string> <string name="settings_announcement_frequency">通知频度</string>
@@ -453,7 +453,7 @@ limitations under the License.
<string name="bluetooth_options">蓝牙设置</string> <string name="bluetooth_options">蓝牙设置</string>
<string name="bluetooth_pairing">设备关联</string> <string name="bluetooth_pairing">设备关联</string>
<string name="bluetooth_pairing_summary">打开 Android 的蓝牙设置关联设备</string> <string name="bluetooth_pairing_summary">打开 Android 的蓝牙设置关联设备</string>
<string name="sensor_options">感应器选项</string> <string name="settings_sensor">感应器选项</string>
<!-- Bluetooth Sensor --> <!-- Bluetooth Sensor -->
<string name="bluetooth_connected">连接到 %s</string> <string name="bluetooth_connected">连接到 %s</string>
+412 -111
View File
@@ -660,109 +660,426 @@ limitations under the License.
Marker Description Marker Description
</string> </string>
<!-- MyTracks Settings --> <!-- Settings page -->
<string name="mytracks_settings">My Tracks Settings</string> <string name="settings_title"
<string name="settings_display">Display</string> translation_description="The title of the Settings page.">
<string name="settings_recording">Recording</string> My Tracks Settings
<string name="settings_sharing">Sharing</string> </string>
<string name="settings_display"
translation_description="In the Settings page, the option to change the display related
settings.">
Display
</string>
<string name="settings_recording"
translation_description="In the Settings page, the option to change the track recording related
settings.">
Recording
</string>
<string name="settings_sensor"
translation_description="In the Settings page, the option to change the sensor related
settings.">
Sensor
</string>
<string name="settings_sharing"
translation_description="In the Settings page, the option to change the track sharing related
settings.">
Sharing
</string>
<string name="settings_backup"
translation_description="In the Settings page, the option to change the data backup related
settings.">
Backup
</string>
<string name="settings_reset"
translation_description="In the Settings page, the option to reset everything to defaults.">
Reset to defaults
</string>
<string name="settings_reset_summary"
translation_description="In the Settings page, the summary for the 'Reset to defaults'
option explaining reverting all the settings to the default values.">
Revert all your settings to the default values
</string>
<string name="settings_not_available_summary">Not available in your version of Android</string> <!-- Display settings -->
<string name="settings_not_while_recording">Not available while recording a track</string> <string name="settings_metric_units"
translation_description="In the Display settings, the checkbox option to use the metrics units."
>
Use metric units
</string>
<string name="settings_metric_units_summary_on"
translation_description="In the Display settings, the summary for the 'Use metric units'
checkbox when it is checked explaining using the metrics units to display distances.">
Use metrics units to display distances
</string>
<string name="settings_metric_units_summary_off"
translation_description="In the Display settings, the summary for the 'Use metrics units'
checkbox when it is unchecked explaining using the imperial units to display distances.">
Use imperial units to display distances
</string>
<string name="settings_report_speed_or_pace"
translation_description="In the Display settings, the checkbox option to display speed (e.g., 5
miles per hour) instead of pace (e.g., 0.2 hours per mile).">
Display speed
</string>
<string name="settings_report_speed_or_pace_summary_on"
translation_description="In the Display settings, the summary for the 'Display speed' checkbox
when it is checked explaining that speed (e.g., 5 miles per hour) will be used instead of pace
(e.g., 0.2 hours per mile).">
Display speed (e.g., miles/hour)
</string>
<string name="settings_report_speed_or_pace_summary_off"
translation_description="In the Display settings, the summary for the 'Display speed' checkbox
when it is unchecked explaining that pace (e.g., 0.2 hours per mile) will be used instead of
speed (e.g., 5 miles per hour).">
Display pace (e.g., hours/mile)
</string>
<string name="settings_track_color_mode"
translation_description="In the Display settings, the dropdown option to choose a track color
mode for how to use different colors to color a track based on speed.">
Track color mode
</string>
<string name="settings_track_color_mode_summary"
translation_description="In the Display settings, the summary for the 'Track color mode'
dropdown option explaining that it configures how colors are used to color a track based on
speed."
>
The way to color a track based on speed
</string>
<string name="settings_track_color_mode_fixed_speed_slow"
translation_description="In the Display settings, the option for configuring the slow speed
threshold. Thus any speed lower than the threshold will be colored by the slow speed color.">
Slow speed threshold
</string>
<string name="settings_track_color_mode_fixed_speed_slow_summary"
translation_description="In the Display settings, the summary for the 'Slow speed threshold'
option explaining that it sets a cutoff speed for the slow speed color.">
Slow speed top value
</string>
<string name="settings_track_color_mode_fixed_speed_medium"
translation_description="In the Display settings, the option for configuring the medium speed
threshold. Thus any speed lower than the threshold but greater than the slow speed threshold
will be colored by the medium speed color.">
Medium speed threshold
</string>
<string name="settings_track_color_mode_fixed_speed_medium_summary"
translation_description="In the Display settings, the summary for the 'Medium speed threshold'
option explaining that it sets a cutoff speed for the medium speed color.">
Medium speed top value
</string>
<string name="settings_track_color_mode_dynamic_speed_variation"
translation_description="In the Display settings, the option for configuring the dynamic
speed threshold for using colors to color a track based on speed.">
Medium speed range
</string>
<string name="settings_track_color_mode_dynamic_speed_variation_summary"
translation_description="In the Display settings, the summary for the 'Medium speed range'
option explaining that it sets a percentage from the average speed to determine the
medium speed range for using colors to color a track based on speed.">
Percentage from the average speed for the medium speed
</string>
<string name="settings_allow_access">Allow access</string> <!-- Recording settings -->
<string name="settings_allow_access_summary_on">Other apps can read, write, start/stop recording <!-- TODO decide if voice frequency should be under the Recording settings. -->
MyTracks data.</string> <string name="settings_announcement_frequency"
<string name="settings_allow_access_summary_off">Other apps cannot read, write, start/stop translation_description="In the Recording settings, the dropdown option to configure the voice
recording MyTracks data.</string> announcement frequency.">
<string name="settings_allow_access_dialog_message">Are you sure you want to allow other apps, Voice frequency
including future apps, to control and access MyTracks data? There will be no further </string>
notification.</string> <string name="settings_announcement_frequency_summary"
translation_description="In the Recording settings, the summary for the 'Voice frequency'
dropdown option explaining that it configures the time or distance between two voice
announcements.">
Time/distance between two voice announcements
</string>
<string name="settings_announcement_frequency_not_available"
translation_description="In the Recording settings, the summary for the 'Voice frequency'
explaining that this option is not available on your Android phone.">
Voice announcement is not available on your Android phone
</string>
<string name="settings_split_frequency"
translation_description="In the Recording settings, the dropdown option to configure the
time or distance a new marker will be inserted.">
Marker frequency
</string>
<string name="settings_split_frequency_summary"
translation_description="In the Recording settings, the summary for the 'Marker frequency'
dropdown option explaining that it configures the time or distance after which a new
marker will be inserted.">
Time/distance after which a new marker will be inserted
</string>
<string name="settings_min_recording_interval"
translation_description="In the Recording settings, the dropdown option to configure the
time between two recorded points.">
Time between points
</string>
<string name="settings_min_recording_interval_summary"
translation_description="In the Recording settings, the summary for the 'Time between points'
dropdown option explaining that it configures the smallest time interval between two
recordings of your position.">
Smallest time interval between two recordings of your position
</string>
<string name="settings_min_recording_distance"
translation_description="In the Recording settings, the dropdown option to configure the
distance between two recorded points.">
Distance between points
</string>
<string name="settings_min_recording_distance_summary"
translation_description="In the Recording settings, the summary for the 'Distance between
points' dropdown option explaining that it configures the smallest distance between two
recordings of your position.">
Smallest distance between two recordings of your position
</string>
<string name="settings_max_recording_distance"
translation_description="In the Recording settings, the dropdown option to configure the
distance between two tracks.">
Distance between tracks
</string>
<string name="settings_max_recording_distance_summary"
translation_description="In the Recording settings, the summary for the 'Distance between
tracks' dropdown option explaining that it configures the maximum distance for two recorded
points for them to be still considered as the same track.">
Track will be split if two recordings of your position are further than this
</string>
<string name="settings_min_required_accuracy"
translation_description="In the Recording settings, the dropdown option to configure the
required GPS accuracy. If a GPS position's accuracy is below the requirement, then it will
not be used.">
GPS accuracy
</string>
<string name="settings_min_required_accuracy_summary"
translation_description="In the Recording settings, the summary for the 'GPS accuracy' dropdown
option explaining that it configures the required accuracy for your position.
If a GPS position's accuracy is below the requirement, then it will not be used.">
GPS position will be ignored if it is not this accurate
</string>
<string name="settings_auto_resume_track_timeout"
translation_description="In the Recording settings, the dropdown option to configure the timeout
after which a recorded track will not be continued after phone reboot.">
Auto-resume timeout
</string>
<string name="settings_auto_resume_track_timeout_summary"
translation_description="In the Recording settings, the summary for the 'Auto-resume timeout'
dropdown option explaining that it configures the maximum time after which a previous
recording will not resumed after phone reboot.">
Maximum time after which a previously recording track will not be resumed on phone reboot
</string>
<string name="settings_timestamp_track_name"
translation_description="In the Recording settings, the checkbox on whether the track should be
named based on the track's start time or based on a number.">
Use time for track name
</string>
<string name="settings_timestamp_track_name_summary_on"
translation_description="In the Recording settings, the summary for the 'Use time for track
name' checkbox when it is checked explaining using the track's start time as the default track
name.">
Use the track\'s start time as the default track name
</string>
<string name="settings_timestamp_track_name_summary_off"
translation_description="In the Recording settings, the summary for the 'Use time for track
name' checkbox when it is unchecked explaining using a number as the default track name.">
Use a number as the default track name
</string>
<string name="settings_announcement_frequency">Announcement frequency</string> <!-- Sensor settings -->
<string name="settings_announcement_frequency_summary">Minimum time between two voice announcements</string> <string name="settings_sensor_type"
translation_description="In the Sensor settings, the dropdown option to choose a sensor type.">
Sensor Type
</string>
<string name="settings_sensor_type_summary"
translation_description="In the Sensor settings, the summary for the 'Sensor Type' option
explaining that it is to configure the type of sensor to connect to.">
The type of sensor to connect to
</string>
<string name="bluetooth_options"
translation_description="In the Sensor settings, the section title to configure the Bluetooth
options.">
Bluetooth Options
</string>
<string name="bluetooth_sensor_title"
translation_description="In the Sensor settings, the dropdown option to pick a Bluetooth
sensor.">
Bluetooth sensor
</string>
<string name="bluetooth_sensor_summary"
translation_description="In the Sensor settings, the summary for the 'Bluetooth sensor' dropdown
option explaining it is to pick a Bluetooth sensor to connect to.">
The Bluetooth sensor to connect to
</string>
<string name="bluetooth_pairing"
translation_description="In the Sensor settings, the option to pair with a Bluetooth device.">
Bluetooth pairing
</string>
<string name="bluetooth_pairing_summary"
translation_description="In the Sensor settings, the summary for the 'Bluetooth pairing' option
explaining that it will open the Android's Bluetooth settings to pair a device.">
Open Android\'s Bluetooth settings to pair a device
</string>
<string name="ant_options"
translation_description="In the Sensor settings, the section title to configure the ANT+
options.">
ANT+ Options
</string>
<string name="settings_heart_rate_ant_sensor_id"
translation_description="In the Sensor settings, the option to unpair an ANT+ heart rate
sensor.">
Unpair ANT+ heart rate sensor
</string>
<string name="settings_srm_bridge_ant_sensor_id"
translation_description="In the Sensor settings, the option to unpair a SRM ANT+ bridge.">
Unpair SRM ANT+ bridge
</string>
<string name="settings_ant_not_paired"
translation_description="In the Sensor settings, the summary under 'Clear ANT+ sensor' or 'Clear
SRM ANT+ bridge' when there no ANT+ device paired.">
Not paired
</string>
<string name="settings_ant_paired"
translation_description="In the Sensor settings, the summary under 'Clear ANT+ sensor' or 'Clear
SRM ANT+ bridge' when there is an ANT+ device paired. E.g., 'Paired with: 1'.">
Paired with: %d
</string>
<string name="settings_min_recording_distance">Min distance between points</string> <!-- Sharing settings -->
<string name="settings_min_recording_distance_summary">Smallest distance between two recordings of your position</string> <string name="settings_map_public"
translation_description="In the Sharing settings, the checkbox option to make a new map created
in Google My Maps public.">
Make new maps public
</string>
<string name="settings_map_public_summary_on"
translation_description="In the Sharing settings, the summary for the 'Make new maps public'
checkbox option when it is checked explaining that new maps created in Google My Maps will
be public, as opposed to unlisted.">
Make new maps created in Google My Maps public
</string>
<string name="settings_map_public_summary_off"
translation_description="In the Sharing settings, the summary for the 'Make new maps public'
checkbox option when it is unchecked explaining that new maps created in Google My Maps will
be unlisted, as opposed to public.">
Make new maps created in Goolge My Maps unlisted
</string>
<string name="settings_share_url_only"
translation_description="In the Sharing settings, the checkbox option to share only the URL
link when sharing a link with friends.">
Share only URL link
</string>
<string name="settings_share_url_only_summary_on"
translation_description="In the Sharing settings, the summary for the 'Share only URL link'
checkbox option when it is checked explaining that only the URL link will be sent when sharing
a link with friends.">
Only the URL link will be sent when sharing a link with friends
</string>
<string name="settings_share_url_only_summary_off"
translation_description="In the Sharing settings, the summary for the 'Share only URL link'
checkbox option when it is unchecked explaining that some text and the the URL link will be
sent when sharing a link with friends.">
Some text and the URL link will be sent when sharing a link with friends
</string>
<string name="settings_allow_access"
translation_description="In the Sharing settings, the checkbox option to allow third party apps
access to My Tracks data.">
Allow access
</string>
<string name="settings_allow_access_summary_on"
translation_description="In the Sharing settings, the summary for the 'Allow access' checkbox
option when it is checked explaining that other apps can read, write, start/stop recording My
Tracks data.">
Other apps can read, write, start/stop recording My Tracks data.
</string>
<string name="settings_allow_access_summary_off"
translation_description="In the Sharing settings, the summary for the 'Allow access' checkbox
option when it is unchecked explaining that other apps cannot read, write, start/stop
recording My Tracks data.">
Other apps cannot read, write, start/stop recording My Tracks data.
</string>
<string name="settings_allow_access_dialog_message"
translation_description="In the Sharing settings, after checking the 'Allow access' checkbox,
the confirmation dialog asking the user if he wants to allow other apps, including apps
installed in the future, to control and access My Tracks data. In addition, no further
notification of third party app access will be shown.">
Are you sure you want to allow other apps, including future apps, to control and access My
Tracks data? There will be no further notification.
</string>
<string name="settings_max_recording_distance">Max distance between points</string> <!-- Backup settings -->
<string name="settings_max_recording_distance_summary">If two points are further than this, the track will be split</string> <string name="settings_sd_backup"
translation_description="In the Backup settings, the section title for configuring backup to the
SD card.">
SD Card Backup
</string>
<string name="settings_backup_to_sd"
translation_description="In the Backup settings, the option to backup to the SD card now.">
Backup now
</string>
<string name="settings_backup_to_sd_summary"
translation_description="In the Backup settings, the summary for the 'Backup now' option
explaining that all tracks and settings will be written to the SD card.">
Write a full copy of all your tracks and settings to the SD card
</string>
<string name="settings_restore_from_sd"
translation_description="In the Backup settings, the option to restore everything from the SD
card.">
Restore now
</string>
<string name="settings_restore_from_sd_summary"
translation_description="In the Backup settings, the summary for the 'Restore now' option
explaining that it restores all tracks and settings from the SD card.">
Restore all tracks and settings from the SD card
</string>
<string name="settings_min_recording_interval">Min time between points</string> <!-- Reset to defaults -->
<string name="settings_min_recording_interval_summary">Smallest time interval between two recordings of your position</string> <string name="settings_reset_dialog_message"
translation_description="In the Settings page, after pressing the 'Reset to defaults' option,
the confirmation dialog asking the user to confirm reverting all settings to defaults. But
the saved tracks will be preserved.">
All your settings will be erased and reverted to the default values. Saved tracks will be
preserved. Are you sure?
</string>
<string name="settings_reset_done"
translation_description="In the Settings page, after pressing the 'Reset to defaults' option,
the confirmation dialog informing the user that all settings have been reverted to their
defaults.">
All settings have been reverted to their defaults.
</string>
<string name="settings_min_required_accuracy">Minimum accuracy</string> <!-- Settings others -->
<string name="settings_min_required_accuracy_summary">Recording will be paused if your position is not at least this accurate</string> <string name="settings_not_while_recording"
translation_description="In the Settings page, the summary for an option that is not available
during a track recording.">
Not available while recording a track
</string>
<string name="settings_metric_units">Use metric units</string> <!-- Backup now -->
<string name="settings_metric_units_summary_on">All distances will be displayed in metric units</string> <string name="backup_write_progress_message"
<string name="settings_metric_units_summary_off">All distances will be displayed in imperial units</string> translation_description="In the Backup settings, after pressing the 'Backup now' option, the
progress dialog telling the user that it is writing all tracks and settings and that it may
take a while.">
Writing all tracks and settings to the SD card. This may take a while...
</string>
<string name="settings_map_public">Make maps public</string> <!-- Restore now -->
<string name="settings_map_public_summary_on">Uploaded maps will be visible to anyone on maps.google.com</string> <string name="restore_overwrites_warning"
<string name="settings_map_public_summary_off">Uploaded maps will not be listed publicly on maps.google.com</string> translation_description="In the Backup settings, after pressing the 'Restore now' option, the
message in the alert dialog asking the user to confirm that he wants to restore from a backup
<string name="settings_report_speed_or_pace">Display speed</string> and it will overwrite all the current tracks and settings.">
<string name="settings_report_speed_or_pace_summary_on">Speed will be displayed</string> Restoring a backup from the SD card will OVERWRITE all your current tracks and settings. Are you
<string name="settings_report_speed_or_pace_summary_off">Pace will be displayed</string> sure?
</string>
<string name="settings_share_url_only">Share only URL</string> <string name="select_backup_to_restore"
<string name="settings_share_url_only_summary_on">Only the URL of the map will be sent when sharing</string> translation_description="In the Backup settings, after pressing the 'Restore now' option, the
<string name="settings_share_url_only_summary_off">The contents of the track will also be included when sharing</string> message in the alert dialog asking the user to select a backup.">
Select the backup to restore
<string name="settings_split_frequency">Split frequency</string> </string>
<string name="settings_split_frequency_summary">Maximum time or distance after which a new split marker will be inserted</string> <string name="no_backups"
translation_description="In the Backup settings, after pressing the 'Restore now' option, the
<string name="settings_auto_resume_track_timeout">Auto-resume track timeout</string> message in the alert dialog informing the user that there is no backup.">
<string name="settings_auto_resume_track_timeout_summary">Maximum time in minutes after which a previously recording track will not be resumed on phone reboot</string> No backup found.
</string>
<string name="settings_timestamp_track_name">Timestamp as track name</string> <string name="backup_import_progress_message"
<string name="settings_timestamp_track_name_summary_on">The default track name will be the date and time at the start of the track</string> translation_description="In the Backup settings, after pressing the 'Restore now' option, the
<string name="settings_timestamp_track_name_summary_off">Track names will have numbers which increment for each new track.</string> message on the progress dialog indicating that My Tracks is reading all tracks and settings
from the backup on the SD card and that it may take a while.">
<string name="settings_reset">Reset to defaults</string> Reading all tracks and settings from the SD card. This may take a while...
<string name="settings_reset_summary">Revert all your settings to the default values</string> </string>
<string name="settings_reset_dialog_message">All your settings will be erased and reverted to the default values. Saved tracks will be preserved. Are you sure?</string>
<string name="settings_reset_done">All settings have been reverted to their defaults.</string>
<string name="eclair_required">Only supported in Android 2.0 or above</string>
<string name="settings_sensor_type">Sensor Type</string>
<string name="settings_sensor_type_summary">The type of sensor to connect to</string>
<string name="settings_heart_rate_ant_sensor_id">Clear ANT heart rate sensor pairing</string>
<string name="settings_power_ant_sensor_id">Clear ANT power sensor pairing</string>
<string name="settings_srm_bridge_ant_sensor_id">Clear ANT SRM bridge sensor pairing</string>
<string name="settings_ant_not_paired">ANT sensor not paired</string>
<string name="settings_ant_paired">ANT sensor paired with: %d</string>
<string name="bluetooth_sensor_title">Bluetooth sensor</string>
<string name="bluetooth_sensor_summary">The bluetooth sensor to connect to</string>
<string name="settings_modular_stats_display_title">Modular Stats Display</string>
<string name="settings_track_color_mode">Track Color Mode</string>
<string name="settings_track_color_mode_summary">The way to color the track</string>
<string name="settings_track_color_mode_fixed">Fixed</string>
<string name="settings_track_color_mode_dynamic">Dynamic</string>
<string name="settings_track_color_mode_fixed_speed_slow">Fixed Speed Slow</string>
<string name="settings_track_color_mode_fixed_speed_slow_summary">Slow speed top value</string>
<string name="settings_track_color_mode_fixed_speed_medium">Fixed Speed Medium</string>
<string name="settings_track_color_mode_fixed_speed_medium_summary">Medium speed top value</string>
<string name="settings_track_color_mode_dynamic_speed_variation">Dynamic Speed Variation</string>
<string name="settings_track_color_mode_dynamic_speed_variation_summary">% Margin from average speed to consider medium speed</string>
<!-- Backups -->
<string name="settings_backup">Backup (BETA)</string>
<string name="settings_sd_backup">SD Card Backup</string>
<string name="settings_backup_to_sd">Backup now</string>
<string name="settings_backup_to_sd_summary">Write a full copy of all your tracks and settings to the SD card</string>
<string name="settings_restore_from_sd">Restore now</string>
<string name="settings_restore_from_sd_summary">Restore all tracks and settings from the SD card</string>
<string name="restore_overwrites_warning">Restoring a backup from the SD card will OVERWRITE all your current tracks and settings. Are you sure?</string>
<string name="select_backup_to_restore">Select the backup to restore</string>
<string name="no_backups">No backups found.</string>
<string name="backup_write_progress_message">Writing all tracks and settings to the SD card. This may take a while...</string>
<string name="backup_import_progress_message">Reading all tracks and settings from the SD card. This may take a while...</string>
<!-- MyTracksSky -->
<string name="mytracks_sky">GPS Satellites</string>
<!-- Google My Maps --> <!-- Google My Maps -->
<string name="map_list_title" <string name="map_list_title"
@@ -954,6 +1271,7 @@ limitations under the License.
<!-- Stats Labels --> <!-- Stats Labels -->
<string name="time_label">Time</string> <string name="time_label">Time</string>
<string name="sd_unavail">SD Unavailable</string> <string name="sd_unavail">SD Unavailable</string>
<string name="pace_label">Pace</string>
<string name="start_trip">You must start a trip.</string> <string name="start_trip">You must start a trip.</string>
<string name="distance_label">Distance</string> <string name="distance_label">Distance</string>
<string name="power">Power</string> <string name="power">Power</string>
@@ -1028,23 +1346,6 @@ limitations under the License.
<string name="check_units_title">Units of Measure Notice</string> <string name="check_units_title">Units of Measure Notice</string>
<string name="check_units_message">Do you want to use metrics as your default units?</string> <string name="check_units_message">Do you want to use metrics as your default units?</string>
<!-- Fake preference keys - never saved, but show options in the preferences screen -->
<string name="method_bluetooth">Bluetooth</string>
<string name="bluetooth_options">Bluetooth options</string>
<string name="bluetooth_pairing">Device pairing</string>
<string name="bluetooth_pairing_summary">Open Android\'s bluetooth settings to pair a device</string>
<string name="sensor_bluetooth_options_key">bluetoothSensorsEnabled</string>
<string name="ant_options">ANT options</string>
<string name="sensor_options">Sensor Options</string>
<string name="track_color_mode">Track Color Mode</string>
<string name="fixed_speed_options">Fixed Speed Options</string>
<string name="dynamic_speed_options">Dynamic Speed Options</string>
<!-- Bluetooth Sensor -->
<string name="bluetooth_connected">Connected to %s</string>
<string name="bluetooth_connecting">Bluetooth sensor connecting ...</string>
<string name="bluetooth_not_connected">Bluetooth sensor not connected</string>
<!-- Sensor State --> <!-- Sensor State -->
<string name="sensor_data_time">Sensor Data Time</string> <string name="sensor_data_time">Sensor Data Time</string>
<string name="power_meter_enabled">Power meter enabled</string> <string name="power_meter_enabled">Power meter enabled</string>
+3 -3
View File
@@ -41,7 +41,7 @@ limitations under the License.
android:entryValues="@array/track_color_mode_values" android:entryValues="@array/track_color_mode_values"
android:defaultValue="@string/track_color_mode_value_none"/> android:defaultValue="@string/track_color_mode_value_none"/>
<PreferenceCategory android:title="@string/fixed_speed_options" <PreferenceCategory android:title="@string/track_color_mode_option_fixed"
android:key="@string/track_color_mode_fixed_speed_options_key"> android:key="@string/track_color_mode_fixed_speed_options_key">
<EditTextPreference android:key="@string/track_color_mode_fixed_speed_slow_key" <EditTextPreference android:key="@string/track_color_mode_fixed_speed_slow_key"
android:title="@string/settings_track_color_mode_fixed_speed_slow" android:title="@string/settings_track_color_mode_fixed_speed_slow"
@@ -76,7 +76,7 @@ limitations under the License.
</EditTextPreference> </EditTextPreference>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/dynamic_speed_options"> <PreferenceCategory android:title="@string/track_color_mode_option_dynamic">
<EditTextPreference android:key="@string/track_color_mode_dynamic_speed_variation_key" <EditTextPreference android:key="@string/track_color_mode_dynamic_speed_variation_key"
android:title="@string/settings_track_color_mode_dynamic_speed_variation" android:title="@string/settings_track_color_mode_dynamic_speed_variation"
android:summary="@string/settings_track_color_mode_dynamic_speed_variation_summary" android:summary="@string/settings_track_color_mode_dynamic_speed_variation_summary"
@@ -155,7 +155,7 @@ limitations under the License.
</PreferenceScreen> </PreferenceScreen>
<!-- Sensors --> <!-- Sensors -->
<PreferenceScreen android:title="@string/sensor_options" <PreferenceScreen android:title="@string/settings_sensor"
android:key="@string/sensor_options_key"> android:key="@string/sensor_options_key">
<ListPreference android:key="@string/sensor_type_key" <ListPreference android:key="@string/sensor_type_key"
android:title="@string/settings_sensor_type" android:title="@string/settings_sensor_type"
@@ -260,7 +260,6 @@ public class ChartActivity extends Activity implements TrackDataListener {
* *
* @param location the location to get data for (this method takes ownership of that location) * @param location the location to get data for (this method takes ownership of that location)
* @param result the resulting point to fill out * @param result the resulting point to fill out
* @return the previous location, now available for reuse
*/ */
private void fillDataPoint(Location location, double result[]) { private void fillDataPoint(Location location, double result[]) {
double timeOrDistance = Double.NaN, double timeOrDistance = Double.NaN,
@@ -20,8 +20,8 @@ import com.google.android.apps.mytracks.stats.ExtremityMonitor;
import android.content.Context; import android.content.Context;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Paint.Style; import android.graphics.Paint.Style;
import android.graphics.Path;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@@ -133,9 +133,10 @@ public class ChartValueSeries {
* *
* @param context The context for the chart * @param context The context for the chart
* @param formatString The format of the decimal format for this series * @param formatString The format of the decimal format for this series
* @param fill The paint for filling the chart * @param fillColor The paint for filling the chart
* @param stroke The paint for stroking the outside the chart, optional * @param strokeColor The paint for stroking the outside the chart, optional
* @param zoomSettings The settings related to zooming * @param zoomSettings The settings related to zooming
* @param titleId The title ID
* *
* TODO: Get rid of Context and inject appropriate values instead. * TODO: Get rid of Context and inject appropriate values instead.
*/ */
@@ -881,7 +881,6 @@ public class ChartView extends View {
* *
* @param index the time series, one of {@link #ELEVATION_SERIES}, * @param index the time series, one of {@link #ELEVATION_SERIES},
* {@link #SPEED_SERIES}, {@link #POWER_SERIES}, etc. * {@link #SPEED_SERIES}, {@link #POWER_SERIES}, etc.
* @return true to be drawn, false otherwise
*/ */
public void setChartValueSeriesEnabled(int index, boolean enabled) { public void setChartValueSeriesEnabled(int index, boolean enabled) {
series[index].setEnabled(enabled); series[index].setEnabled(enabled);
@@ -30,8 +30,8 @@ import android.view.WindowManager.BadTokenException;
public class DialogManager { public class DialogManager {
/** /**
* The equivalent of {@link #showDialogSafely(int)}, but for a specific * The equivalent of {@link Dialog#show()}, but for a specific dialog
* dialog instance. * instance.
*/ */
public static void showDialogSafely(Activity activity, final Dialog dialog) { public static void showDialogSafely(Activity activity, final Dialog dialog) {
if (activity.isFinishing()) { if (activity.isFinishing()) {
@@ -53,8 +53,8 @@ public class DialogManager {
} }
/** /**
* The equivalent of {@link #dismissDialogSafely(int)}, but for a specific * The equivalent of {@link Dialog#dismiss()}, but for a specific dialog
* dialog instance. * instance.
*/ */
public static void dismissDialogSafely(Activity activity, final Dialog dialog) { public static void dismissDialogSafely(Activity activity, final Dialog dialog) {
if (activity.isFinishing()) { if (activity.isFinishing()) {
@@ -77,7 +77,6 @@ public class MapOverlay extends Overlay implements OnSharedPreferenceChangeListe
private GeoPoint lastReferencePoint; private GeoPoint lastReferencePoint;
private Rect lastViewRect; private Rect lastViewRect;
private boolean lastPathExists; private boolean lastPathExists;
private Location lastLocation;
private TrackPathPainter trackPathPainter; private TrackPathPainter trackPathPainter;
/** /**
@@ -108,7 +108,7 @@ public class SettingsActivity extends PreferenceActivity {
announcementFrequency.setEnabled(false); announcementFrequency.setEnabled(false);
announcementFrequency.setValue("-1"); announcementFrequency.setValue("-1");
announcementFrequency.setSummary( announcementFrequency.setSummary(
R.string.settings_not_available_summary); R.string.settings_announcement_frequency_not_available);
} }
} }
@@ -509,8 +509,7 @@ public class SettingsActivity extends PreferenceActivity {
* Saves the given edit text preference value. * Saves the given edit text preference value.
* If the units are not metric convert the value before saving. * If the units are not metric convert the value before saving.
*/ */
private void validateTrackColorModeSettings(EditTextPreference preference, private void validateTrackColorModeSettings(String newValue, int id) {
String newValue, int id) {
CheckBoxPreference metricUnitsPreference = (CheckBoxPreference) findPreference( CheckBoxPreference metricUnitsPreference = (CheckBoxPreference) findPreference(
getString(R.string.metric_units_key)); getString(R.string.metric_units_key));
String metricspeed; String metricspeed;
@@ -549,7 +548,7 @@ public class SettingsActivity extends PreferenceActivity {
@Override @Override
public boolean onPreferenceChange(Preference preference, public boolean onPreferenceChange(Preference preference,
Object newValue) { Object newValue) {
validateTrackColorModeSettings((EditTextPreference) preference, (String) newValue, metricKey); validateTrackColorModeSettings((String) newValue, metricKey);
return true; return true;
} }
}); });
@@ -84,7 +84,7 @@ public class TrackDataHub {
/** /**
* Listen to sampled-out points. * Listen to sampled-out points.
* Listening to this without listening to {@link #SAMPLED_POINT_UPDATES} * Listening to this without listening to {@link #POINT_UPDATES}
* makes no sense and may yield unexpected results. * makes no sense and may yield unexpected results.
*/ */
SAMPLED_OUT_POINT_UPDATES, SAMPLED_OUT_POINT_UPDATES,
@@ -385,8 +385,8 @@ public class TrackDataHub {
/** /**
* Loads the given track and makes it the currently-selected one. * Loads the given track and makes it the currently-selected one.
* It is ok to call this method before {@link start}, and in that case * It is ok to call this method before {@link #start}, and in that case
* the data will only be passed to listeners when {@link start} is called. * the data will only be passed to listeners when {@link #start} is called.
* *
* @param trackId the ID of the track to load * @param trackId the ID of the track to load
*/ */
@@ -801,7 +801,7 @@ public class TrackDataHub {
/** /**
* Notifies that a new track has been selected.. * Notifies that a new track has been selected..
* *
* @param track the new selected track * @param trackId the new selected track
* @param listeners the listeners to notify * @param listeners the listeners to notify
*/ */
private void notifySelectedTrackChanged(long trackId, private void notifySelectedTrackChanged(long trackId,
@@ -97,8 +97,8 @@ class TrackDataListeners {
/** /**
* Registers a listener to send data to. * Registers a listener to send data to.
* It is ok to call this method before {@link start}, and in that case * It is ok to call this method before {@link TrackDataHub#start}, and in that case
* the data will only be passed to listeners when {@link start} is called. * the data will only be passed to listeners when {@link TrackDataHub#start} is called.
* *
* @param listener the listener to register * @param listener the listener to register
* @param dataTypes the type of data that the listener is interested in * @param dataTypes the type of data that the listener is interested in
@@ -135,9 +135,6 @@ public class ModernAuthManager implements AuthManager {
* {@link Activity#onActivityResult} function * {@link Activity#onActivityResult} function
* @param results The data passed in to the {@link Activity}'s * @param results The data passed in to the {@link Activity}'s
* {@link Activity#onActivityResult} function * {@link Activity#onActivityResult} function
* @return True if the auth token was fetched or we aren't done fetching
* the auth token, or False if there was an error or the request was
* canceled
*/ */
public void authResult(int resultCode, Intent results) { public void authResult(int resultCode, Intent results) {
boolean retry = false; boolean retry = false;
@@ -169,12 +166,11 @@ public class ModernAuthManager implements AuthManager {
} }
/** /**
* Invalidates the existing auth token and request a new one. The * Invalidates the existing auth token and request a new one. The callback
* {@link Runnable} provided will be executed when the new auth token is * provided will be executed when the new auth token is successfully fetched.
* successfully fetched.
* *
* @param runnable A {@link Runnable} to execute when a new auth token * @param callback A callback to execute when a new auth token is successfully
* is successfully fetched * fetched
*/ */
public void invalidateAndRefresh(final AuthCallback callback) { public void invalidateAndRefresh(final AuthCallback callback) {
this.authCallback = callback; this.authCallback = callback;
@@ -358,7 +358,7 @@ public class SendToMyMaps implements Runnable {
* Prepares a buffer of locations for transmission to google maps. * Prepares a buffer of locations for transmission to google maps.
* *
* @param track the original track with meta data * @param track the original track with meta data
* @param buffer a buffer of locations on the track * @param locations a buffer of locations on the track
* @return an array of tracks each with a sub section of the points in the * @return an array of tracks each with a sub section of the points in the
* original buffer * original buffer
*/ */
@@ -15,8 +15,8 @@
*/ */
package com.google.android.apps.mytracks.io.backup; package com.google.android.apps.mytracks.io.backup;
import com.google.android.apps.mytracks.MyTracks;
import com.google.android.apps.mytracks.Constants; import com.google.android.apps.mytracks.Constants;
import com.google.android.apps.mytracks.MyTracks;
import com.google.android.apps.mytracks.util.FileUtils; import com.google.android.apps.mytracks.util.FileUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
@@ -148,7 +148,6 @@ public class BackupActivityHelper {
/** /**
* Shows a backup list for the user to pick, then restores it. * Shows a backup list for the user to pick, then restores it.
* *
* @param backupDir the backup directory
* @param backupDates the list of available backup files * @param backupDates the list of available backup files
*/ */
private void pickBackupForRestore(final Date[] backupDates) { private void pickBackupForRestore(final Date[] backupDates) {
@@ -179,9 +178,9 @@ public class BackupActivityHelper {
} }
/** /**
* Shows a progress dialog, then starts restoring the backup osynchronously. * Shows a progress dialog, then starts restoring the backup asynchronously.
* *
* @param inputFile the file to restore from * @param date the date
*/ */
private void restoreFromDateAsync(final Date date) { private void restoreFromDateAsync(final Date date) {
// Show a progress dialog // Show a progress dialog
@@ -17,6 +17,8 @@ package com.google.android.apps.mytracks.io.file;
import static com.google.android.apps.mytracks.Constants.TAG; import static com.google.android.apps.mytracks.Constants.TAG;
import com.google.android.apps.mytracks.util.FileUtils;
import android.os.Environment; import android.os.Environment;
import android.util.Log; import android.util.Log;
@@ -51,11 +53,9 @@ public class TempFileCleaner {
} }
private void cleanTmpDirectory(String name) { private void cleanTmpDirectory(String name) {
String sep = System.getProperty("file.separator"); FileUtils fileUtils = new FileUtils();
cleanTmpDirectory( String dirName = fileUtils.buildExternalDirectoryPath(name, "tmp");
new File( cleanTmpDirectory(new File(dirName));
Environment.getExternalStorageDirectory() + sep + name + sep
+ "tmp"));
} }
// @VisibleForTesting // @VisibleForTesting
@@ -23,9 +23,17 @@ import com.google.wireless.gdata.parser.ParseException;
import com.google.wireless.gdata.serializer.GDataSerializer; import com.google.wireless.gdata.serializer.GDataSerializer;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Config;
import android.util.Log; import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.zip.GZIPInputStream;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
@@ -39,15 +47,6 @@ import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.InputStreamEntity; import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.client.DefaultHttpClient;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.zip.GZIPInputStream;
/** /**
* Implementation of a GDataClient using GoogleHttpClient to make HTTP requests. * Implementation of a GDataClient using GoogleHttpClient to make HTTP requests.
* Always issues GETs and POSTs, using the X-HTTP-Method-Override header when a * Always issues GETs and POSTs, using the X-HTTP-Method-Override header when a
@@ -58,7 +57,6 @@ public class AndroidGDataClient implements GDataClient {
private static final String TAG = "GDataClient"; private static final String TAG = "GDataClient";
private static final boolean DEBUG = false; private static final boolean DEBUG = false;
private static final boolean LOCAL_LOGV = DEBUG ? Config.LOGD : Config.LOGV;
private static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override"; private static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override";
@@ -196,7 +194,7 @@ public class AndroidGDataClient implements GDataClient {
if (!TextUtils.isEmpty(authToken)) { if (!TextUtils.isEmpty(authToken)) {
request.addHeader("Authorization", "GoogleLogin auth=" + authToken); request.addHeader("Authorization", "GoogleLogin auth=" + authToken);
} }
if (LOCAL_LOGV) { if (DEBUG) {
for (Header h : request.getAllHeaders()) { for (Header h : request.getAllHeaders()) {
Log.v(TAG, h.getName() + ": " + h.getValue()); Log.v(TAG, h.getName() + ": " + h.getValue());
} }
@@ -36,7 +36,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* handling. After a query is run, the wrapper can be queried about the error * handling. After a query is run, the wrapper can be queried about the error
* that occurred. * that occurred.
* *
* @param C the GData service client * @param <C> the GData service client
* @author Sandor Dornbush * @author Sandor Dornbush
*/ */
public class GDataWrapper<C> { public class GDataWrapper<C> {
@@ -138,7 +138,7 @@ public class MapsFacade {
* @param mapId ID of the map to upload to * @param mapId ID of the map to upload to
* @param trackName name of the track being started/ended * @param trackName name of the track being started/ended
* @param trackDescription description of the track being started/ended * @param trackDescription description of the track being started/ended
* @param location the location of the marker * @param loc the location of the marker
* @param isStart true to add a start marker, false to add an end marker * @param isStart true to add a start marker, false to add an end marker
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
@@ -185,7 +185,9 @@ public class MapsFacade {
/** /**
* Builds a placemark MyMapsFeature from a track. * Builds a placemark MyMapsFeature from a track.
* *
* @param track the track * @param trackName the track
* @param trackDescription the track description
* @param geoPoint the geo point
* @param isStart true if it's the start of the track, or false for end * @param isStart true if it's the start of the track, or false for end
* @return a MyMapsFeature * @return a MyMapsFeature
*/ */
@@ -206,9 +208,12 @@ public class MapsFacade {
} }
/** /**
* Builds a MyMapsFeature from a track. * Builds a MyMapsFeature from a waypoint.
* *
* @param wpt the waypoint * @param title the title
* @param description the description
* @param iconUrl the icon url
* @param geoPoint the waypoint
* @return a MyMapsFeature * @return a MyMapsFeature
*/ */
private static MyMapsFeature buildMyMapsPlacemarkFeature( private static MyMapsFeature buildMyMapsPlacemarkFeature(
@@ -336,7 +341,8 @@ public class MapsFacade {
/** /**
* Builds a MyMapsFeature from a track. * Builds a MyMapsFeature from a track.
* *
* @param track the track * @param trackName the track name
* @param locations locations on the track
* @return a MyMapsFeature * @return a MyMapsFeature
*/ */
private static MyMapsFeature buildMyMapsLineFeature(String trackName, private static MyMapsFeature buildMyMapsLineFeature(String trackName,
@@ -12,12 +12,12 @@ import com.google.wireless.gdata.serializer.xml.XmlEntryGDataSerializer;
import android.util.Log; import android.util.Log;
import org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import org.xmlpull.v1.XmlPullParserException;
/** /**
* Factory of Xml parsers for gdata maps data. * Factory of Xml parsers for gdata maps data.
*/ */
@@ -39,7 +39,7 @@ class XmlMapsGDataParserFactory implements GDataParserFactory {
} }
} }
@SuppressWarnings({ "unchecked", "rawtypes" }) @SuppressWarnings("unchecked")
@Override @Override
public GDataParser createParser(Class cls, InputStream is) public GDataParser createParser(Class cls, InputStream is)
throws ParseException { throws ParseException {
@@ -60,7 +60,11 @@ class XmlMapsGDataSerializer extends XmlEntryGDataSerializer {
declareEntryNamespaces(serializer); declareEntryNamespaces(serializer);
serializer.startTag(XmlGDataParser.NAMESPACE_ATOM_URI, "entry"); serializer.startTag(XmlGDataParser.NAMESPACE_ATOM_URI, "entry");
stream = MapsClient.LOG_COMMUNICATION ? printStream : out; if (MapsClient.LOG_COMMUNICATION) {
stream = printStream;
} else {
stream = out;
}
serializeEntryContents(serializer, format); serializeEntryContents(serializer, format);
serializer.endTag(XmlGDataParser.NAMESPACE_ATOM_URI, "entry"); serializer.endTag(XmlGDataParser.NAMESPACE_ATOM_URI, "entry");
@@ -69,8 +69,8 @@ public class BluetoothConnectionManager {
/** /**
* Constructor. Prepares a new BluetoothSensor session. * Constructor. Prepares a new BluetoothSensor session.
* *
* @param context The UI Activity Context
* @param handler A Handler to send messages back to the UI Activity * @param handler A Handler to send messages back to the UI Activity
* @param parser A message parser
*/ */
public BluetoothConnectionManager(Handler handler, MessageParser parser) { public BluetoothConnectionManager(Handler handler, MessageParser parser) {
this.adapter = BluetoothAdapter.getDefaultAdapter(); this.adapter = BluetoothAdapter.getDefaultAdapter();
@@ -48,8 +48,8 @@ public class PolarMessageParser implements MessageParser {
* offset 2 = check byte, 255 - packet length. * offset 2 = check byte, 255 - packet length.
* offset 3 = sequence byte, range from 0 to 15. * offset 3 = sequence byte, range from 0 to 15.
* *
* @param an array of bytes to parse * @param buffer an array of bytes to parse
* @param buffer offset to beginning of packet. * @param i buffer offset to beginning of packet.
* @return whether buffer has a valid packet at offset i * @return whether buffer has a valid packet at offset i
*/ */
private boolean packetValid (byte[] buffer, int i) { private boolean packetValid (byte[] buffer, int i) {
@@ -100,7 +100,7 @@ public class PolarMessageParser implements MessageParser {
/** /**
* Applies packet validation rules to buffer * Applies packet validation rules to buffer
* *
* @param an array of bytes to parse * @param buffer an array of bytes to parse
* @return whether buffer has a valid packet starting at index zero * @return whether buffer has a valid packet starting at index zero
*/ */
@Override @Override
@@ -124,7 +124,7 @@ public class PolarMessageParser implements MessageParser {
/** /**
* Searches buffer for the beginning of a valid packet. * Searches buffer for the beginning of a valid packet.
* *
* @param an array of bytes to parse * @param buffer an array of bytes to parse
* @return index to beginning of good packet, or -1 if none found. * @return index to beginning of good packet, or -1 if none found.
*/ */
@Override @Override
@@ -58,12 +58,12 @@ public class SensorUtils {
} }
/** /**
* Returns CRC8 (polynomial 0x8C) from byte array buffer[start] until * Returns CRC8 (polynomial 0x8C) from byte array buffer[start] to
* (including) buffer[end] * (excluding) buffer[start + length]
* *
* @param buffer the byte array of data (payload) * @param buffer the byte array of data (payload)
* @param start the position in the byte array where the payload begins * @param start the position in the byte array where the payload begins
* @param end the position in the byte array where the payload ends * @param length the length
* @return CRC8 value * @return CRC8 value
*/ */
public static byte getCrc8(byte[] buffer, int start, int length) { public static byte getCrc8(byte[] buffer, int start, int length) {
@@ -67,10 +67,6 @@ public abstract class AntSensorManager extends SensorManager {
private AntInterface antReceiver; private AntInterface antReceiver;
// Flag to know if the ANT App was interrupted
// TODO: This code path is not used but probably should be.
private boolean antInterrupted;
/** /**
* The data from the sensors. * The data from the sensors.
*/ */
@@ -126,33 +122,19 @@ public abstract class AntSensorManager extends SensorManager {
public AntSensorManager(Context context) { public AntSensorManager(Context context) {
this.context = context; this.context = context;
// We register for ANT intents early because we want to have a record of
// the status intents in the log as we start up.
registerForAntIntents();
} }
@Override @Override
public void onDestroy() { public void onDestroy() {
Log.i(TAG, "destroying AntSensorManager"); Log.i(TAG, "destroying AntSensorManager");
try {
context.unregisterReceiver(statusReceiver);
} catch (IllegalArgumentException e) {
Log.w(TAG, "Failed to unregister ANT status receiver", e);
}
try { cleanAntInterface();
context.unregisterReceiver(dataReceiver); unregisterForAntIntents();
} catch (IllegalArgumentException e) {
Log.w(TAG, "Failed to unregister ANT data receiver", e);
}
if (antReceiver != null) {
try {
antReceiver.releaseInterface();
} catch (AntServiceNotConnectedException e) {
Log.i(TAG, "ANT service not connected", e);
} catch (AntInterfaceException e) {
Log.e(TAG, "failed to release ANT interface", e);
}
antReceiver.destroy();
}
} }
@Override @Override
@@ -177,15 +159,17 @@ public abstract class AntSensorManager extends SensorManager {
*/ */
@Override @Override
protected final void setupChannel() { protected final void setupChannel() {
setup();
}
private synchronized void setup() {
// We handle this unpleasantly because the UI should've checked for ANT // We handle this unpleasantly because the UI should've checked for ANT
// support before it even instantiated this class. // support before it even instantiated this class.
if (!AntInterface.hasAntSupport(context)) { if (!AntInterface.hasAntSupport(context)) {
throw new IllegalStateException("device does not have ANT support"); throw new IllegalStateException("device does not have ANT support");
} }
// We register for ANT intents early because we want to have a record of cleanAntInterface();
// the status intents in the log as we start up.
registerForAntIntents();
antReceiver = AntInterface.getInstance(context, antServiceListener); antReceiver = AntInterface.getInstance(context, antServiceListener);
@@ -197,6 +181,29 @@ public abstract class AntSensorManager extends SensorManager {
setSensorState(Sensor.SensorState.CONNECTING); setSensorState(Sensor.SensorState.CONNECTING);
} }
/**
* Cleans up the ANT+ receiver interface, by releasing the interface
* and destroying it.
*/
private void cleanAntInterface()
{
Log.i(TAG, "Destroying AntSensorManager");
if (antReceiver != null) {
try {
antReceiver.releaseInterface();
} catch (AntServiceNotConnectedException e) {
Log.i(TAG, "ANT service not connected", e);
} catch (AntInterfaceException e) {
Log.e(TAG, "failed to release ANT interface", e);
}
antReceiver.destroy();
antReceiver = null;
}
}
/** /**
* This method is invoked via the ServiceListener when we're connected to * This method is invoked via the ServiceListener when we're connected to
* the ANT service. If we're just starting up, this is our first opportunity * the ANT service. If we're just starting up, this is our first opportunity
@@ -214,10 +221,8 @@ public abstract class AntSensorManager extends SensorManager {
if (!antReceiver.isEnabled()) { if (!antReceiver.isEnabled()) {
// Make sure not to call AntInterface.enable() again, if it has been // Make sure not to call AntInterface.enable() again, if it has been
// already called before // already called before
if (antInterrupted == false) { Log.i(TAG, "Powering on Radio");
Log.i(TAG, "Powering on Radio"); antReceiver.enable();
antReceiver.enable();
}
} else { } else {
Log.i(TAG, "Radio already enabled"); Log.i(TAG, "Radio already enabled");
} }
@@ -338,6 +343,23 @@ public abstract class AntSensorManager extends SensorManager {
context.registerReceiver(dataReceiver, dataIntentFilter); context.registerReceiver(dataReceiver, dataIntentFilter);
} }
private void unregisterForAntIntents()
{
Log.i(TAG, "Unregistering ANT Intents.");
try {
context.unregisterReceiver(statusReceiver);
} catch (IllegalArgumentException e) {
Log.w(TAG, "Failed to unregister ANT status receiver", e);
}
try {
context.unregisterReceiver(dataReceiver);
} catch (IllegalArgumentException e) {
Log.w(TAG, "Failed to unregister ANT data receiver", e);
}
}
private String messageToString(byte[] message) { private String messageToString(byte[] message) {
StringBuilder out = new StringBuilder(); StringBuilder out = new StringBuilder();
for (byte b : message) { for (byte b : message) {
@@ -85,11 +85,11 @@ public class TrackWidgetProvider
selectedTrackId = -1; selectedTrackId = -1;
} }
private void initialize(Context context) { private void initialize(Context aContext) {
if (this.context != null) { if (this.context != null) {
return; return;
} }
this.context = context; this.context = aContext;
trackObserver = new TrackObserver(); trackObserver = new TrackObserver();
providerUtils = MyTracksProviderUtils.Factory.get(context); providerUtils = MyTracksProviderUtils.Factory.get(context);
unknown = context.getString(R.string.unknown); unknown = context.getString(R.string.unknown);
@@ -105,9 +105,9 @@ public class TrackWidgetProvider
} }
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context aContext, Intent intent) {
super.onReceive(context, intent); super.onReceive(aContext, intent);
initialize(context); initialize(aContext);
selectedTrackId = intent.getLongExtra( selectedTrackId = intent.getLongExtra(
context.getString(R.string.track_id_broadcast_extra), selectedTrackId); context.getString(R.string.track_id_broadcast_extra), selectedTrackId);
@@ -124,9 +124,9 @@ public class TrackWidgetProvider
} }
@Override @Override
public void onDisabled(Context context) { public void onDisabled(Context aContext) {
if (trackObserver != null) { if (trackObserver != null) {
context.getContentResolver().unregisterContentObserver(trackObserver); aContext.getContentResolver().unregisterContentObserver(trackObserver);
} }
if (sharedPreferences != null) { if (sharedPreferences != null) {
sharedPreferences.unregisterOnSharedPreferenceChangeListener(this); sharedPreferences.unregisterOnSharedPreferenceChangeListener(this);
@@ -154,7 +154,7 @@ public class TrackWidgetProvider
views.setOnClickPendingIntent(R.id.appwidget_track_statistics, pendingIntent); views.setOnClickPendingIntent(R.id.appwidget_track_statistics, pendingIntent);
if (action != null) { if (action != null) {
updateViewButton(views, context, action); updateViewButton(views, action);
} }
updateViewTrackStatistics(views, track); updateViewTrackStatistics(views, track);
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(widget); int[] appWidgetIds = appWidgetManager.getAppWidgetIds(widget);
@@ -167,20 +167,19 @@ public class TrackWidgetProvider
* Update the widget's button with the appropriate intent and icon. * Update the widget's button with the appropriate intent and icon.
* *
* @param views The RemoteViews containing the button * @param views The RemoteViews containing the button
* @param context The Context of the AppWidget
* @param action The action broadcast from the track service * @param action The action broadcast from the track service
*/ */
private void updateViewButton(RemoteViews views, Context context, String action) { private void updateViewButton(RemoteViews views, String action) {
if (TRACK_STARTED_ACTION.equals(action)) { if (TRACK_STARTED_ACTION.equals(action)) {
// If a new track is started by this appwidget or elsewhere, // If a new track is started by this appwidget or elsewhere,
// toggle the button to active and have it disable the track if pressed. // toggle the button to active and have it disable the track if pressed.
setButtonIntent( setButtonIntent(
views, context, R.string.end_current_track_action, R.drawable.appwidget_button_enabled); views, R.string.end_current_track_action, R.drawable.appwidget_button_enabled);
} else { } else {
// If a track is stopped by this appwidget or elsewhere, // If a track is stopped by this appwidget or elsewhere,
// toggle the button to inactive and have it start a new track if pressed. // toggle the button to inactive and have it start a new track if pressed.
setButtonIntent( setButtonIntent(
views, context, R.string.start_new_track_action, R.drawable.appwidget_button_disabled); views, R.string.start_new_track_action, R.drawable.appwidget_button_disabled);
} }
} }
@@ -188,12 +187,10 @@ public class TrackWidgetProvider
* Set up the main widget button. * Set up the main widget button.
* *
* @param views The widget views * @param views The widget views
* @param context The widget context
* @param action The resource id of the action to fire when the button is pressed * @param action The resource id of the action to fire when the button is pressed
* @param icon The resource id of the icon to show for the button * @param icon The resource id of the icon to show for the button
*/ */
private void setButtonIntent( private void setButtonIntent(RemoteViews views, int action, int icon) {
RemoteViews views, Context context, int action, int icon) {
Intent intent = new Intent(context, ControlRecordingService.class); Intent intent = new Intent(context, ControlRecordingService.class);
intent.setAction(context.getString(action)); intent.setAction(context.getString(action));
PendingIntent pendingIntent = PendingIntent.getService(context, 0, PendingIntent pendingIntent = PendingIntent.getService(context, 0,
@@ -153,7 +153,7 @@ public class SpreadsheetsClient extends GDataServiceClient {
* @return a parser for the indicated feed * @return a parser for the indicated feed
* @throws ParseException if the response from the server could not be parsed * @throws ParseException if the response from the server could not be parsed
*/ */
@SuppressWarnings("rawtypes") @SuppressWarnings("unchecked")
@Override @Override
public GDataParser getParserForFeed( public GDataParser getParserForFeed(
Class feedEntryClass, String feedUri, String authToken) Class feedEntryClass, String feedUri, String authToken)
@@ -227,7 +227,7 @@ public class SpreadsheetsClient extends GDataServiceClient {
* Converts an HTTP exception which happened while writing to the equivalent * Converts an HTTP exception which happened while writing to the equivalent
* local exception. * local exception.
*/ */
@SuppressWarnings("rawtypes") @SuppressWarnings("unchecked")
private void convertHttpExceptionForWrites( private void convertHttpExceptionForWrites(
Class entryClass, String message, HttpException cause) Class entryClass, String message, HttpException cause)
throws ParseException, IOException { throws ParseException, IOException {
@@ -253,7 +253,7 @@ public class SpreadsheetsClient extends GDataServiceClient {
/** /**
* Parses one entry from the input stream. * Parses one entry from the input stream.
*/ */
@SuppressWarnings("rawtypes") @SuppressWarnings("unchecked")
private Entry parseEntry(Class entryClass, InputStream is) private Entry parseEntry(Class entryClass, InputStream is)
throws ParseException, IOException { throws ParseException, IOException {
GDataParser parser = null; GDataParser parser = null;
@@ -48,7 +48,7 @@ public class XmlDocsGDataParserFactory implements GDataParserFactory {
} }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("unchecked")
@Override @Override
public GDataParser createParser(Class cls, InputStream is) public GDataParser createParser(Class cls, InputStream is)
throws ParseException { throws ParseException {
+1 -1
View File
@@ -3,7 +3,7 @@
package="com.google.android.apps.mytracks.samples.api" package="com.google.android.apps.mytracks.samples.api"
android:versionCode="1" android:versionCode="1"
android:versionName="1.0"> android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" /> <uses-sdk android:minSdkVersion="3"/>
<application android:icon="@drawable/icon" <application android:icon="@drawable/icon"
android:label="@string/app_name"> android:label="@string/app_name">
@@ -20,7 +20,7 @@ import android.os.Parcelable;
/** /**
* Statistical data about a trip. * Statistical data about a trip.
* The data in this class should be filled out by {@link TripStatisticsBuilder}. * The data in this class should be filled out by TripStatisticsBuilder.
* *
* TODO: hashCode and equals * TODO: hashCode and equals
* *
@@ -215,7 +215,7 @@ public class MyTracksTest extends ActivityInstrumentationTestCase2<MyTracks>{
} }
/** /**
* Clears {selected,recording}TrackId in the {@link getSharedPreferences()}. * Clears {selected,recording}TrackId in the {@link #getSharedPreferences()}.
*/ */
private void clearSelectedAndRecordingTracks() { private void clearSelectedAndRecordingTracks() {
Editor editor = getSharedPreferences().edit(); Editor editor = getSharedPreferences().edit();