- Change the default value for the "defaultMapPublic" key to false.

Thus the default is creating new unlisted maps.
- Toggle the title of the "defaultMapPublic" setting between
  "Make new maps public" and "Make new maps unlisted".
- Fix bug in TrackNameUtil to check if startTime is -1L.
This commit is contained in:
Jimmy Shih
2012-06-11 14:55:15 -07:00
parent daa85ff675
commit 0d79893b19
5 changed files with 56 additions and 19 deletions
+20 -11
View File
@@ -1836,24 +1836,33 @@ limitations under the License.
Other apps can read, write, start/stop recording My Tracks data.
</string>
<string name="settings_sharing_map_public"
translation_description="In the 'Sharing' settings, the checkbox option to make a new map
created in Google Maps public.
translation_description="In the 'Sharing' settings, the title of the option to make new maps
created in Google Maps public, as opposed to unlisted. See
http://support.google.com/maps/bin/answer.py?answer=62845 for public versus unlisted.
Character limit: ~23 (1 line)">
Make new maps public
</string>
<string name="settings_sharing_map_public_summary_off"
<string name="settings_sharing_map_public_summary"
translation_description="In the 'Sharing' settings, the summary for the 'Make new maps public'
checkbox option when it is unchecked explaining that new maps created in Google Maps will
be unlisted, as opposed to public.">
New maps created in Google Maps will be unlisted.
</string>
<string name="settings_sharing_map_public_summary_on"
translation_description="In the 'Sharing' settings, the summary for the 'Make new maps public'
checkbox option when it is checked explaining that new maps created in Google Maps will
be public, as opposed to 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.">
New maps created in Google Maps will be public.
</string>
<string name="settings_sharing_map_unlisted"
translation_description="In the 'Sharing' settings, the title of the option to make new maps
created in Google Maps unlisted, as opposed to public. See
http://support.google.com/maps/bin/answer.py?answer=62845 for public versus unlisted.
Character limit: ~23 (1 line)">
Make new maps unlisted
</string>
<string name="settings_sharing_map_unlisted_summary"
translation_description="In the 'Sharing' settings, the summary for the 'Make new maps unlisted'
option explaining that new maps created in Google Maps will be unlisted, as opposed to public.
See http://support.google.com/maps/bin/answer.py?answer=62845 for public versus unlisted.">
New maps created in Google Maps will be unlisted.
</string>
<!-- Settings Show -->
<string name="settings_show"
+3 -4
View File
@@ -22,11 +22,10 @@ limitations under the License.
android:summary="@string/settings_sharing_account_summary"
android:title="@string/settings_sharing_account" />
<CheckBoxPreference
android:defaultValue="true"
android:defaultValue="false"
android:key="@string/default_map_public_key"
android:summaryOff="@string/settings_sharing_map_public_summary_off"
android:summaryOn="@string/settings_sharing_map_public_summary_on"
android:title="@string/settings_sharing_map_public" />
android:summaryOff="@string/settings_sharing_map_unlisted_summary"
android:summaryOn="@string/settings_sharing_map_public_summary" />
<CheckBoxPreference
android:defaultValue="false"
android:key="@string/allow_access_key"
@@ -18,6 +18,7 @@ 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;
@@ -41,7 +42,8 @@ import java.util.List;
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 +52,20 @@ public class SharingSettingsActivity extends AbstractSettingsActivity {
super.onCreate(bundle);
addPreferencesFromResource(R.xml.sharing_settings);
defaultMapPublicCheckBoxPreference = (CheckBoxPreference) findPreference(
getString(R.string.default_map_public_key));
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() {
@@ -94,4 +110,14 @@ public class SharingSettingsActivity extends AbstractSettingsActivity {
}
});
}
/**
* 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);
}
}
@@ -51,7 +51,7 @@ 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 int MAX_RECORDING_DISTANCE_DEFAULT = 200;
public static final boolean METRIC_UNITS_DEFAULT = true;
@@ -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;
}
}
}