diff --git a/MyTracks/res/values/strings.xml b/MyTracks/res/values/strings.xml index f2af9e235..88cfebc17 100644 --- a/MyTracks/res/values/strings.xml +++ b/MyTracks/res/values/strings.xml @@ -18,37 +18,27 @@ limitations under the License. + translation_description="In the 'About My Tracks' page, the copyright notice."> Copyright 2009 Google Inc. + 'Terms of service' dialog."> License + 'Privacy: m.google.com/privacy'."> Privacy: + 'Support: mytracks.appspot.com'."> Support: + 'Version: 1.1.11'."> Version: @@ -430,31 +420,23 @@ limitations under the License. + only choose one of the options."> By distance + only choose one of the options."> By time + axis."> X axis + axis."> Y axis @@ -500,6 +482,13 @@ limitations under the License. %2$d elevation in feet"> Elevation gain: %1$d m (%2$d ft) + + Fastest pace: %1$.2f min/km (%2$.1f min/mi) + Accuracy (m) @@ -561,13 +550,6 @@ limitations under the License. %1$d grade in percentage"> Min grade: %1$d %% - - Min pace: %1$.2f min/km (%2$.1f min/mi) - + translation_description="The title on a confirmation dialog asking the user if he is sure?"> Are you sure? + translation_description="The title on a progress dialog asking the user to wait."> Please wait... + translation_description="The title on an alert dialog indicating success."> Success + translation_description="In the main view, the message on the top asking the user to enable + GPS."> Please tap here to go to \'Location & security\' settings & check \'Use GPS satellites\'. Press the back button to return. + translation_description="On application start, message when there is no GPS on the device."> No GPS is found on the device. + waiting for a better GPS fix."> Waiting for a better GPS fix. Make sure the sky is visible. @@ -772,8 +743,7 @@ limitations under the License. translation_description="After importing all the tracks from the SD card, the alert message indicating that no track is imported. - %1$s: the SD card directory path. E.g., '/mnt/sdcard/MyTracks/gpx/'. - Screenshot: import_no_file.png"> + %1$s: the SD card directory path. E.g., '/mnt/sdcard/MyTracks/gpx/'."> No GPX file found in %1$s. The SD card may be unreadable or the directory may not contain any GPX file. @@ -787,8 +757,7 @@ limitations under the License. %1$d the number of successfully imported tracks. E.g., '1'. %2$s the number of GPX files in the SD card. E.g., '1 GPX file' or '2 GPX files'. - %3$s the SD card directory path. E.g., '/mnt/sdcard/MyTracks/gpx/'. - Screenshot: import_success.png"> + %3$s the SD card directory path. E.g., '/mnt/sdcard/MyTracks/gpx/'."> My Tracks: Imported %1$d of %2$s from %3$s. @@ -832,37 +801,27 @@ limitations under the License. + description."> Marker description + the marker name."> Marker name + marker type, including examples."> Marker type (e.g. building, pothole, sight...) + text field when it is empty."> Marker type + the page."> Marker details + translation_description="When inserting a new marker, a message indicating success."> A marker was inserted. + menu options below are for this marker."> This marker + marker."> Delete + deleted from the phone."> The marker will be permanently deleted from the phone. + metadata (e.g., name, type, etc.)."> Edit + marker."> Insert statistics + marker."> Insert waypoint + the user he can press and hold a marker for more options."> Pick a marker. Press & hold for more options. + on the map."> Show on map + translation_description="When inserting a statistics marker, the default name of the marker."> Statistics + translation_description="When inserting a waypoint marker, the default name of the marker."> Waypoint @@ -984,7 +921,7 @@ limitations under the License. Edit - + Export all @@ -1069,7 +1006,7 @@ limitations under the License. Share with friends... @@ -1087,20 +1024,16 @@ limitations under the License. Map."> Map - + + indicating that GPS is not available and an approximate location is used instead."> GPS is not available. An approximate location based on cell towers and WiFi networks is shown. + indicating that the current location cannot be determined."> GPS is not available. Current location cannot be determined. Enable more location sources (see \'Location & security\' settings) & make sure the sky is visible. Try again later. @@ -1112,93 +1045,70 @@ limitations under the License. + application that can import the file to My Tracks."> My Tracks Importer + Character limit: ~23 (1 line)"> Recording service + notifications, the permission description that the Android Market shows to the user."> Allows the application to receive notifications when My Tracks starts or stops a recording. + notifications, the permission label that the Android Market shows to the user."> receive My Tracks notifications + the permission description that the Android Market shows to the user."> Allows the application to read My Tracks data. + the permission label that the Android Market shows to the user."> read My Tracks data + Tracks, the permission description that the Android Market shows to the user."> Allows the application to write data to My Tracks and start/stop My Tracks recording. + Tracks, the permission label that the Android Market shows to the user."> write data to My Tracks and start/stop My Tracks recording + to choose the imperial units."> Imperial + to choose the metric units."> Metric + metric or imperial."> Preferred units + export operation was canceled."> The operation was canceled. + from the SD card."> Finished reading from the SD card. + the SD card."> Finished writing to the SD card. @@ -1281,16 +1187,12 @@ limitations under the License. Created by %1$sMy Tracks%2$s on Android. + translation_description="When sending to Google, the dialog title to choose a Google account."> Choose account + checkbox option to send to Google Docs."> Google Docs + existing map as opposed to create a new map."> Use existing map + checkbox option to send to Google Fusion Tables."> Google Fusion Tables + checkbox option to send to Google Maps."> Google Maps + new map as opposed to use an existing map."> Create new map + the bottom to share with friends the URL of the uploaded track."> Share track URL + button on the bottom to send the track to the selected Google services."> Send now + the result page."> It may take a few minutes before new tracks appear. + Google Docs."> Send to... + sensor. E.g, 'Battery level: 50 %'."> Battery level + 'Cadence: 80 rpm'."> Cadence + has connected."> Connected + connecting."> Connecting + has disconnected."> Disconnected + rate sensor. E.g., 'Hear rate: 100 bpm'."> Heart rate + sent a data. E.g., 'Last sensor time: 10:05 am'."> Last sensor time + sensor. Power is the power output of the rider. E.g., 'Power: 50 W'."> Power + sending data."> Sending @@ -1485,16 +1353,14 @@ limitations under the License. translation_description="In the 'Settings' page, the option to change the data backup related settings. - Character limit: ~26 (1 line) - Screenshot: settings.png"> + Character limit: ~26 (1 line)"> Backup + Character limit: ~26 (1 line)"> Backup now + the SD card."> Write a full copy of all your tracks and settings to the SD card. + Character limit: ~26 (1 line)"> Restore now + and it will overwrite all the current tracks and settings."> Restoring a backup from the SD card will overwrite all your current tracks and settings. + message in the alert dialog informing the user that there is no backup to restore from."> No backup found. + title in the picker dialog asking the user to select a backup."> Select a backup to restore + the SD card."> Restore all tracks and settings from the SD card. + Character limit: ~40 (1 line)"> SD card + Character limit: ~26 (1 line)"> Display + Character limit: ~23 (1 line)"> Use metric + checkbox when it is unchecked explaining using the imperial units to display distances."> Use imperial units to display distances. + checkbox when it is checked explaining using the metric units to display distances."> Use metric units to display distances. + Character limit: ~23 (1 line)"> Display speed + speed (e.g., 5 miles per hour)."> Display pace (e.g., hours/mile). + (e.g., 0.2 hours per mile)."> Display speed (e.g., miles/hour). + Character limit: ~23 (1 line)"> Color mode + Character limit: ~21 (1 line)"> Dynamic thresholds + Character limit: ~23 (1 line)"> Percentage + the medium speed range."> Percentage from the average speed for the medium speed range. + Character limit: ~21 (1 line)"> Fixed thresholds + Character limit: ~23 (1 line)"> Medium speed + for the medium speed color."> Medium speed top value. + Character limit: ~23 (1 line)"> Slow speed + the slow speed color."> Slow speed top value. + Character limit: ~21 (1 line)"> Single color + slow, medium, and fast speed."> The way to color a track based on slow, medium, and fast speed. + track recording."> Not available while recording a track. + Character limit: ~26 (1 line)"> Recording + Character limit: ~23 (1 line)"> Auto-resume + recording will not be resumed after phone reboot."> Maximum time after which a previously recording track will not be resumed after phone reboot. + Character limit: ~23 (1 line)"> Default activity + option explaining that it sets the default activity type for a new track."> Default activity type for a new track. + Character limit: ~23 (1 line)"> Distance interval + recordings of your position."> Smallest distance between two recordings of your position. + Character limit: ~23 (1 line)"> GPS accuracy + 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. + Character limit: ~23 (1 line)"> Time interval + recordings of your position."> Smallest time interval between two recordings of your position. + Character limit: ~23 (1 line)"> Marker + will be inserted."> Time/distance after which a new marker will be inserted. + Character limit: ~23 (1 line)"> Max interval + points for them to be still considered as the same track."> Maximum distance between two recordings of your position. If two positions are further than this, the track will be split. @@ -1877,23 +1681,19 @@ limitations under the License. translation_description="In the 'Recording' settings, the dropdown option to configure the voice announcement frequency. - Character limit: ~23 (1 line) - Screenshot: settings_recording_top.png"> + Character limit: ~23 (1 line)"> Voice + announcements."> Time/distance between two voice announcements. + Character limit: ~26 (1 line)"> Reset + defaults."> All settings have been reverted to their defaults. + explaining reverting all the settings to the default values."> Revert all your settings to the default values. + Character limit: ~26 (1 line)"> Sensor + sensor' or 'Unpair SRM ANT+ bridge' when there no ANT+ device paired."> Not paired. + Character limit: ~40 (1 line)"> ANT+ options + %1$d: sensor id number. E.g., '1'."> Paired with: %1$d. + Character limit: ~40 (1 line)"> Bluetooth options + Character limit: ~26 (1 line)"> Bluetooth pairing + Bluetooth settings to pair a device."> Open Android\'s Bluetooth settings to pair a device. + Character limit: ~23 (1 line)"> Bluetooth sensor + sensor to connect to."> The Bluetooth sensor to connect to. + Character limit: ~23 (1 line)"> Sensor type + Character limit: ~21 (1 line)"> ANT+ heart rate + Character limit: ~21 (1 line)"> None + Character limit: ~21 (1 line)"> Polar Bluetooth + Character limit: ~21 (1 line)"> SRM ANT+ bridge + explaining that it is to configure the type of sensor to connect to."> The type of sensor to connect to. + Character limit: ~21 (1 line)"> Zephyr Bluetooth + Character limit: ~26 (1 line)"> Unpair ANT+ heart rate + Character limit: ~26 (1 line)"> Unpair SRM ANT+ bridge + Character limit: ~26 (1 line)"> Sharing + Character limit: ~23 (1 line)"> Allow access + recording My Tracks data."> Other apps cannot read, write, start/stop recording My Tracks data. + Tracks data."> Other apps can read, write, start/stop recording My Tracks data. + Character limit: ~23 (1 line)"> New maps public + be unlisted, as opposed to public."> Make new maps created in Google Maps unlisted. + be public, as opposed to unlisted."> Make new maps created in Google Maps public. + Character limit: ~23 (1 line)"> Share only URL + sharing a URL with friends."> Include descriptive text when sharing a URL with friends. + sharing a URL with friends."> Remove any descriptive text when sharing a URL with friends. + translation_description="The title of the 'Settings' page."> My Tracks settings + translation_description="When sharing a track file with friends, the body of the message."> I think you might be interested in this track.\n\nTo view this track use Google Earth or other mapping software. + the user which application he wants to use."> Share track using: + translation_description="When sharing a track with friends, the subject line."> I would like to share a track with you + %1$s: url. E.g, 'https://maps.google.com/maps'."> I think you might be interested in this track:\n\n%1$s + translation_description="In the 'Statistics' page, the average moving pace."> Average moving pace + translation_description="In the 'Statistics' page, the average moving speed."> Average moving speed + translation_description="In the 'Statistics' page, the average pace."> Average pace + translation_description="In the 'Statistics' page, the average speed."> Average speed + translation_description="In the 'Statistics' page, the elevation."> Elevation + translation_description="In the 'Statistics' page, the elevation gain."> Elevation gain + + Fastest pace + + translation_description="In the 'Statistics' page, the latitude."> Latitude + translation_description="In the 'Statistics' page, the longitude."> Longitude + translation_description="In the 'Statistics' page, the maximum elevation."> Max elevation + translation_description="In the 'Statistics' page, the maximum grade."> Max grade + translation_description="In the 'Statistics' page, the maximum speed."> Max speed + translation_description="In the 'Statistics' page, the minimum elevation."> Min elevation + translation_description="In the 'Statistics' page, the minimum grade."> Min grade - - Min pace - + translation_description="In the 'Statistics' page, the moving time."> Moving time + translation_description="In the 'Statistics' page, the pace like hours per mile."> Pace + translation_description="In the 'Statistics' page, the speed like miles per hour."> Speed + translation_description="In the 'Statistics' page, the total distance."> Total distance + translation_description="In the 'Statistics' page, the total time."> Total time @@ -2405,21 +2116,15 @@ limitations under the License. + translation_description="In a setting picker, the value to adapt for accuracy."> Adapt for accuracy + translation_description="In a setting picker, the value to adapt for battery life."> Adapt for battery life + translation_description="In a setting picker, the value to always enable the option."> Always + %1$.1f: a float number. E.g., '2.2'"> %1$.1f mi (poor GPS) + %1$d: an integer value. E.g., '2'"> %1$d ft + %1$d: an integer value. E.g., '2'"> %1$d ft (excellent GPS) + %1$d: an integer value. E.g., '2'"> %1$d ft (recommended) + %1$d: an integer value. E.g., '2'"> %1$d km + %1$d: an integer value. E.g., '2'"> %1$d m + %1$d: an integer value. E.g., '2'"> %1$d m (excellent GPS) + %1$d: an integer value. E.g., '2'"> %1$d m (poor GPS) + %1$d: an integer value. E.g., '2'"> %1$d m (recommended) + %1$d: an integer value. E.g., '2'"> %1$d mi + %1$d: an integer value. E.g., '2'"> %1$d min + %1$d: an integer value. E.g., '2'"> %1$d s + translation_description="In a setting picker, the value to never use the feature."> Never + translation_description="In a setting picker, the value to turn off the feature."> Off + recommended value."> Smallest (recommended) @@ -3094,42 +2781,30 @@ limitations under the License. + Tracks' dialog."> About My Tracks + graphs view."> In the graphs view, Menu -> Chart settings. + the graphs view."> How do I add more graphs? + translation_description="In the 'Welcome' page, the help content answer on app navigation."> Touch the map. Left and right arrows will appear. Tap on these arrows to cycle between the map, statistics, and graphs view. + translation_description="In the 'Welcome' page, the help content question on app navigation."> How do I see the map, statistics, and graphs view? + translation_description="In the 'Welcome' page, the help content answer on battery life."> The GPS receiver draws a relatively high amount of power, so a fully charged battery typically survives less than 5 hours. Battery life depends on many factors, including signal strength, battery freshness, and tasks running in parallel. Switching off some or all of the phone\'s @@ -3137,58 +2812,44 @@ limitations under the License. results. + translation_description="In the 'Welcome' page, the help content question on battery life."> How long does the battery last when recording tracks? + translation_description="In the 'Welcome' page, the help content answer on data connection."> Cell signal or data connection is not required to record GPS tracks. However, if there is no data connection, you will not be able to see a map. Instead, you will see a grey screen or a partial map. Tracks, represented as simple lines, can still be recorded even if there is no data connection. + translation_description="In the 'Welcome' page, the help content question on data connection."> Do I need cell signal and data connection to use My Tracks? + translation_description="In the 'Welcome' page, the help content answer on deleting all + tracks."> Menu -> Tracks -> Delete all. This permanently deletes the recorded tracks from memory. If you have saved tracks to the SD card, you must delete them separately. Tracks uploaded to Google Maps, Google Fusion Tables, and Google Docs must also be deleted separately. + tracks."> How do I delete all the tracks from the phone? + translation_description="In the 'Welcome' page, the help content answer on editing points."> Once you upload tracks to Google Maps, Google Fusion Tables, or Google Docs, you can move, delete or insert individual track points as desired. + translation_description="In the 'Welcome' page, the help content question on editing points."> How can I edit or correct tracks for accuracy? + translation_description="In the 'Welcome' page, the help content answer on elevation + precision."> GPS receivers measure elevations much less precisely than latitude and longitude. Elevations can sometimes be off by a few hundred feet, though relative changes are tracked more precisely. To get a good elevation measurement, make sure that you have a strong GPS signal and wait a few @@ -3196,15 +2857,12 @@ limitations under the License. + precision."> How precise is the elevation measurement? + translation_description="In the 'Welcome' page, the help content answer on the GPS fix + message."> For My Tracks to work, your phone needs to be in line-of-sight contact with the GPS satellites. If the line-of-sight is obstructed by trees, buildings or canyon walls, you may not get an accurate fix. If you see the message, wait a minute or two. If your device does not achieve a @@ -3212,16 +2870,12 @@ limitations under the License. + message."> Why does the application sometimes display \"Waiting for a better GPS fix. Make sure the sky is visible.\"? + translation_description="In the 'Welcome' page, the help content answer on location precision."> Under optimal conditions, the location error can be +/- 20 feet (6 meters). However, precision depends on the quality of the GPS signal. The blue circle around the orange location arrow indicates estimated precision. (You may need to zoom in or out to see the circle.) You can @@ -3229,74 +2883,56 @@ limitations under the License. at the top of the screen, you will see the message \"Waiting for a better GPS fix.\". + translation_description="In the 'Welcome' page, the help content question on location + precision."> How precise are the recorded tracks? + visibility."> By default, new maps are public. To change the default to unlisted, uncheck Settings -> Sharing -> Make new maps public. You can change the visibility of all your maps at My places in Google Maps. + visibility."> Who can see the maps I send to Google Maps? + translation_description="In the 'Welcome' page, the help content answer on what is My Tracks."> My Tracks allows you to record GPS tracks and visualize your hiking, running, biking or any other activity while watching live performance statistics. My Tracks makes it easy to archive your training history with Google Maps, Google Fusion Tables, and Google Docs, and share your activities with friends and the world. + translation_description="In the 'Welcome' page, the help content question on what is My + Tracks."> What is My Tracks? + Google."> Tap the Options button located at the bottom right corner of the map view and select \"Send to Google...\". + Google."> How do I send my tracks to Google Maps, Google Fusion Tables, and Google Docs? + translation_description="In the 'Welcome' page, the help content answer on sharing a file."> You can use Google Earth or similar applications to visualize and edit GPS tracks. + translation_description="In the 'Welcome' page, the help content question on sharing a file."> What can I do with tracks after saving them to the SD card or sharing such files with friends? + friends."> Tap the Options button located at the bottom right corner of the map view and select \"Share with friends...\". You can share the track as a link to Google Map or Google Fusion Table (you will be prompted to upload the track first) or as a GPX, KML, CSV, or TCX file in an e-mail @@ -3304,58 +2940,43 @@ limitations under the License. + with friends."> How do I share tracks with friends and the rest of the world? + tracks."> Tracks on Google Maps and Google Fusion Tables are limited to certain sizes. + tracks."> Why do very long tracks split into multiple segments upon sending them to Google Maps and Google Fusion Tables? + translation_description="In the 'Welcome' page, the help content answer on statistics markers."> Statistics markers are used to segment a track to calculate statistics for each segment. For example, let\'s say you are recording a bike ride up a hill, you can insert a statistics marker at the bottom of the hill and another at the top by pressing Menu -> Markers -> Insert statistics. + translation_description="In the 'Welcome' page, the help content question on statistics + markers."> What are statistics markers? + translation_description="In the 'Welcome' page, the title of the page."> My Tracks Welcome + translation_description="In the 'Welcome' page, the help content answer on waypoint markers."> Waypoint markers are used to annotate a location. For example, if you are recording a track and you are close to an interesting place, press Menu -> Markers -> Insert waypoint. + translation_description="In the 'Welcome' page, the help content question on waypoint markers."> What are waypoint markers? diff --git a/MyTracks/src/com/google/android/apps/mytracks/AggregatedStatsActivity.java b/MyTracks/src/com/google/android/apps/mytracks/AggregatedStatsActivity.java index 5620c807c..f36cf6549 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/AggregatedStatsActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/AggregatedStatsActivity.java @@ -8,11 +8,13 @@ import com.google.android.maps.mytracks.R; import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.os.Bundle; import android.util.DisplayMetrics; import android.util.Log; +import android.view.MenuItem; import android.widget.ScrollView; import android.widget.TextView; @@ -60,8 +62,7 @@ public class AggregatedStatsActivity extends Activity implements this.tracksProvider = MyTracksProviderUtils.Factory.get(this); - // Show the action bar (or nothing at all). - ApiAdapterFactory.getApiAdapter().showActionBar(this); + ApiAdapterFactory.getApiAdapter().configureActionBarHomeAsUp(this); setContentView(R.layout.stats); @@ -87,6 +88,16 @@ public class AggregatedStatsActivity extends Activity implements loadAggregatedStats(); } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() != android.R.id.home) { + return false; + } + startActivity(new Intent(this, TrackListActivity.class) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK)); + return true; + } + /** * 1. Reads tracks from the db * 2. Merges the trip stats from the tracks diff --git a/MyTracks/src/com/google/android/apps/mytracks/ChartActivity.java b/MyTracks/src/com/google/android/apps/mytracks/ChartActivity.java index fda7566dc..265f6e4d8 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/ChartActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/ChartActivity.java @@ -28,7 +28,6 @@ import com.google.android.apps.mytracks.content.TrackDataListener; import com.google.android.apps.mytracks.content.Waypoint; import com.google.android.apps.mytracks.stats.DoubleBuffer; import com.google.android.apps.mytracks.stats.TripStatisticsBuilder; -import com.google.android.apps.mytracks.util.ApiAdapterFactory; import com.google.android.apps.mytracks.util.LocationUtils; import com.google.android.apps.mytracks.util.UnitConversions; import com.google.android.maps.mytracks.R; @@ -118,9 +117,6 @@ public class ChartActivity extends Activity implements TrackDataListener { // The volume we want to control is the Text-To-Speech volume setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM); - // Show the action bar (or nothing at all). - ApiAdapterFactory.getApiAdapter().showActionBar(this); - setContentView(R.layout.mytracks_charts); ViewGroup layout = (ViewGroup) findViewById(R.id.elevation_chart); chartView = new ChartView(this); diff --git a/MyTracks/src/com/google/android/apps/mytracks/ImportActivity.java b/MyTracks/src/com/google/android/apps/mytracks/ImportActivity.java index 7983e25f4..9fecc02e6 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/ImportActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/ImportActivity.java @@ -141,8 +141,7 @@ public class ImportActivity extends Activity { public void onClick(DialogInterface dialog, int which) { if (!importAll && trackId != -1L) { Intent intent = new Intent(ImportActivity.this, TrackDetailActivity.class) - .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK) .putExtra(TrackDetailActivity.TRACK_ID, trackId); startActivity(intent); } diff --git a/MyTracks/src/com/google/android/apps/mytracks/MapActivity.java b/MyTracks/src/com/google/android/apps/mytracks/MapActivity.java index 5e7d8b110..1be7597b7 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/MapActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/MapActivity.java @@ -24,7 +24,6 @@ import com.google.android.apps.mytracks.content.TrackDataHub.ListenerDataType; import com.google.android.apps.mytracks.content.TrackDataListener; import com.google.android.apps.mytracks.content.Waypoint; import com.google.android.apps.mytracks.stats.TripStatistics; -import com.google.android.apps.mytracks.util.ApiAdapterFactory; import com.google.android.apps.mytracks.util.GeoRect; import com.google.android.apps.mytracks.util.LocationUtils; import com.google.android.maps.GeoPoint; @@ -142,9 +141,6 @@ public class MapActivity extends com.google.android.maps.MapActivity // The volume we want to control is the Text-To-Speech volume setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM); - // Show the action bar (or nothing at all). - ApiAdapterFactory.getApiAdapter().showActionBar(this); - // Inflate the layout: setContentView(R.layout.mytracks_layout); diff --git a/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java b/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java index 3bff1746b..6cf4ad5d6 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java @@ -248,11 +248,10 @@ public class SearchActivity extends ListActivity { private Intent createViewDataIntent(Map clickedData) { Intent intent = new Intent(this, TrackDetailActivity.class) - .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK) + .putExtra(TrackDetailActivity.TRACK_ID, (Long) clickedData.get(TRACK_ID_FIELD)); if (clickedData.containsKey(WAYPOINT_ID_FIELD)) { intent.putExtra(TrackDetailActivity.WAYPOINT_ID, (Long) clickedData.get(WAYPOINT_ID_FIELD)); - } else { - intent.putExtra(TrackDetailActivity.TRACK_ID, (Long) clickedData.get(TRACK_ID_FIELD)); } return intent; } diff --git a/MyTracks/src/com/google/android/apps/mytracks/SettingsActivity.java b/MyTracks/src/com/google/android/apps/mytracks/SettingsActivity.java index 06c0cacf1..e049148ac 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/SettingsActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/SettingsActivity.java @@ -628,7 +628,7 @@ public class SettingsActivity extends PreferenceActivity { // Restart the settings activity so all changes are loaded. Intent intent = getIntent(); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } }); diff --git a/MyTracks/src/com/google/android/apps/mytracks/StatsActivity.java b/MyTracks/src/com/google/android/apps/mytracks/StatsActivity.java index 039091cdf..ad7a046f6 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/StatsActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/StatsActivity.java @@ -23,7 +23,6 @@ import com.google.android.apps.mytracks.content.TrackDataHub.ListenerDataType; import com.google.android.apps.mytracks.content.TrackDataListener; import com.google.android.apps.mytracks.content.Waypoint; import com.google.android.apps.mytracks.services.ServiceUtils; -import com.google.android.apps.mytracks.util.ApiAdapterFactory; import com.google.android.apps.mytracks.util.UnitConversions; import com.google.android.maps.mytracks.R; @@ -107,9 +106,6 @@ public class StatsActivity extends Activity implements TrackDataListener { // The volume we want to control is the Text-To-Speech volume setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM); - // Show the action bar (or nothing at all). - ApiAdapterFactory.getApiAdapter().showActionBar(this); - setContentView(R.layout.stats); ScrollView sv = ((ScrollView) findViewById(R.id.scrolly)); diff --git a/MyTracks/src/com/google/android/apps/mytracks/StatsUtilities.java b/MyTracks/src/com/google/android/apps/mytracks/StatsUtilities.java index 96ee5a23f..b8a6fef65 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/StatsUtilities.java +++ b/MyTracks/src/com/google/android/apps/mytracks/StatsUtilities.java @@ -262,6 +262,6 @@ public class StatsUtilities { R.string.stat_average_moving_pace); setSpeedLabel(R.id.max_speed_label, R.string.stat_max_speed, - R.string.stat_min_pace); + R.string.stat_fastest_pace); } } diff --git a/MyTracks/src/com/google/android/apps/mytracks/TrackDetailActivity.java b/MyTracks/src/com/google/android/apps/mytracks/TrackDetailActivity.java index ed2b52c63..75c1824c1 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/TrackDetailActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/TrackDetailActivity.java @@ -21,7 +21,6 @@ import static com.google.android.apps.mytracks.Constants.STATS_TAB_TAG; import com.google.android.apps.mytracks.content.MyTracksProviderUtils; import com.google.android.apps.mytracks.content.TrackDataHub; -import com.google.android.apps.mytracks.content.Waypoint; import com.google.android.apps.mytracks.content.WaypointCreationRequest; import com.google.android.apps.mytracks.io.file.SaveActivity; import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat; @@ -78,7 +77,8 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener private TrackDataHub trackDataHub; private TrackRecordingServiceConnection trackRecordingServiceConnection; private NavControls navControls; - + private long trackId; + private MenuItem stopRecordingMenuItem; private MenuItem insertMarkerMenuItem; private MenuItem playMenuItem; @@ -104,10 +104,7 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener public void onSharedPreferenceChanged(SharedPreferences preferences, String key) { // Note that key can be null if (getString(R.string.recording_track_key).equals(key)) { - if (isRecording()) { - trackRecordingServiceConnection.startAndBind(); - } - updateMenu(); + updateMenu(); } } }; @@ -116,16 +113,14 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM); + ApiAdapterFactory.getApiAdapter().configureActionBarHomeAsUp(this); + sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE); sharedPreferences.registerOnSharedPreferenceChangeListener(sharedPreferenceChangeListener); trackDataHub = ((MyTracksApplication) getApplication()).getTrackDataHub(); trackRecordingServiceConnection = new TrackRecordingServiceConnection(this, null); - setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM); - - // Show the action bar (or nothing at all). - ApiAdapterFactory.getApiAdapter().showActionBar(this); - final Resources res = getResources(); final TabHost tabHost = getTabHost(); tabHost.addTab(tabHost.newTabSpec(MAP_TAB_TAG) @@ -150,43 +145,33 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener navControls.show(); tabHost.addView(layout); layout.setOnTouchListener(this); + + // Get the trackid + Intent intent = getIntent(); + trackId = intent.getLongExtra(TRACK_ID, -1L); + if (trackId == -1L) { + startTrackListActivity(); + finish(); + } + trackDataHub.loadTrack(trackId); + + // Get the waypointId + long waypointId = intent.getLongExtra(WAYPOINT_ID, -1L); + if (waypointId != -1L) { + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null) { + getTabHost().setCurrentTab(0); + mapActivity.showWaypoint(trackId, waypointId); + } else { + Log.e(TAG, "MapActivity is null"); + } + } } @Override protected void onStart() { super.onStart(); trackDataHub.start(); - - if (isRecording()) { - trackRecordingServiceConnection.startAndBind(); - } - - Intent intent = getIntent(); - long trackId = intent.getLongExtra(TRACK_ID, -1L); - if (trackId != -1L) { - trackDataHub.loadTrack(trackId); - return; - } - - long waypointId = intent.getLongExtra(WAYPOINT_ID, -1L); - if (waypointId != -1L) { - Waypoint waypoint = MyTracksProviderUtils.Factory.get(this).getWaypoint(waypointId); - if (waypoint != null) { - trackId = waypoint.getTrackId(); - trackDataHub.loadTrack(trackId); - MapActivity mapActivity = getMapActivity(); - if (mapActivity != null) { - getTabHost().setCurrentTab(0); - mapActivity.showWaypoint(trackId, waypointId); - } else { - Log.e(TAG, "MapActivity is null"); - } - return; - } - } - - // No track id or waypoint id, return to the track list activity. - startTrackListActivity(); } @Override @@ -272,8 +257,10 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener public boolean onOptionsItemSelected(MenuItem item) { MapActivity mapActivity; Intent intent; - long trackId = trackDataHub.getSelectedTrackId(); switch (item.getItemId()) { + case android.R.id.home: + startTrackListActivity(); + return true; case R.id.menu_stop_recording: updateMenuItems(false); stopRecording(); @@ -299,16 +286,16 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener startActivity(intent); return true; case R.id.menu_share_gpx: - startSaveActivity(trackId, TrackFileFormat.GPX, true); + startSaveActivity(TrackFileFormat.GPX, true); return true; case R.id.menu_share_kml: - startSaveActivity(trackId, TrackFileFormat.KML, true); + startSaveActivity(TrackFileFormat.KML, true); return true; case R.id.menu_share_csv: - startSaveActivity(trackId, TrackFileFormat.CSV, true); + startSaveActivity(TrackFileFormat.CSV, true); return true; case R.id.menu_share_tcx: - startSaveActivity(trackId, TrackFileFormat.TCX, true); + startSaveActivity(TrackFileFormat.TCX, true); return true; case R.id.menu_markers: intent = new Intent(this, WaypointsList.class) @@ -321,16 +308,16 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener startActivity(intent); return true; case R.id.menu_save_gpx: - startSaveActivity(trackId, TrackFileFormat.GPX, false); + startSaveActivity(TrackFileFormat.GPX, false); return true; case R.id.menu_save_kml: - startSaveActivity(trackId, TrackFileFormat.KML, false); + startSaveActivity(TrackFileFormat.KML, false); return true; case R.id.menu_save_csv: - startSaveActivity(trackId, TrackFileFormat.CSV, false); + startSaveActivity(TrackFileFormat.CSV, false); return true; case R.id.menu_save_tcx: - startSaveActivity(trackId, TrackFileFormat.TCX, false); + startSaveActivity(TrackFileFormat.TCX, false); return true; case R.id.menu_edit: startActivity(new Intent(this, TrackEditActivity.class) @@ -431,7 +418,8 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener * Updates the menu. */ private void updateMenu() { - updateMenuItems(isRecording()); + updateMenuItems( + trackId == sharedPreferences.getLong(getString(R.string.recording_track_key), -1L)); } /** @@ -475,25 +463,20 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener } /** - * Starts the {@link TrackListActivity} and ends this activity. + * Starts the {@link TrackListActivity}. */ private void startTrackListActivity() { - Intent intent = new Intent(this, TrackListActivity.class) - .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - finish(); + startActivity(new Intent(this, TrackListActivity.class) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK)); } /** * Starts the {@link SaveActivity} to save a track. * - * @param trackId the track id * @param trackFileFormat the track file format * @param shareTrack true to share the track after saving */ - private void startSaveActivity( - long trackId, TrackFileFormat trackFileFormat, boolean shareTrack) { + private void startSaveActivity(TrackFileFormat trackFileFormat, boolean shareTrack) { Intent intent = new Intent(this, SaveActivity.class) .putExtra(SaveActivity.EXTRA_TRACK_ID, trackId) .putExtra(SaveActivity.EXTRA_TRACK_FILE_FORMAT, (Parcelable) trackFileFormat) diff --git a/MyTracks/src/com/google/android/apps/mytracks/TrackListActivity.java b/MyTracks/src/com/google/android/apps/mytracks/TrackListActivity.java index c515cd16b..8e21f4b1a 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/TrackListActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/TrackListActivity.java @@ -41,6 +41,7 @@ import android.os.Bundle; import android.os.Parcelable; import android.speech.tts.TextToSpeech; import android.support.v4.app.DialogFragment; +import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.support.v4.app.LoaderManager.LoaderCallbacks; @@ -169,6 +170,7 @@ public class TrackListActivity extends FragmentActivity { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { Intent intent = new Intent(TrackListActivity.this, TrackDetailActivity.class) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK) .putExtra(TrackDetailActivity.TRACK_ID, id); startActivity(intent); } @@ -238,15 +240,10 @@ public class TrackListActivity extends FragmentActivity { }); if (!EulaUtils.getEulaValue(this)) { - new EulaDialogFragment().show(getSupportFragmentManager(), EULA_DIALOG_TAG); - } - } - - @Override - protected void onStart() { - super.onStart(); - if (isRecording()) { - trackRecordingServiceConnection.startAndBind(); + Fragment fragment = getSupportFragmentManager().findFragmentByTag(EULA_DIALOG_TAG); + if (fragment == null) { + new EulaDialogFragment().show(getSupportFragmentManager(), EULA_DIALOG_TAG); + } } } diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/DescriptionGeneratorImpl.java b/MyTracks/src/com/google/android/apps/mytracks/content/DescriptionGeneratorImpl.java index 2287a4be3..86ef70e25 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/content/DescriptionGeneratorImpl.java +++ b/MyTracks/src/com/google/android/apps/mytracks/content/DescriptionGeneratorImpl.java @@ -116,8 +116,8 @@ public class DescriptionGeneratorImpl implements DescriptionGenerator { // Average moving pace writePace(averageMovingSpeed, builder, R.string.description_average_moving_pace, lineBreak); - // Min pace - writePace(maxSpeed, builder, R.string.description_min_pace, lineBreak); + // Fastest pace + writePace(maxSpeed, builder, R.string.description_fastest_pace, lineBreak); // Max elevation writeElevation(stats.getMaxElevation(), builder, R.string.description_max_elevation, lineBreak); diff --git a/MyTracks/src/com/google/android/apps/mytracks/io/backup/RestoreActivity.java b/MyTracks/src/com/google/android/apps/mytracks/io/backup/RestoreActivity.java index 92cd7fb58..19edaa98f 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/io/backup/RestoreActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/io/backup/RestoreActivity.java @@ -92,9 +92,8 @@ public class RestoreActivity extends Activity { public void onAsyncTaskCompleted(boolean success, int messageId) { removeDialog(DIALOG_PROGRESS_ID); Toast.makeText(this, messageId, success ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG).show(); - startActivity( - new Intent(this, TrackListActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)); - finish(); + startActivity(new Intent(this, TrackListActivity.class) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK)); } /** diff --git a/MyTracks/src/com/google/android/apps/mytracks/io/file/SaveActivity.java b/MyTracks/src/com/google/android/apps/mytracks/io/file/SaveActivity.java index bc31d16b5..8bc003459 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/io/file/SaveActivity.java +++ b/MyTracks/src/com/google/android/apps/mytracks/io/file/SaveActivity.java @@ -206,8 +206,7 @@ public class SaveActivity extends Activity { startActivity(Intent.createChooser(intent, getString(R.string.share_track_picker_title))); } else if (playTrack) { Intent intent = new Intent() - .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK) .putExtra(PlayTrackUtils.TOUR_FEATURE_ID, KmlTrackWriter.TOUR_FEATURE_ID) .setClassName(PlayTrackUtils.GOOGLE_EARTH_PACKAGE, PlayTrackUtils.GOOGLE_EARTH_CLASS) .setDataAndType(Uri.fromFile(new File(filePath)), PlayTrackUtils.KML_MIME_TYPE); diff --git a/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java b/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java index c72c1a19d..27925710c 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java +++ b/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java @@ -485,6 +485,7 @@ public class TrackRecordingService extends Service { R.drawable.arrow_320, null /* tickerText */, System.currentTimeMillis()); Intent intent = new Intent(this, TrackDetailActivity.class) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK) .putExtra(TrackDetailActivity.TRACK_ID, recordingTrackId); PendingIntent contentIntent = PendingIntent.getActivity( this, 0 /* requestCode */, intent, 0 /* flags */); diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/Api11Adapter.java b/MyTracks/src/com/google/android/apps/mytracks/util/Api11Adapter.java index 00396f572..638a32f84 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/util/Api11Adapter.java +++ b/MyTracks/src/com/google/android/apps/mytracks/util/Api11Adapter.java @@ -17,11 +17,11 @@ package com.google.android.apps.mytracks.util; import android.annotation.TargetApi; +import android.app.ActionBar; import android.app.Activity; import android.app.SearchManager; import android.content.Context; import android.view.MenuItem; -import android.view.Window; import android.widget.SearchView; /** @@ -33,8 +33,10 @@ import android.widget.SearchView; public class Api11Adapter extends Api10Adapter { @Override - public void showActionBar(Activity activity) { - activity.requestWindowFeature(Window.FEATURE_ACTION_BAR); + public void configureActionBarHomeAsUp(Activity activity) { + ActionBar actionBar = activity.getActionBar(); + actionBar.setHomeButtonEnabled(true); + actionBar.setDisplayHomeAsUpEnabled(true); } @Override diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/Api7Adapter.java b/MyTracks/src/com/google/android/apps/mytracks/util/Api7Adapter.java index 1f7e8aefe..81dea19a6 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/util/Api7Adapter.java +++ b/MyTracks/src/com/google/android/apps/mytracks/util/Api7Adapter.java @@ -104,7 +104,7 @@ public class Api7Adapter implements ApiAdapter { } @Override - public void showActionBar(Activity activity) { + public void configureActionBarHomeAsUp(Activity activity) { // Action bar not available, just hide the title and let actions be shown // via the regular menu. activity.requestWindowFeature(Window.FEATURE_NO_TITLE); diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapter.java b/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapter.java index efdb86c25..e108620f3 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapter.java +++ b/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapter.java @@ -101,15 +101,15 @@ public interface ApiAdapter { */ public BluetoothSocket getBluetoothSocket(BluetoothDevice bluetoothDevice) throws IOException; - /** - * Shows the action bar, if the current system supports it. - * If it's not supported, the title bar will be kept hidden. - * + /** + * Configures the action bar with the Home button as an Up button. If the + * system doesn't support action bar, hide the title bar. + *

* Due to changes in API level 11. * * @param activity the current activity */ - public void showActionBar(Activity activity); + public void configureActionBarHomeAsUp(Activity activity); /** * Configures the search widget. diff --git a/MyTracks/src/com/google/android/apps/mytracks/widgets/TrackWidgetProvider.java b/MyTracks/src/com/google/android/apps/mytracks/widgets/TrackWidgetProvider.java index 40546740f..369539b84 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/widgets/TrackWidgetProvider.java +++ b/MyTracks/src/com/google/android/apps/mytracks/widgets/TrackWidgetProvider.java @@ -145,7 +145,8 @@ public class TrackWidgetProvider RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.track_widget); // Make all of the stats open the mytracks activity. - Intent intent = new Intent(context, TrackDetailActivity.class); + Intent intent = new Intent(context, TrackDetailActivity.class) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); if (track != null) { intent.putExtra(TrackDetailActivity.TRACK_ID, track.getId()); }