diff --git a/MyTracks/AndroidManifest.xml b/MyTracks/AndroidManifest.xml
index 9db4d79be..b0913b798 100755
--- a/MyTracks/AndroidManifest.xml
+++ b/MyTracks/AndroidManifest.xml
@@ -204,6 +204,7 @@ limitations under the License.
android:name="com.google.android.apps.mytracks.io.maps.ChooseMapActivity" />
+
diff --git a/MyTracks/res/layout/choose_upload_service.xml b/MyTracks/res/layout/choose_upload_service.xml
index 3b24cf482..2e20d0cbe 100644
--- a/MyTracks/res/layout/choose_upload_service.xml
+++ b/MyTracks/res/layout/choose_upload_service.xml
@@ -39,7 +39,6 @@ limitations under the License.
android:layout_width="0dp" >
diff --git a/MyTracks/res/layout/confirm_sharing.xml b/MyTracks/res/layout/confirm_sharing.xml
new file mode 100644
index 000000000..d13425cfa
--- /dev/null
+++ b/MyTracks/res/layout/confirm_sharing.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MyTracks/res/layout/help.xml b/MyTracks/res/layout/help.xml
index 6cae24adf..0446392d9 100644
--- a/MyTracks/res/layout/help.xml
+++ b/MyTracks/res/layout/help.xml
@@ -72,6 +72,18 @@ limitations under the License.
+
+
+
+
diff --git a/MyTracks/res/values/do_not_translate.xml b/MyTracks/res/values/do_not_translate.xml
index 5b91eae94..372a17e48 100644
--- a/MyTracks/res/values/do_not_translate.xml
+++ b/MyTracks/res/values/do_not_translate.xml
@@ -16,6 +16,7 @@ limitations under the License.
-->
+ support.google.com/maps/bin/answer.py?answer=62845
http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png
http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png
www.google.com/policies/privacy/
diff --git a/MyTracks/res/values/keys.xml b/MyTracks/res/values/keys.xml
index f7fa8a154..ec91b9e27 100644
--- a/MyTracks/res/values/keys.xml
+++ b/MyTracks/res/values/keys.xml
@@ -31,6 +31,7 @@ limitations under the License.
chartShowSpeed
defaultActivity
defaultMapPublic
+ googleAccount
maxRecordingDistance
metricUnits
minRecordingDistance
@@ -44,8 +45,8 @@ limitations under the License.
sendToFusionTables
sendToMaps
sensorType
- sharingAccount
showCheckUnitsDialog
+ showConfrimSharingDialog
showWelcomeDialog
splitFrequency
statsShowCoordinate
diff --git a/MyTracks/res/values/strings.xml b/MyTracks/res/values/strings.xml
index 9515eecb7..26fe34fc6 100644
--- a/MyTracks/res/values/strings.xml
+++ b/MyTracks/res/values/strings.xml
@@ -615,6 +615,11 @@ limitations under the License.
%1$s description. E.g., 'At the top'.">
Description: %1$s
+
+ Do no show this again.
+
Error
@@ -696,8 +701,9 @@ limitations under the License.
translation_description="In the 'Help' page, the answer on delete tracks.">
From the track list, select \"Delete all\" when not recording. This permanently deletes the
recorded tracks from memory. If you have saved tracks or backups on the SD card, you must delete
- them separately. Tracks uploaded to Google Maps, Google Fusion Tables, and Google Doc must also
- be deleted separately.
+ them separately. You can access the SD card using any file manager app from the Play Store or
+ using a USB cable to connect your phone to your computer. Tracks uploaded to Google Maps,
+ Google Fusion Tables, and Google Docs must also be deleted separately.
@@ -724,6 +730,19 @@ limitations under the License.
translation_description="In the 'Help' page, the question on elevation precision.">
How precise is the elevation measurement?
+
+ For Google Maps, go to %1$s and click on \"My Places\". For Google Fusion Tables, go to %2$s.
+ For Google Docs, go to %3$s.
+
+
+ Where are the tracks after sending to Google?
+
For My Tracks to work, your phone needs to be in line-of-sight contact with the GPS satellites.
@@ -739,13 +758,23 @@ limitations under the License.
translation_description="In the 'Help' page, the 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
+ indicates estimated precision. (You may need to zoom in or zoom out to see the circle.) You can
change the GPS precision at Settings -> Recording -> GPS accuracy.
How precise are the recorded tracks?
+
+ See %1$s.
+
+
+ What is the difference between public and unlisted when sending a track to Google Maps?
+
Markers are used to annotate a location.
@@ -783,9 +812,10 @@ limitations under the License.
- By default, tracks sent to Google Maps and Google Fusion Tables are public, while tracks sent to
- Google Docs are private. You can change the visibility of your tracks in Google Maps, Google
- Fusion, and Google Docs.
+ By default, tracks sent to Google Maps are unlisted, tracks sent to Google Fusion Tables are
+ public, and tracks sent to Google Docs are private. For Google Maps, you can change the
+ default between public and unlisted via Settings -> Sharing. After uploading tracks, you can
+ change their visibility in Google Maps, Google Fusion Tables, and Google Docs.
@@ -793,8 +823,8 @@ limitations under the License.
- The split markers are used to segment a track to calculate statistics for each segment. Split
- markers are inserted by setting the split frequency in the menu.
+ Split markers are used to segment a track to calculate statistics for each segment. Split
+ markers are inserted by setting the split frequency from the menu.
@@ -1199,12 +1229,6 @@ limitations under the License.
global system search settings.">
Tracks and markers
-
- Search My Tracks
-
No tracks or markers matched your search.
@@ -1251,19 +1275,28 @@ limitations under the License.
Use existing map
+ translation_description="When sending a track to Google, the Google Fusion Tables name.">
Google Fusion Tables
+
+ Google Fusion Tables\n(new public table)
+
Google Maps
-
- Create new map
+ new public map as opposed to use an existing map.">
+ Create new public map
+
+
+ Create new unlisted map
Sharing
-
- Switch account
-
-
- Account used when sending a track to Google.
-
Make new maps public
-
- New maps created in Google Maps will be unlisted.
+ option explaining that new maps created in Google Maps will be public, as opposed to unlisted.
+ See http://support.google.com/maps/bin/answer.py?answer=62845 for public versus unlisted.
+
+ %1$s url. E.g., 'support.google.com/maps/bin/answer.py?answer=62845'.">
+ New maps created in Google Maps will be public. See %1$s for more info.
-
- New maps created in Google Maps will be public.
+
+ Make new maps unlisted
+
+
+ New maps created in Google Maps will be unlisted. See %1$s for more info.
@@ -1903,6 +1941,12 @@ limitations under the License.
Preferred units
+
+
+ Switch account
+
+
@@ -1910,6 +1954,14 @@ limitations under the License.
+
+ This will upload your track to Google Maps so that you can share the map url with friends. The
+ map will be either public or unlisted depending on your setting at Settings -> Sharing. For more
+ info on public versus unlisted, see %1$s.
+
diff --git a/MyTracks/res/values/styles.xml b/MyTracks/res/values/styles.xml
index 04f9c5ae7..1d3f36672 100644
--- a/MyTracks/res/values/styles.xml
+++ b/MyTracks/res/values/styles.xml
@@ -36,6 +36,7 @@ limitations under the License.
- center_vertical
- 8dp
- 0dp
+ - 5
diff --git a/MyTracks/res/xml/search.xml b/MyTracks/res/xml/search.xml
index a4dfcbda5..b791c4593 100644
--- a/MyTracks/res/xml/search.xml
+++ b/MyTracks/res/xml/search.xml
@@ -1,6 +1,6 @@
+
-
+ android:defaultValue="false"
+ android:key="@string/default_map_public_key" />
entries = new ArrayList();
+ Account[] accounts = AccountManager.get(this).getAccountsByType(Constants.ACCOUNT_TYPE);
+ for (Account account : accounts) {
+ entries.add(account.name);
+ }
+ googleAccountListPreference.setEntries(entries.toArray(new CharSequence[entries.size()]));
+ googleAccountListPreference.setEntryValues(entries.toArray(
+ new CharSequence[entries.size()]));
+ if (entries.size() == 1) {
+ googleAccountListPreference.setValueIndex(0);
+ }
+ String googleAccount = PreferencesUtils.getString(this, R.string.google_account_key,
+ PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT);
+ updateSwitchAccountSummary(googleAccount);
+ googleAccountListPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ updateSwitchAccountSummary((String) newValue);
+ return true;
+ }
+ });
+
resetPreference = findPreference(getString(R.string.settings_reset_key));
resetPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
@@ -143,6 +174,17 @@ public class SettingsActivity extends AbstractSettingsActivity {
: R.string.settings_reset_summary);
}
+ /**
+ * Updates the switch account summary.
+ *
+ * @param value the value
+ */
+ private void updateSwitchAccountSummary(String value) {
+ googleAccountListPreference.setSummary(
+ PreferencesUtils.GOOGLE_ACCOUNT_DEFAULT.equals(value) ? getString(R.string.value_unknown)
+ : value);
+ }
+
@Override
protected Dialog onCreateDialog(int id) {
if (id != DIALOG_CONFIRM_RESET_ID) {
diff --git a/MyTracks/src/com/google/android/apps/mytracks/settings/SharingSettingsActivity.java b/MyTracks/src/com/google/android/apps/mytracks/settings/SharingSettingsActivity.java
index eb16dead6..bc92e6479 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/settings/SharingSettingsActivity.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/settings/SharingSettingsActivity.java
@@ -16,23 +16,17 @@
package com.google.android.apps.mytracks.settings;
-import com.google.android.apps.mytracks.Constants;
import com.google.android.apps.mytracks.util.DialogUtils;
+import com.google.android.apps.mytracks.util.PreferencesUtils;
import com.google.android.maps.mytracks.R;
-import android.accounts.Account;
-import android.accounts.AccountManager;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
-import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* An activity for accessing the sharing settings.
*
@@ -42,6 +36,7 @@ public class SharingSettingsActivity extends AbstractSettingsActivity {
private static final int DIALOG_CONFIRM_ALLOW_ACCESS_ID = 0;
+ private CheckBoxPreference defaultMapPublicCheckBoxPreference;
private CheckBoxPreference allowAccessCheckBoxPreference;
@SuppressWarnings("deprecation")
@@ -50,6 +45,26 @@ public class SharingSettingsActivity extends AbstractSettingsActivity {
super.onCreate(bundle);
addPreferencesFromResource(R.xml.sharing_settings);
+ defaultMapPublicCheckBoxPreference = (CheckBoxPreference) findPreference(
+ getString(R.string.default_map_public_key));
+ defaultMapPublicCheckBoxPreference.setSummaryOn(getString(
+ R.string.settings_sharing_map_public_summary,
+ getString(R.string.maps_public_unlisted_url)));
+ defaultMapPublicCheckBoxPreference.setSummaryOff(getString(
+ R.string.settings_sharing_map_unlisted_summary,
+ getString(R.string.maps_public_unlisted_url)));
+ boolean defaultMapPublic = PreferencesUtils.getBoolean(
+ this, R.string.default_map_public_key, PreferencesUtils.DEFAULT_MAP_PUBLIC_DEFAULT);
+ updateDefaultMapPublicTitle(defaultMapPublic);
+ defaultMapPublicCheckBoxPreference.setOnPreferenceChangeListener(
+ new OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ updateDefaultMapPublicTitle((Boolean) newValue);
+ return true;
+ }
+ });
+
allowAccessCheckBoxPreference = (CheckBoxPreference) findPreference(
getString(R.string.allow_access_key));
allowAccessCheckBoxPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@@ -63,21 +78,6 @@ public class SharingSettingsActivity extends AbstractSettingsActivity {
}
}
});
-
- ListPreference sharingAccountListPreference = (ListPreference) findPreference(
- getString(R.string.sharing_account_key));
- List entries = new ArrayList();
- Account[] accounts = AccountManager.get(this).getAccountsByType(Constants.ACCOUNT_TYPE);
- for (Account account : accounts) {
- entries.add(account.name);
- }
-
- sharingAccountListPreference.setEntries(entries.toArray(new CharSequence[entries.size()]));
- sharingAccountListPreference.setEntryValues(entries.toArray(
- new CharSequence[entries.size()]));
- if (entries.size() == 1) {
- sharingAccountListPreference.setValueIndex(0);
- }
}
@Override
@@ -88,10 +88,20 @@ public class SharingSettingsActivity extends AbstractSettingsActivity {
return DialogUtils.createConfirmationDialog(this,
R.string.settings_sharing_allow_access_confirm_message,
new DialogInterface.OnClickListener() {
- @Override
+ @Override
public void onClick(DialogInterface dialog, int button) {
allowAccessCheckBoxPreference.setChecked(true);
}
});
}
+
+ /**
+ * Updates the title for the default map public check box preference.
+ *
+ * @param value the value
+ */
+ private void updateDefaultMapPublicTitle(boolean value) {
+ defaultMapPublicCheckBoxPreference.setTitle(value ? R.string.settings_sharing_map_public
+ : R.string.settings_sharing_map_unlisted);
+ }
}
diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/DialogUtils.java b/MyTracks/src/com/google/android/apps/mytracks/util/DialogUtils.java
index 126f25bf4..1f456ea6b 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/util/DialogUtils.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/util/DialogUtils.java
@@ -23,6 +23,7 @@ import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
+import android.view.View;
/**
* Utilities for creating dialogs.
@@ -37,19 +38,40 @@ public class DialogUtils {
* Creates a confirmation dialog.
*
* @param context the context
- * @param messageId the confirmation message id
- * @param onClickListener the listener to invoke when the user clicks OK
+ * @param messageId the message id
+ * @param okListener the listener when OK is clicked
*/
public static Dialog createConfirmationDialog(
- Context context, int messageId, DialogInterface.OnClickListener onClickListener) {
- return new AlertDialog.Builder(context)
+ Context context, int messageId, DialogInterface.OnClickListener okListener) {
+ return createConfirmationDialog(context, messageId, null, okListener, null);
+ }
+
+ /**
+ * Creates a confirmation dialog.
+ *
+ * @param context the context
+ * @param messageId the messageId
+ * @param view the view
+ * @param okListener the listener when OK is clicked
+ * @param cancelListener the listener when cancel is clicked
+ */
+ public static Dialog createConfirmationDialog(
+ Context context, int messageId, View view, DialogInterface.OnClickListener okListener,
+ DialogInterface.OnClickListener cancelListener) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(context)
.setCancelable(true)
.setIcon(android.R.drawable.ic_dialog_alert)
- .setMessage(context.getString(messageId))
- .setNegativeButton(android.R.string.cancel, null)
- .setPositiveButton(android.R.string.ok, onClickListener)
- .setTitle(R.string.generic_confirm_title)
- .create();
+ .setNegativeButton(android.R.string.cancel, cancelListener)
+ .setPositiveButton(android.R.string.ok, okListener)
+ .setTitle(R.string.generic_confirm_title);
+ if (messageId != -1) {
+ builder.setMessage(messageId);
+ }
+ if (view != null) {
+ builder.setView(view);
+ }
+
+ return builder.create();
}
/**
diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/PreferencesUtils.java b/MyTracks/src/com/google/android/apps/mytracks/util/PreferencesUtils.java
index 6ee57feca..dc018bd5f 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/util/PreferencesUtils.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/util/PreferencesUtils.java
@@ -51,8 +51,9 @@ public class PreferencesUtils {
public static final boolean CHART_SHOW_SPEED_DEFAULT = true;
public static final String DEFAULT_ACTIVITY_DEFAULT = "";
- public static final boolean DEFAULT_MAP_PUBLIC_DEFAULT = true;
+ public static final boolean DEFAULT_MAP_PUBLIC_DEFAULT = false;
public static final int FREQUENCY_OFF = 0;
+ public static final String GOOGLE_ACCOUNT_DEFAULT = "";
public static final int MAX_RECORDING_DISTANCE_DEFAULT = 200;
public static final boolean METRIC_UNITS_DEFAULT = true;
public static final int MIN_RECORDING_DISTANCE_DEFAULT = 5;
@@ -72,8 +73,8 @@ public class PreferencesUtils {
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_MAPS_DEFAULT = true;
- public static final String SHARING_ACCOUNT_DEFAULT = "";
public static final boolean SHOW_CHECK_UNITS_DIALOG_DEFAULT = true;
+ public static final boolean SHOW_CONFIRM_SHARING_DIALOG_DEFAULT = true;
public static final boolean SHOW_WELCOME_DIALOG_DEFAULT = true;
public static final int SPLIT_FREQUENCY_DEFAULT = 0;
diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/TrackNameUtils.java b/MyTracks/src/com/google/android/apps/mytracks/util/TrackNameUtils.java
index 2604ef6a4..0dd4ec238 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/util/TrackNameUtils.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/util/TrackNameUtils.java
@@ -79,8 +79,11 @@ public class TrackNameUtils {
if (location != null) {
return getReverseGeoCoding(context, location);
} else {
- // assume startTime != -1L when location == null
- return StringUtils.formatDateTime(context, startTime);
+ // Use the startTime if available
+ if (startTime != -1L) {
+ return StringUtils.formatDateTime(context, startTime);
+ }
+ return null;
}
}
}