merge heads

This commit is contained in:
Jimmy Shih
2013-01-16 15:17:27 -08:00
12 changed files with 320 additions and 283 deletions
+6 -4
View File
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<resources> <resources>
<!-- Keys for persisted preferences. Sorted alphabetically. DO NOT TRANSLATE. --> <!-- Keys for persisted preferences. Sorted alphabetically. DO NOT TRANSLATE. -->
<string name="allow_access_key">allowAccess</string> <string name="allow_access_key">allowAccess</string>
<string name="ant_bike_cadence_sensor_id_key">antBikeCadenceSensorId</string> <string name="ant_bike_cadence_sensor_id_key">antBikeCadenceSensorId</string>
@@ -30,9 +31,9 @@ limitations under the License.
<string name="chart_show_power_key">chartShowPower</string> <string name="chart_show_power_key">chartShowPower</string>
<string name="chart_show_speed_key">chartShowSpeed</string> <string name="chart_show_speed_key">chartShowSpeed</string>
<string name="default_activity_key">defaultActivity</string> <string name="default_activity_key">defaultActivity</string>
<string name="google_settings_account_key">googleSettingsAccount</string> <string name="default_map_public_key">defaultMapPublic</string>
<string name="google_settings_drive_sync_key">googleSettingsDriveSync</string> <string name="drive_sync_key">driveSync</string>
<string name="google_settings_maps_public_key">googleSettingsMapsPublic</string> <string name="google_account_key">googleAccount</string>
<string name="max_recording_distance_key">maxRecordingDistance</string> <string name="max_recording_distance_key">maxRecordingDistance</string>
<string name="metric_units_key">metricUnits</string> <string name="metric_units_key">metricUnits</string>
<string name="min_recording_distance_key">minRecordingDistance</string> <string name="min_recording_distance_key">minRecordingDistance</string>
@@ -69,11 +70,11 @@ limitations under the License.
<string name="selected_track_id_key">selectedTrackId</string> <string name="selected_track_id_key">selectedTrackId</string>
<!-- Keys for non-persisted preferences. Sorted alphabetically. DO NOT TRANSLATE. --> <!-- Keys for non-persisted preferences. Sorted alphabetically. DO NOT TRANSLATE. -->
<string name="google_settings_key">googleSettings</string>
<string name="settings_backup_key">settingsBackup</string> <string name="settings_backup_key">settingsBackup</string>
<string name="settings_backup_now_key">settingsBackupNow</string> <string name="settings_backup_now_key">settingsBackupNow</string>
<string name="settings_backup_restore_key">settingsBackupRestore</string> <string name="settings_backup_restore_key">settingsBackupRestore</string>
<string name="settings_chart_key">settingsChart</string> <string name="settings_chart_key">settingsChart</string>
<string name="settings_google_key">settingsGoogle</string>
<string name="settings_map_key">settingsMap</string> <string name="settings_map_key">settingsMap</string>
<string name="settings_map_medium_display_key">settingsMapMediumDisplay</string> <string name="settings_map_medium_display_key">settingsMapMediumDisplay</string>
<string name="settings_map_percentage_display_key">settingsMapPercentageDisplay</string> <string name="settings_map_percentage_display_key">settingsMapPercentageDisplay</string>
@@ -91,4 +92,5 @@ limitations under the License.
<string name="settings_sensor_root_key">settingsSensorRoot</string> <string name="settings_sensor_root_key">settingsSensorRoot</string>
<string name="settings_sharing_key">settingsSharing</string> <string name="settings_sharing_key">settingsSharing</string>
<string name="settings_stats_key">settingsStats</string> <string name="settings_stats_key">settingsStats</string>
</resources> </resources>
+132 -128
View File
@@ -378,7 +378,7 @@ limitations under the License.
<string name="description_activity_type" <string name="description_activity_type"
translation_description="Activity type description. translation_description="Activity type description.
%1$s activity type. E.g., 'hiking'"> %1$s activity type. E.g., 'hiking'.">
Activity type: %1$s Activity type: %1$s
</string> </string>
<string name="description_average_moving_pace" <string name="description_average_moving_pace"
@@ -493,7 +493,7 @@ limitations under the License.
<string name="description_moving_time" <string name="description_moving_time"
translation_description="Moving time description. translation_description="Moving time description.
%1$s time. E.g., '1:08:59'"> %1$s time. E.g., '1:08:59'.">
Moving time: %1$s Moving time: %1$s
</string> </string>
<string name="description_pace_imperial" <string name="description_pace_imperial"
@@ -507,7 +507,7 @@ limitations under the License.
<string name="description_recorded_time" <string name="description_recorded_time"
translation_description="Recorded time description. translation_description="Recorded time description.
%1$s time. E.g, '2/15/2012 1:40 PM'"> %1$s time. E.g., '2/15/2012 1:40 PM'.">
Recorded: %1$s Recorded: %1$s
</string> </string>
<string name="description_sensor_cadence" <string name="description_sensor_cadence"
@@ -544,7 +544,7 @@ limitations under the License.
<string name="description_total_time" <string name="description_total_time"
translation_description="Total time description. translation_description="Total time description.
%1$s time. E.g., '1:08:59'"> %1$s time. E.g., '1:08:59'.">
Total time: %1$s Total time: %1$s
</string> </string>
<string name="description_track_point" <string name="description_track_point"
@@ -719,61 +719,6 @@ limitations under the License.
Success Success
</string> </string>
<!-- Google Settings -->
<string name="google_settings_title"
translation_description="In the 'Settings' page, the option to change the Google settings.
Character limit: ~23 (1 line)">
Google
</string>
<string name="google_settings_account_title"
translation_description="In the 'Google' settings, the option to switch Google account.
Character limit: ~23 (1 line)">
Switch account
</string>
<string name="google_settings_drive_sync_title"
translation_description="In the 'Google' settings, the checkbox to sync tracks with Google
Drive.
Character limit: ~23 (1 line)">
Sync Google Drive
</string>
<string name="google_settings_drive_sync_summary_on"
translation_description="In the 'Google' settings, the summary for the 'Sync Google Drive'
checkbox when it is checked explaining that all tracks will be synced to a Google Drive
account.
%1$s account name. E.g., 'foo@foo.com'.">
All tracks will be synced to %1$s Google Drive
</string>
<string name="google_settings_maps_public_title"
translation_description="In the 'Google' settings, the checkbox to make new maps created in
Google Maps public instead of unlisted. See
http://support.google.com/maps/bin/answer.py?answer=144365 for public versus unlisted.
Character limit: ~23 (1 line)">
New maps public
</string>
<string name="google_settings_maps_public_summary_off"
translation_description="In the 'Google' settings, the summary for the 'New maps public'
checkbox when it is unchecked explaining that new maps created in Google Maps will be
unlisted, instead of public. See http://support.google.com/maps/bin/answer.py?answer=144365
for public versus unlisted.
%1$s url. E.g., 'support.google.com/maps/bin/answer.py?answer=144365'.">
New maps created in Google Maps will be unlisted, instead of public. See %1$s for more info.
</string>
<string name="google_settings_maps_public_summary_on"
translation_description="In the 'Google' settings, the summary for the 'New maps public'
checkbox when it is checked explaining that new maps created in Google Maps will be public,
instead of unlisted. See http://support.google.com/maps/bin/answer.py?answer=144365 for public
versus unlisted.
%1$s url. E.g., 'support.google.com/maps/bin/answer.py?answer=144365'.">
New maps created in Google Maps will be public, instead of unlisted. See %1$s for more info.
</string>
<!-- Gps --> <!-- Gps -->
<string name="gps_google_location_settings" <string name="gps_google_location_settings"
translation_description="In Android, the Google location settings to modify location settings translation_description="In Android, the Google location settings to modify location settings
@@ -1208,7 +1153,7 @@ limitations under the License.
translation_description="Under the import all menu option, the submenu option to import all translation_description="Under the import all menu option, the submenu option to import all
files of a certain file format. files of a certain file format.
%1$s: file format. e.g., 'GPX', 'KML' %1$s: file format. E.g., 'GPX'.
Character limit: ~20 (1 line)"> Character limit: ~20 (1 line)">
Import %1$s Import %1$s
</string> </string>
@@ -1447,7 +1392,7 @@ limitations under the License.
translation_description="For a marker returned in the search result, the text field indicating translation_description="For a marker returned in the search result, the text field indicating
the track that the marker belongs to. the track that the marker belongs to.
%1$s: track name. E.g., 'Grand Canyon trail'"> %1$s: track name. E.g., 'Grand Canyon trail'.">
In track \'%1$s\'. In track \'%1$s\'.
</string> </string>
<string name="search_voice_prompt" <string name="search_voice_prompt"
@@ -1555,9 +1500,9 @@ limitations under the License.
</string> </string>
<string name="send_google_track_part_label" <string name="send_google_track_part_label"
translation_description="When sending a track to Google, the label to name segments of a large translation_description="When sending a track to Google, the label to name segments of a large
track. E.g., 'track_name (Part 1)' track. E.g., 'track_name (Part 1)'.
%1$s: track name. E.g., 'track_name' %1$s: track name. E.g., 'track_name'.
%2$d: part number. E.g., '1'."> %2$d: part number. E.g., '1'.">
%1$s (Part %2$d) %1$s (Part %2$d)
</string> </string>
@@ -1565,7 +1510,7 @@ limitations under the License.
<!-- Sensor State --> <!-- Sensor State -->
<string name="sensor_state_battery" <string name="sensor_state_battery"
translation_description="In the 'Sensor state' page, the label for the battery level on the bike translation_description="In the 'Sensor state' page, the label for the battery level on the bike
sensor. E.g, 'Battery level: 50 %'."> sensor. E.g., 'Battery level: 50 %'.">
Battery level Battery level
</string> </string>
<string name="sensor_state_cadence" <string name="sensor_state_cadence"
@@ -1749,70 +1694,129 @@ limitations under the License.
X axis X axis
</string> </string>
<!-- Settings Google -->
<string name="settings_google"
translation_description="In the 'Settings' page, the option to change the Google settings.
Character limit: ~23 (1 line)">
Google
</string>
<string name="settings_google_account_title"
translation_description="In the 'Google' settings, the option to switch Google account.
Character limit: ~23 (1 line)">
Switch account
</string>
<string name="settings_google_drive_sync_summary_on"
translation_description="In the 'Google' settings, the summary for the 'Sync Google Drive'
checkbox when it is checked explaining that all tracks will be synced to a Google Drive
account.
%1$s account name. E.g., 'foo@foo.com'.">
All tracks will be synced to %1$s Google Drive
</string>
<string name="settings_google_drive_sync_title"
translation_description="In the 'Google' settings, the checkbox to sync tracks with Google
Drive.
Character limit: ~23 (1 line)">
Sync Google Drive
</string>
<string name="settings_google_maps_public_summary_off"
translation_description="In the 'Google' settings, the summary for the 'New maps public'
checkbox when it is unchecked explaining that new maps created in Google Maps will be
unlisted, instead of public. See http://support.google.com/maps/bin/answer.py?answer=144365
for public versus unlisted.
%1$s url. E.g., 'support.google.com/maps/bin/answer.py?answer=144365'.">
New maps created in Google Maps will be unlisted, instead of public. See %1$s for more info.
</string>
<string name="settings_google_maps_public_summary_on"
translation_description="In the 'Google' settings, the summary for the 'New maps public'
checkbox when it is checked explaining that new maps created in Google Maps will be public,
instead of unlisted. See http://support.google.com/maps/bin/answer.py?answer=144365 for public
versus unlisted.
%1$s url. E.g., 'support.google.com/maps/bin/answer.py?answer=144365'.">
New maps created in Google Maps will be public, instead of unlisted. See %1$s for more info.
</string>
<string name="settings_google_maps_public_title"
translation_description="In the 'Google' settings, the checkbox to make new maps created in
Google Maps public instead of unlisted. See
http://support.google.com/maps/bin/answer.py?answer=144365 for public versus unlisted.
Character limit: ~23 (1 line)">
New maps public
</string>
<!-- Settings Map --> <!-- Settings Map -->
<string name="settings_map_medium" <string name="settings_map_medium"
translation_description="In the 'Map' settings, under the 'Fixed thresholds' configurations, the translation_description="In the 'Map' settings, under the 'Fixed thresholds' section, the option
option for configuring the top medium speed. to configure the top medium speed.
Character limit: ~23 (1 line)"> Character limit: ~23 (1 line)">
Top medium speed Top medium speed
</string> </string><string name="settings_map_percentage"
<string name="settings_map_percentage" translation_description="In the 'Map' settings, under the 'Dynamic thresholds' section, the
translation_description="In the 'Map' settings, under the 'Dynamic thresholds' configurations, option to configure the medium speed range as a percentage from the average speed.
the option for configuring the percentage from the average speed for the medium speed range.
Character limit: ~23 (1 line)"> Character limit: ~23 (1 line)">
Percentage from average Percentage from average
</string> </string>
<string name="settings_map_percentage_summary" <string name="settings_map_percentage_summary"
translation_description="In the 'Map' settings, under the 'Dynamic thresholds' configurations, translation_description="In the 'Map' settings, under the 'Dynamic thresholds' section, the
the summary for the 'Percentage from average' option explaining that it sets the percentage summary for the 'Percentage from average' option explaining that the medium speed range is set
from the average speed for the medium speed range. The 'Dynamic thresholds' track color mode as a percentage from the average speed.
uses different colors to color a track depending on whether the speed is above, in, or below
the medium speed range."> %1$d: an integer value. E.g., '15'.">
Percentage from the average speed for the medium speed range. The medium speed range is %1$d %% from the average speed
</string> </string>
<string name="settings_map_slow" <string name="settings_map_slow"
translation_description="In the 'Map' settings, under the 'Fixed thresholds' configurations, the translation_description="In the 'Map' settings, under the 'Fixed thresholds' section, the option
option for configuring the top slow speed. to configure the top slow speed.
Character limit: ~23 (1 line)"> Character limit: ~23 (1 line)">
Top slow speed Top slow speed
</string> </string>
<string name="settings_map_track_color_mode" <string name="settings_map_track_color_mode"
translation_description="In the 'Map' settings, the option to select a track color mode for how translation_description="In the 'Map' settings, the picker to select how track color is
to use different colors to color a track based on slow, medium, and fast speed. configured.
Character limit: ~23 (1 line)"> Character limit: ~23 (1 line)">
Track color Track color
</string> </string><string name="settings_map_track_color_mode_dynamic"
<string name="settings_map_track_color_mode_dynamic" translation_description="In the 'Map' settings, for the 'Track color' picker, the option to use
translation_description="In the 'Map' settings, for the 'Track color mode' dropdown, the option dynamic thresholds to set slow, medium, and fast speed when coloring a track based on speed.
to use different colors to color a track based on dynamically determined speed thresholds.
Character limit: ~20 (1 line)"> Character limit: ~20 (1 line)">
Dynamic thresholds Dynamic thresholds
</string> </string>
<string name="settings_map_track_color_mode_dynamic_summary"
translation_description="In the 'Map' settings, the summary for the 'Track color' picker when
the 'Dynamic thresholds' is selected explaining that it uses dynamic thresholds to set slow,
medium, and fast speed when coloring a track based on speed.">
Use dynamic thresholds to set slow, medium, and fast speed when coloring a track based on speed
</string>
<string name="settings_map_track_color_mode_fixed" <string name="settings_map_track_color_mode_fixed"
translation_description="In the 'Map' settings, for the 'Track color mode' dropdown, the option translation_description="In the 'Map' settings, for the 'Track color' picker, the option to use
to use different colors to color a track based on fixed speed thresholds. fixed thresholds to set slow, medium, and fast speed when coloring a track based on speed.
Character limit: ~20 (1 line)"> Character limit: ~20 (1 line)">
Fixed thresholds Fixed thresholds
</string> </string>
<string name="settings_map_track_color_mode_fixed_summary"
translation_description="In the 'Map' settings, the summary for the 'Track color' picker when
the 'Fixed thresholds' is selected explaining that it uses fixed thresholds to set slow,
medium, and fast speed when coloring a track based on speed.">
Use fixed thresholds to set slow, medium, and fast speed when coloring a track based on speed
</string>
<string name="settings_map_track_color_mode_single" <string name="settings_map_track_color_mode_single"
translation_description="In the 'Map' settings, for the 'Track color mode' dropdown, the option translation_description="In the 'Map' settings, for the 'Track color' picker, the option to use
to use a single color for all speeds. a single color to color a track.
Character limit: ~20 (1 line)"> Character limit: ~20 (1 line)">
Single color Single color
</string> </string>
<string name="settings_map_track_color_mode_summary"
translation_description="In the 'Map' settings, the summary for the 'Track color mode' option
explaining that it configures how colors are used to color a track based on slow, medium, and
fast speed.">
The way to color a track based on slow, medium, and fast speed.
</string>
<!-- Settings Recording --> <!-- Settings Recording -->
<string name="settings_recording" <string name="settings_recording"
@@ -2211,7 +2215,7 @@ limitations under the License.
translation_description="When sharing a track URL with friends, the body of the message. Note translation_description="When sharing a track URL with friends, the body of the message. Note
that \n is the newline character. that \n is the newline character.
%1$s: url. E.g, 'https://maps.google.com/maps'. %1$s: url. E.g., 'https://maps.google.com/maps'.
%2$s: track description."> %2$s: track description.">
I think you might be interested in this track:\n\n%1$s\n\n%2$s I think you might be interested in this track:\n\n%1$s\n\n%2$s
</string> </string>
@@ -2449,7 +2453,7 @@ limitations under the License.
km km
</string> </string>
<string name="unit_kilometer_per_hour" <string name="unit_kilometer_per_hour"
translation_description="Abbreviation for kilometers per hour. E.g, '5 km/h'."> translation_description="Abbreviation for kilometers per hour. E.g., '5 km/h'.">
km/h km/h
</string> </string>
<string name="unit_meter" <string name="unit_meter"
@@ -2461,15 +2465,15 @@ limitations under the License.
mi mi
</string> </string>
<string name="unit_mile_per_hour" <string name="unit_mile_per_hour"
translation_description="Abbreviation for miles per hour. E.g, '5 mi/h'."> translation_description="Abbreviation for miles per hour. E.g., '5 mi/h'.">
mi/h mi/h
</string> </string>
<string name="unit_minute_per_kilometer" <string name="unit_minute_per_kilometer"
translation_description="Abbreviation for minutes per kilometer. E.g, '5 min/km'."> translation_description="Abbreviation for minutes per kilometer. E.g., '5 min/km'.">
min/km min/km
</string> </string>
<string name="unit_minute_per_mile" <string name="unit_minute_per_mile"
translation_description="Abbreviation for minutes per mile. E.g, '5 min/mi'."> translation_description="Abbreviation for minutes per mile. E.g., '5 min/mi'.">
min/mi min/mi
</string> </string>
@@ -2488,160 +2492,160 @@ limitations under the License.
</string> </string>
<string name="value_coordinate_degree" <string name="value_coordinate_degree"
translation_description="To display a latitude or longitude coordinate in degree. E.g., translation_description="To display a latitude or longitude coordinate in degree. E.g.,
2.2 \u00B0. \u00B0 is the unicode value for the degree symbol. '2.2 \u00B0'. \u00B0 is the unicode value for the degree symbol.
%1$s: a string value of the coordinate. E.g., '2.2'"> %1$s: a string value of the coordinate. E.g., '2.2'.">
%1$s \u00B0 %1$s \u00B0
</string> </string>
<string name="value_float_feet" <string name="value_float_feet"
translation_description="Display a float value in feet (ft). translation_description="Display a float value in feet (ft).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f ft %1$.2f ft
</string> </string>
<string name="value_float_kilometer" <string name="value_float_kilometer"
translation_description="Display a float value in kilometers (km). translation_description="Display a float value in kilometers (km).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f km %1$.2f km
</string> </string>
<string name="value_float_kilometer_hour" <string name="value_float_kilometer_hour"
translation_description="Display a float value in kilometers per hour (km/h). translation_description="Display a float value in kilometers per hour (km/h).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f km/h %1$.2f km/h
</string> </string>
<string name="value_float_meter" <string name="value_float_meter"
translation_description="Display a float value in meters (m). translation_description="Display a float value in meters (m).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f m %1$.2f m
</string> </string>
<string name="value_float_mile" <string name="value_float_mile"
translation_description="Display a float value in miles (mi). translation_description="Display a float value in miles (mi).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f mi %1$.2f mi
</string> </string>
<string name="value_float_mile_hour" <string name="value_float_mile_hour"
translation_description="Display a float value in miles per hour (mi/h). translation_description="Display a float value in miles per hour (mi/h).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f mi/h %1$.2f mi/h
</string> </string>
<string name="value_float_mile_poor_gps" <string name="value_float_mile_poor_gps"
translation_description="In a setting picker, the string format to display a float value in translation_description="In a setting picker, the string format to display a float value in
miles (mi), recommended when having poor GPS signal. miles (mi), recommended when having poor GPS signal.
%1$.1f: a float number. E.g., '2.2'"> %1$.1f: a float number. E.g., '2.2'.">
%1$.1f mi (poor GPS) %1$.1f mi (poor GPS)
</string> </string>
<string name="value_float_minute_kilometer" <string name="value_float_minute_kilometer"
translation_description="Display a float value in minutes per kilometer (min/km). translation_description="Display a float value in minutes per kilometer (min/km).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f min/km %1$.2f min/km
</string> </string>
<string name="value_float_minute_mile" <string name="value_float_minute_mile"
translation_description="Display a float value in minutes per mile (min/mi). translation_description="Display a float value in minutes per mile (min/mi).
%1$.2f: a float number. E.g., '2.22'"> %1$.2f: a float number. E.g., '2.22'.">
%1$.2f min/mi %1$.2f min/mi
</string> </string>
<string name="value_integer_feet" <string name="value_integer_feet"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
feet (ft). feet (ft).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d ft %1$d ft
</string> </string>
<string name="value_integer_feet_excellent_gps" <string name="value_integer_feet_excellent_gps"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
feet (ft), recommended when having excellent GPS signal. feet (ft), recommended when having excellent GPS signal.
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d ft (excellent GPS) %1$d ft (excellent GPS)
</string> </string>
<string name="value_integer_feet_recommended" <string name="value_integer_feet_recommended"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
feet (ft) and that the value is the recommended value. feet (ft) and that the value is the recommended value.
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d ft (recommended) %1$d ft (recommended)
</string> </string>
<string name="value_integer_kilometer" <string name="value_integer_kilometer"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
kilometers (km). kilometers (km).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d km %1$d km
</string> </string>
<string name="value_integer_kilometer_hour" <string name="value_integer_kilometer_hour"
translation_description="Display an integer value in kilometers per hour (km/h). translation_description="Display an integer value in kilometers per hour (km/h).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d km/h %1$d km/h
</string> </string>
<string name="value_integer_meter" <string name="value_integer_meter"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
meters (m). meters (m).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d m %1$d m
</string> </string>
<string name="value_integer_meter_excellent_gps" <string name="value_integer_meter_excellent_gps"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
meters (m), recommended when having excellent GPS signal. meters (m), recommended when having excellent GPS signal.
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d m (excellent GPS) %1$d m (excellent GPS)
</string> </string>
<string name="value_integer_meter_poor_gps" <string name="value_integer_meter_poor_gps"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
meters (m), recommended when having poor GPS signal. meters (m), recommended when having poor GPS signal.
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d m (poor GPS) %1$d m (poor GPS)
</string> </string>
<string name="value_integer_meter_recommended" <string name="value_integer_meter_recommended"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
meters (m) and that the value is the recommended value. meters (m) and that the value is the recommended value.
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d m (recommended) %1$d m (recommended)
</string> </string>
<string name="value_integer_mile" <string name="value_integer_mile"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
miles (mi). miles (mi).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d mi %1$d mi
</string> </string>
<string name="value_integer_mile_hour" <string name="value_integer_mile_hour"
translation_description="Display an integer value in miles per hour (mi/h). translation_description="Display an integer value in miles per hour (mi/h).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d mi/h %1$d mi/h
</string> </string>
<string name="value_integer_minute" <string name="value_integer_minute"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
minutes (min). minutes (min).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d min %1$d min
</string> </string>
<string name="value_integer_percent" <string name="value_integer_percent"
translation_description="To display a value in percent like 2 %. %% is the escape sequence for translation_description="To display a value in percent like 2 %. %% is the escape sequence for
the percent symbol. the percent symbol.
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d %% %1$d %%
</string> </string>
<string name="value_integer_second" <string name="value_integer_second"
translation_description="In a setting picker, the string format to display an integer value in translation_description="In a setting picker, the string format to display an integer value in
seconds (s). seconds (s).
%1$d: an integer value. E.g., '2'"> %1$d: an integer value. E.g., '2'.">
%1$d s %1$d s
</string> </string>
<string name="value_never" <string name="value_never"
@@ -2835,10 +2839,10 @@ limitations under the License.
<string name="voice_template" <string name="voice_template"
translation_description="For the voice announcement, the template to make an announcement. translation_description="For the voice announcement, the template to make an announcement.
%1$s: distance string. E.g., '1 mile' or '1.2 miles', '1 kilometer', '2.2 kilometers' %1$s: distance string. E.g., '2.2 kilometers'.
%2$s: time string. E.g., '1 hour and 30 minutes' or '20 minutes 1 second' %2$s: time string. E.g., '20 minutes 1 second'.
%3$s: speed/pace string. For speed, e.g., '2.2 miles per hour', '1 kilometer per hour'. For %3$s: speed/pace string. E.g., '2.2 miles per hour' for speed and
pace, e.g., '2 hours 1 minute per mile', '30 minutes 1 second per kilometer'."> '30 minutes 1 second per kilometer' for pace.">
My Tracks %1$s in %2$s at %3$s. My Tracks %1$s in %2$s at %3$s.
</string> </string>
<string name="voice_total_distance_kilometers_few" <string name="voice_total_distance_kilometers_few"
+7 -7
View File
@@ -15,17 +15,17 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/google_settings_title" > android:title="@string/settings_google" >
<ListPreference <ListPreference
android:defaultValue="" android:defaultValue=""
android:key="@string/google_settings_account_key" android:key="@string/google_account_key"
android:title="@string/google_settings_account_title" /> android:title="@string/settings_google_account_title" />
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="@string/google_settings_drive_sync_key" android:key="@string/drive_sync_key"
android:title="@string/google_settings_drive_sync_title" /> android:title="@string/settings_google_drive_sync_title" />
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="@string/google_settings_maps_public_key" android:key="@string/default_map_public_key"
android:title="@string/google_settings_maps_public_title" /> android:title="@string/settings_google_maps_public_title" />
</PreferenceScreen> </PreferenceScreen>
+2 -2
View File
@@ -17,9 +17,9 @@ limitations under the License.
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/menu_settings" > android:title="@string/menu_settings" >
<Preference <Preference
android:key="@string/google_settings_key" android:key="@string/settings_google_key"
android:persistent="false" android:persistent="false"
android:title="@string/google_settings_title" /> android:title="@string/settings_google" />
<Preference <Preference
android:key="@string/settings_map_key" android:key="@string/settings_map_key"
android:persistent="false" android:persistent="false"
@@ -98,7 +98,7 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
RadioButton newMapRadioButton = (RadioButton) view.findViewById( RadioButton newMapRadioButton = (RadioButton) view.findViewById(
R.id.choose_upload_service_new_map); R.id.choose_upload_service_new_map);
boolean defaultMapPublic = PreferencesUtils.getBoolean(activity, boolean defaultMapPublic = PreferencesUtils.getBoolean(activity,
R.string.google_settings_maps_public_key, PreferencesUtils.GOOGLE_SETTINGS_MAPS_PUBLIC_DEFAULT); R.string.default_map_public_key, PreferencesUtils.DEFAULT_MAP_PUBLIC_DEFAULT);
newMapRadioButton.setText(defaultMapPublic ? R.string.send_google_new_public_map newMapRadioButton.setText(defaultMapPublic ? R.string.send_google_new_public_map
: R.string.send_google_new_unlisted_map); : R.string.send_google_new_unlisted_map);
@@ -223,7 +223,7 @@ public class SendMapsAsyncTask extends AbstractSendAsyncTask {
return true; return true;
} else { } else {
boolean defaultMapPublic = PreferencesUtils.getBoolean( boolean defaultMapPublic = PreferencesUtils.getBoolean(
context, R.string.google_settings_maps_public_key, PreferencesUtils.GOOGLE_SETTINGS_MAPS_PUBLIC_DEFAULT); context, R.string.default_map_public_key, PreferencesUtils.DEFAULT_MAP_PUBLIC_DEFAULT);
try { try {
String description = track.getCategory() + "\n" + track.getDescription() + "\n" String description = track.getCategory() + "\n" + track.getDescription() + "\n"
+ context.getString(R.string.send_google_by_my_tracks, "", ""); + context.getString(R.string.send_google_by_my_tracks, "", "");
@@ -91,13 +91,13 @@ public class AccountChooserActivity extends Activity {
if (accounts.length == 1) { if (accounts.length == 1) {
sendRequest.setAccount(accounts[0]); sendRequest.setAccount(accounts[0]);
PreferencesUtils.setString(this, R.string.google_settings_account_key, accounts[0].name); PreferencesUtils.setString(this, R.string.google_account_key, accounts[0].name);
getPermission(MapsConstants.SERVICE_NAME, sendRequest.isSendMaps(), mapsCallback); getPermission(MapsConstants.SERVICE_NAME, sendRequest.isSendMaps(), mapsCallback);
return; return;
} }
String googleAccount = PreferencesUtils.getString(this, R.string.google_settings_account_key, String googleAccount = PreferencesUtils.getString(this, R.string.google_account_key,
PreferencesUtils.GOOGLE_SETTINGS_ACCOUNT_DEFAULT); PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT);
for (int i = 0; i < accounts.length; i++) { for (int i = 0; i < accounts.length; i++) {
if (accounts[i].name.equals(googleAccount)) { if (accounts[i].name.equals(googleAccount)) {
sendRequest.setAccount(accounts[i]); sendRequest.setAccount(accounts[i]);
@@ -161,7 +161,7 @@ public class AccountChooserActivity extends Activity {
int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition();
Account account = accounts[position]; Account account = accounts[position];
PreferencesUtils.setString( PreferencesUtils.setString(
AccountChooserActivity.this, R.string.google_settings_account_key, account.name); AccountChooserActivity.this, R.string.google_account_key, account.name);
sendRequest.setAccount(account); sendRequest.setAccount(account);
getPermission(MapsConstants.SERVICE_NAME, sendRequest.isSendMaps(), mapsCallback); getPermission(MapsConstants.SERVICE_NAME, sendRequest.isSendMaps(), mapsCallback);
} }
@@ -125,6 +125,28 @@ public class AbstractSettingsActivity extends PreferenceActivity {
} }
} }
protected void configurePreference(final Preference preference, final String[] options,
final String[] values, String value, final OnPreferenceChangeListener listener) {
if (options != null) {
((ListPreference) preference).setEntries(options);
}
if (values != null) {
((ListPreference) preference).setEntryValues(values);
}
preference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference pref, Object newValue) {
if (listener != null) {
listener.onPreferenceChange(pref, newValue);
}
return true;
}
});
if (listener != null) {
listener.onPreferenceChange(preference, value);
}
}
/** /**
* Updates a preference when a stored value changes. * Updates a preference when a stored value changes.
* *
@@ -38,8 +38,8 @@ import java.util.List;
*/ */
public class GoogleSettingsActivity extends AbstractSettingsActivity { public class GoogleSettingsActivity extends AbstractSettingsActivity {
private ListPreference googleSettingsAccount; private ListPreference googleAccount;
private CheckBoxPreference settingsGoogleDriveSync; private CheckBoxPreference driveSync;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Override @Override
@@ -47,8 +47,8 @@ public class GoogleSettingsActivity extends AbstractSettingsActivity {
super.onCreate(bundle); super.onCreate(bundle);
addPreferencesFromResource(R.xml.google_settings); addPreferencesFromResource(R.xml.google_settings);
googleSettingsAccount = (ListPreference) findPreference( googleAccount = (ListPreference) findPreference(
getString(R.string.google_settings_account_key)); getString(R.string.google_account_key));
List<String> entries = new ArrayList<String>(); List<String> entries = new ArrayList<String>();
List<String> entryValues = new ArrayList<String>(); List<String> entryValues = new ArrayList<String>();
Account[] accounts = AccountManager.get(this).getAccountsByType(Constants.ACCOUNT_TYPE); Account[] accounts = AccountManager.get(this).getAccountsByType(Constants.ACCOUNT_TYPE);
@@ -57,11 +57,11 @@ public class GoogleSettingsActivity extends AbstractSettingsActivity {
entryValues.add(account.name); entryValues.add(account.name);
} }
entries.add(getString(R.string.value_none)); entries.add(getString(R.string.value_none));
entryValues.add(PreferencesUtils.GOOGLE_SETTINGS_ACCOUNT_DEFAULT); entryValues.add(PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT);
googleSettingsAccount.setEntries(entries.toArray(new CharSequence[entries.size()])); googleAccount.setEntries(entries.toArray(new CharSequence[entries.size()]));
googleSettingsAccount.setEntryValues(entryValues.toArray(new CharSequence[entries.size()])); googleAccount.setEntryValues(entryValues.toArray(new CharSequence[entries.size()]));
googleSettingsAccount.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { googleAccount.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object newValue) {
updateUi((String) newValue, true); updateUi((String) newValue, true);
@@ -69,19 +69,19 @@ public class GoogleSettingsActivity extends AbstractSettingsActivity {
} }
}); });
settingsGoogleDriveSync = (CheckBoxPreference) findPreference( driveSync = (CheckBoxPreference) findPreference(
getString(R.string.google_settings_drive_sync_key)); getString(R.string.drive_sync_key));
CheckBoxPreference settingsGoogleMapsPublic = (CheckBoxPreference) findPreference( CheckBoxPreference settingsGoogleMapsPublic = (CheckBoxPreference) findPreference(
getString(R.string.google_settings_maps_public_key)); getString(R.string.default_map_public_key));
settingsGoogleMapsPublic.setSummaryOn(getString(R.string.google_settings_maps_public_summary_on, settingsGoogleMapsPublic.setSummaryOn(getString(R.string.settings_google_maps_public_summary_on,
getString(R.string.maps_public_unlisted_url))); getString(R.string.maps_public_unlisted_url)));
settingsGoogleMapsPublic.setSummaryOff(getString( settingsGoogleMapsPublic.setSummaryOff(getString(
R.string.google_settings_maps_public_summary_off, R.string.settings_google_maps_public_summary_off,
getString(R.string.maps_public_unlisted_url))); getString(R.string.maps_public_unlisted_url)));
String account = PreferencesUtils.getString(this, R.string.google_settings_account_key, String account = PreferencesUtils.getString(this, R.string.google_account_key,
PreferencesUtils.GOOGLE_SETTINGS_ACCOUNT_DEFAULT); PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT);
updateUi(account, false); updateUi(account, false);
} }
@@ -92,15 +92,15 @@ public class GoogleSettingsActivity extends AbstractSettingsActivity {
* @param uncheckDriveSync true to uncheck drive sync * @param uncheckDriveSync true to uncheck drive sync
*/ */
private void updateUi(String account, boolean uncheckDriveSync) { private void updateUi(String account, boolean uncheckDriveSync) {
googleSettingsAccount.setSummary(PreferencesUtils.GOOGLE_SETTINGS_ACCOUNT_DEFAULT.equals( googleAccount.setSummary(PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT.equals(
account) ? getString(R.string.value_unknown) account) ? getString(R.string.value_unknown)
: account); : account);
boolean hasAccount = !PreferencesUtils.GOOGLE_SETTINGS_ACCOUNT_DEFAULT.equals(account); boolean hasAccount = !PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT.equals(account);
settingsGoogleDriveSync.setEnabled(hasAccount); driveSync.setEnabled(hasAccount);
settingsGoogleDriveSync.setSummaryOn( driveSync.setSummaryOn(
getString(R.string.google_settings_drive_sync_summary_on, account)); getString(R.string.settings_google_drive_sync_summary_on, account));
if (uncheckDriveSync) { if (uncheckDriveSync) {
settingsGoogleDriveSync.setChecked(false); driveSync.setChecked(false);
} }
} }
} }
@@ -41,9 +41,10 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
private static final String TAG = MapSettingsActivity.class.getSimpleName(); private static final String TAG = MapSettingsActivity.class.getSimpleName();
private EditTextPreference slowEditTextPreference; private ListPreference trackColorModePreference;
private EditTextPreference mediumEditTextPreference; private EditTextPreference slowPreference;
private EditTextPreference percentageEditTextPreference; private EditTextPreference mediumPreference;
private EditTextPreference percentagePreference;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Override @Override
@@ -51,15 +52,33 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
super.onCreate(bundle); super.onCreate(bundle);
addPreferencesFromResource(R.xml.map_settings); addPreferencesFromResource(R.xml.map_settings);
slowEditTextPreference = (EditTextPreference) findPreference( trackColorModePreference = (ListPreference) findPreference(
getString(R.string.track_color_mode_key));
slowPreference = (EditTextPreference) findPreference(
getString(R.string.settings_map_slow_display_key)); getString(R.string.settings_map_slow_display_key));
mediumEditTextPreference = (EditTextPreference) findPreference( mediumPreference = (EditTextPreference) findPreference(
getString(R.string.settings_map_medium_display_key)); getString(R.string.settings_map_medium_display_key));
percentageEditTextPreference = (EditTextPreference) findPreference( percentagePreference = (EditTextPreference) findPreference(
getString(R.string.settings_map_percentage_display_key)); getString(R.string.settings_map_percentage_display_key));
ListPreference trackColorModeListPreference = (ListPreference) findPreference( configTrackColorModePerference();
getString(R.string.track_color_mode_key)); configSpeedPreference(slowPreference, R.string.track_color_mode_slow_key,
PreferencesUtils.TRACK_COLOR_MODE_SLOW_DEFAULT);
configSpeedPreference(mediumPreference, R.string.track_color_mode_medium_key,
PreferencesUtils.TRACK_COLOR_MODE_MEDIUM_DEFAULT);
configPercentagePreference();
updateSpeedSummary(slowPreference, R.string.track_color_mode_slow_key,
PreferencesUtils.TRACK_COLOR_MODE_SLOW_DEFAULT);
updateSpeedSummary(mediumPreference, R.string.track_color_mode_medium_key,
PreferencesUtils.TRACK_COLOR_MODE_MEDIUM_DEFAULT);
updatePercentageSummary();
}
/**
* Configures the track color mode preference.
*/
private void configTrackColorModePerference() {
OnPreferenceChangeListener listener = new OnPreferenceChangeListener() { OnPreferenceChangeListener listener = new OnPreferenceChangeListener() {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object newValue) {
@@ -67,52 +86,61 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
return true; return true;
} }
}; };
String trackColorModeValue = PreferencesUtils.getString( String trackColorMode = PreferencesUtils.getString(
this, R.string.track_color_mode_key, PreferencesUtils.TRACK_COLOR_MODE_DEFAULT); this, R.string.track_color_mode_key, PreferencesUtils.TRACK_COLOR_MODE_DEFAULT);
configurePreference(trackColorModeListPreference, configurePreference(trackColorModePreference,
getResources().getStringArray(R.array.track_color_mode_options), getResources().getStringArray(R.array.track_color_mode_options),
getResources().getStringArray(R.array.track_color_mode_values), getResources().getStringArray(R.array.track_color_mode_values), trackColorMode, listener);
R.string.settings_map_track_color_mode_summary, trackColorModeValue, listener);
configureSpeedEditTextPreference(R.string.track_color_mode_slow_key);
configureSpeedEditTextPreference(R.string.track_color_mode_medium_key);
configurePercentageEditTextPreference();
updatePercentageSummary();
} }
/** /**
* Configures the speed edit text preference. * Configures the speed preference.
* *
* @param keyId the key id * @param preference the preference
* @param key the key
* @param defaultValue the default value
*/ */
private void configureSpeedEditTextPreference(final int keyId) { private void configSpeedPreference(
final EditTextPreference editTextPreference = keyId == R.string.track_color_mode_slow_key ? slowEditTextPreference EditTextPreference preference, final int key, final int defaultValue) {
: mediumEditTextPreference; preference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
editTextPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference pref, Object newValue) {
storeSpeedValue(keyId, (String) newValue);
updateSpeedSummary(keyId); // Need to obtain the current min and max values
int minValue;
int maxValue;
if (key == R.string.track_color_mode_slow_key) {
minValue = 0;
maxValue = PreferencesUtils.getInt(
MapSettingsActivity.this, R.string.track_color_mode_medium_key,
PreferencesUtils.TRACK_COLOR_MODE_MEDIUM_DEFAULT);
} else {
minValue = PreferencesUtils.getInt(
MapSettingsActivity.this, R.string.track_color_mode_slow_key,
PreferencesUtils.TRACK_COLOR_MODE_SLOW_DEFAULT);
maxValue = Integer.MAX_VALUE;
}
storeSpeedValue(key, minValue, maxValue, defaultValue, (String) newValue);
updateSpeedSummary(pref, key, defaultValue);
return true; return true;
} }
}); });
editTextPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() { preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference pref) {
int value = getSpeedDisplayValue(keyId); int value = getSpeedDisplayValue(key, defaultValue);
((EditTextPreference) preference).getEditText().setText(String.valueOf(value)); ((EditTextPreference) pref).getEditText().setText(String.valueOf(value));
return true; return true;
} }
}); });
configureImeActionDone(editTextPreference); configImeActionDone(preference);
} }
/** /**
* Configures the percentage edit text preference. * Configures the percentage preference.
*/ */
private void configurePercentageEditTextPreference() { private void configPercentagePreference() {
percentageEditTextPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { percentagePreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object newValue) {
String displayValue = (String) newValue; String displayValue = (String) newValue;
@@ -132,7 +160,7 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
return true; return true;
} }
}); });
percentageEditTextPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() { percentagePreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
int value = PreferencesUtils.getInt( int value = PreferencesUtils.getInt(
@@ -142,7 +170,7 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
return true; return true;
} }
}); });
configureImeActionDone(percentageEditTextPreference); configImeActionDone(percentagePreference);
} }
/** /**
@@ -150,7 +178,7 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
* *
* @param editTextPreference the edit text preference * @param editTextPreference the edit text preference
*/ */
private void configureImeActionDone(final EditTextPreference editTextPreference) { private void configImeActionDone(final EditTextPreference editTextPreference) {
editTextPreference.getEditText() editTextPreference.getEditText()
.setOnEditorActionListener(new TextView.OnEditorActionListener() { .setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override @Override
@@ -166,13 +194,6 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
}); });
} }
@Override
protected void onResume() {
super.onResume();
updateSpeedSummary(R.string.track_color_mode_slow_key);
updateSpeedSummary(R.string.track_color_mode_medium_key);
}
/** /**
* Updates the UI by the track color mode. * Updates the UI by the track color mode.
* *
@@ -183,32 +204,54 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
getString(R.string.settings_map_track_color_mode_fixed_value)); getString(R.string.settings_map_track_color_mode_fixed_value));
boolean isDynamicValue = trackColorMode.equals( boolean isDynamicValue = trackColorMode.equals(
getString(R.string.settings_map_track_color_mode_dynamic_value)); getString(R.string.settings_map_track_color_mode_dynamic_value));
slowEditTextPreference.setEnabled(isFixedValue); if (isDynamicValue) {
mediumEditTextPreference.setEnabled(isFixedValue); trackColorModePreference.setSummary(R.string.settings_map_track_color_mode_dynamic_summary);
percentageEditTextPreference.setEnabled(isDynamicValue); } else if (isFixedValue) {
trackColorModePreference.setSummary(R.string.settings_map_track_color_mode_fixed_summary);
} else {
trackColorModePreference.setSummary(R.string.settings_map_track_color_mode_single);
}
slowPreference.setEnabled(isFixedValue);
mediumPreference.setEnabled(isFixedValue);
percentagePreference.setEnabled(isDynamicValue);
} }
/** /**
* Stores the speed value, always in metric units. * Updates a speed summary.
*
* @param preference the preference
* @param keyId the key id
* @param defaultValue the default value
*/
private void updateSpeedSummary(Preference preference, int keyId, int defaultValue) {
boolean metric = PreferencesUtils.getBoolean(
this, R.string.metric_units_key, PreferencesUtils.METRIC_UNITS_DEFAULT);
int displayValue = getSpeedDisplayValue(keyId, defaultValue);
preference.setSummary(getString(
metric ? R.string.value_integer_kilometer_hour : R.string.value_integer_mile_hour,
displayValue));
}
/**
* Updates the percentage summary.
*/
private void updatePercentageSummary() {
int value = PreferencesUtils.getInt(this, R.string.track_color_mode_percentage_key,
PreferencesUtils.TRACK_COLOR_MODE_PERCENTAGE_DEFAULT);
percentagePreference.setSummary(getString(R.string.settings_map_percentage_summary, value));
}
/**
* Stores a speed value, always in metric units.
* *
* @param keyId the key id * @param keyId the key id
* @param minValue the min value
* @param maxValue the max value
* @param defaultValue the default value
* @param displayValue the display value * @param displayValue the display value
*/ */
private void storeSpeedValue(int keyId, String displayValue) { private void storeSpeedValue(
int maxValue; int keyId, int minValue, int maxValue, int defaultValue, String displayValue) {
int minValue;
int defaultValue;
if (keyId == R.string.track_color_mode_slow_key) {
minValue = 0;
maxValue = PreferencesUtils.getInt(this, R.string.track_color_mode_medium_key,
PreferencesUtils.TRACK_COLOR_MODE_MEDIUM_DEFAULT);
defaultValue = PreferencesUtils.TRACK_COLOR_MODE_SLOW_DEFAULT;
} else {
minValue = PreferencesUtils.getInt(
this, R.string.track_color_mode_slow_key, PreferencesUtils.TRACK_COLOR_MODE_SLOW_DEFAULT);
maxValue = Integer.MAX_VALUE;
defaultValue = PreferencesUtils.TRACK_COLOR_MODE_MEDIUM_DEFAULT;
}
int value; int value;
try { try {
value = Integer.parseInt(displayValue); value = Integer.parseInt(displayValue);
@@ -231,14 +274,13 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
} }
/** /**
* Gets the speed display value, in metric or imperial depending on the * Gets a speed display value in metric or imperial depending on the preferred
* preferred units. * units.
* *
* @param keyId the key id * @param keyId the key id
* @param defaultValue the default value
*/ */
private int getSpeedDisplayValue(int keyId) { private int getSpeedDisplayValue(int keyId, int defaultValue) {
int defaultValue = keyId == R.string.track_color_mode_slow_key ? PreferencesUtils.TRACK_COLOR_MODE_SLOW_DEFAULT
: PreferencesUtils.TRACK_COLOR_MODE_MEDIUM_DEFAULT;
int value = PreferencesUtils.getInt(this, keyId, defaultValue); int value = PreferencesUtils.getInt(this, keyId, defaultValue);
if (!PreferencesUtils.getBoolean( if (!PreferencesUtils.getBoolean(
this, R.string.metric_units_key, PreferencesUtils.METRIC_UNITS_DEFAULT)) { this, R.string.metric_units_key, PreferencesUtils.METRIC_UNITS_DEFAULT)) {
@@ -246,31 +288,4 @@ public class MapSettingsActivity extends AbstractSettingsActivity {
} }
return value; return value;
} }
/**
* Updates the speed summary.
*
* @param keyId the key id
*/
private void updateSpeedSummary(int keyId) {
EditTextPreference editTextPreference = keyId == R.string.track_color_mode_slow_key ? slowEditTextPreference
: mediumEditTextPreference;
boolean metric = PreferencesUtils.getBoolean(
this, R.string.metric_units_key, PreferencesUtils.METRIC_UNITS_DEFAULT);
int displayValue = getSpeedDisplayValue(keyId);
editTextPreference.setSummary(getString(
metric ? R.string.value_integer_kilometer_hour : R.string.value_integer_mile_hour,
displayValue));
}
/**
* Updates the percentage summary.
*/
private void updatePercentageSummary() {
int value = PreferencesUtils.getInt(MapSettingsActivity.this,
R.string.track_color_mode_percentage_key,
PreferencesUtils.TRACK_COLOR_MODE_PERCENTAGE_DEFAULT);
percentageEditTextPreference.setSummary(getString(R.string.settings_map_percentage_summary)
+ "\n" + getString(R.string.value_integer_percent, value));
}
} }
@@ -52,7 +52,7 @@ public class SettingsActivity extends AbstractSettingsActivity {
super.onCreate(bundle); super.onCreate(bundle);
addPreferencesFromResource(R.xml.settings); addPreferencesFromResource(R.xml.settings);
configPreference(R.string.google_settings_key, GoogleSettingsActivity.class); configPreference(R.string.settings_google_key, GoogleSettingsActivity.class);
configPreference(R.string.settings_map_key, MapSettingsActivity.class); configPreference(R.string.settings_map_key, MapSettingsActivity.class);
configPreference(R.string.settings_chart_key, ChartSettingsActivity.class); configPreference(R.string.settings_chart_key, ChartSettingsActivity.class);
configPreference(R.string.settings_stats_key, StatsSettingsActivity.class); configPreference(R.string.settings_stats_key, StatsSettingsActivity.class);
@@ -36,35 +36,36 @@ public class PreferencesUtils {
public static final boolean ALLOW_ACCESS_DEFAULT = false; public static final boolean ALLOW_ACCESS_DEFAULT = false;
public static final int AUTO_RESUME_TRACK_CURRENT_RETRY_DEFAULT = 0; public static final int AUTO_RESUME_TRACK_CURRENT_RETRY_DEFAULT = 0;
// Values for auto_resume_track_timeout_key
public static final int AUTO_RESUME_TRACK_TIMEOUT_ALWAYS = -1; public static final int AUTO_RESUME_TRACK_TIMEOUT_ALWAYS = -1;
public static final int AUTO_RESUME_TRACK_TIMEOUT_DEFAULT = 10; public static final int AUTO_RESUME_TRACK_TIMEOUT_DEFAULT = 10;
public static final int AUTO_RESUME_TRACK_TIMEOUT_NEVER = 0; public static final int AUTO_RESUME_TRACK_TIMEOUT_NEVER = 0;
public static final String BLUETOOTH_SENSOR_DEFAULT = ""; public static final String BLUETOOTH_SENSOR_DEFAULT = "";
public static final boolean CHART_BY_DISTANCE_DEFAULT = true; public static final boolean CHART_BY_DISTANCE_DEFAULT = true;
public static final boolean CHART_SHOW_CADENCE_DEFAULT = true; public static final boolean CHART_SHOW_CADENCE_DEFAULT = true;
public static final boolean CHART_SHOW_ELEVATION_DEFAULT = true; public static final boolean CHART_SHOW_ELEVATION_DEFAULT = true;
public static final boolean CHART_SHOW_HEART_RATE_DEFAULT = true; public static final boolean CHART_SHOW_HEART_RATE_DEFAULT = true;
public static final boolean CHART_SHOW_POWER_DEFAULT = true; public static final boolean CHART_SHOW_POWER_DEFAULT = true;
public static final boolean CHART_SHOW_SPEED_DEFAULT = true; public static final boolean CHART_SHOW_SPEED_DEFAULT = true;
public static final String DEFAULT_ACTIVITY_DEFAULT = ""; public static final String DEFAULT_ACTIVITY_DEFAULT = "";
public static final boolean DEFAULT_MAP_PUBLIC_DEFAULT = false;
public static final boolean DRIVE_SYNC_DEFAULT = false;
// Value for split_frequency_key and voice_frequency_key
public static final int FREQUENCY_OFF = 0; public static final int FREQUENCY_OFF = 0;
public static final String GOOGLE_SETTINGS_ACCOUNT_DEFAULT = ""; public static final String GOOGLE_ACCOUNT_DEFAULT = "";
public static final boolean GOOGLE_SETTINGS_DRIVE_SYNC_DEFAULT = false;
public static final boolean GOOGLE_SETTINGS_MAPS_PUBLIC_DEFAULT = false;
public static final int MAX_RECORDING_DISTANCE_DEFAULT = 200; public static final int MAX_RECORDING_DISTANCE_DEFAULT = 200;
public static final boolean METRIC_UNITS_DEFAULT = true; public static final boolean METRIC_UNITS_DEFAULT = true;
public static final int MIN_RECORDING_DISTANCE_DEFAULT = 5; public static final int MIN_RECORDING_DISTANCE_DEFAULT = 5;
// Values for min_recording_interval_key
public static final int MIN_RECORDING_INTERVAL_ADAPT_ACCURACY = -1; public static final int MIN_RECORDING_INTERVAL_ADAPT_ACCURACY = -1;
public static final int MIN_RECORDING_INTERVAL_ADAPT_BATTERY_LIFE = -2; public static final int MIN_RECORDING_INTERVAL_ADAPT_BATTERY_LIFE = -2;
public static final int MIN_RECORDING_INTERVAL_DEFAULT = 0; public static final int MIN_RECORDING_INTERVAL_DEFAULT = 0;
// Values for min_required_accuracy
public static final int MIN_REQUIRED_ACCURACY_DEFAULT = 200; public static final int MIN_REQUIRED_ACCURACY_DEFAULT = 200;
public static final int MIN_REQUIRED_ACCURACY_EXCELLENT = 10; public static final int MIN_REQUIRED_ACCURACY_EXCELLENT = 10;
public static final int MIN_REQUIRED_ACCURACY_POOR = 5000; public static final int MIN_REQUIRED_ACCURACY_POOR = 5000;
@@ -77,30 +78,23 @@ public class PreferencesUtils {
public static final boolean SEND_TO_DOCS_DEFAULT = true; public static final boolean SEND_TO_DOCS_DEFAULT = true;
public static final boolean SEND_TO_FUSION_TABLES_DEFAULT = true; public static final boolean SEND_TO_FUSION_TABLES_DEFAULT = true;
public static final boolean SEND_TO_MAPS_DEFAULT = true; public static final boolean SEND_TO_MAPS_DEFAULT = true;
public static final String SENSOR_TYPE_DEFAULT = "NONE"; public static final String SENSOR_TYPE_DEFAULT = "NONE";
public static final boolean SHOW_CONFIRM_PLAY_DIALOG_DEFAULT = true; public static final boolean SHOW_CONFIRM_PLAY_DIALOG_DEFAULT = true;
public static final boolean SHOW_CONFIRM_SHARING_DIALOG_DEFAULT = true; public static final boolean SHOW_CONFIRM_SHARING_DIALOG_DEFAULT = true;
public static final int SPLIT_FREQUENCY_DEFAULT = 0; public static final int SPLIT_FREQUENCY_DEFAULT = 0;
public static final boolean STATS_SHOW_COORDINATE_DEFAULT = false; public static final boolean STATS_SHOW_COORDINATE_DEFAULT = false;
public static final boolean STATS_SHOW_ELEVATION_DEFAULT = false; public static final boolean STATS_SHOW_ELEVATION_DEFAULT = false;
public static final boolean STATS_SHOW_GRADE_DEFAULT = false; public static final boolean STATS_SHOW_GRADE_DEFAULT = false;
public static final boolean STATS_SHOW_MOVING_TIME_DEFAULT = false; public static final boolean STATS_SHOW_MOVING_TIME_DEFAULT = false;
public static final String TRACK_COLOR_MODE_DEFAULT = "SINGLE"; public static final String TRACK_COLOR_MODE_DEFAULT = "SINGLE";
public static final int TRACK_COLOR_MODE_MEDIUM_DEFAULT = 15; public static final int TRACK_COLOR_MODE_MEDIUM_DEFAULT = 15;
public static final int TRACK_COLOR_MODE_PERCENTAGE_DEFAULT = 25; public static final int TRACK_COLOR_MODE_PERCENTAGE_DEFAULT = 25;
public static final int TRACK_COLOR_MODE_SLOW_DEFAULT = 9; public static final int TRACK_COLOR_MODE_SLOW_DEFAULT = 9;
public static final String TRACK_NAME_DEFAULT = "LOCATION"; public static final String TRACK_NAME_DEFAULT = "LOCATION";
public static final int TRACK_WIDGET_ITEM1_DEFAULT = 3; // moving time public static final int TRACK_WIDGET_ITEM1_DEFAULT = 3; // moving time
public static final int TRACK_WIDGET_ITEM2_DEFAULT = 0; // distance public static final int TRACK_WIDGET_ITEM2_DEFAULT = 0; // distance
public static final int TRACK_WIDGET_ITEM3_DEFAULT = 1; // total time public static final int TRACK_WIDGET_ITEM3_DEFAULT = 1; // total time
public static final int TRACK_WIDGET_ITEM4_DEFAULT = 2; // average speed public static final int TRACK_WIDGET_ITEM4_DEFAULT = 2; // average speed
public static final int VOICE_FREQUENCY_DEFAULT = 0; public static final int VOICE_FREQUENCY_DEFAULT = 0;
private PreferencesUtils() {} private PreferencesUtils() {}