Improve delete all dialog message

This commit is contained in:
Jimmy Shih
2014-01-15 14:49:04 -08:00
parent 150ce66a46
commit aec0721757
2 changed files with 15 additions and 4 deletions
+10 -3
View File
@@ -2173,10 +2173,17 @@ limitations under the License.
</string>
<!-- Track Delete -->
<string name="track_delete_all_confirm_message"
translation_description="When deleting all the tracks, the confirmation message.">
<string name="track_delete_all_confirm_message_sync_off"
translation_description="When deleting all the tracks, the confirmation message when sync to
Google Drive is off.">
All tracks and markers will be permanently deleted from the device. Exported tracks on Google
Drive and external storage will not be deleted.
</string>
<string name="track_delete_all_confirm_message_sync_on"
translation_description="When deleting all the tracks, the confirmation message when sync to
Google Drive is on.">
All tracks and markers will be permanently deleted from the device. Google Drive sync will be
turned off. No tracks will be deleted on Google Drive.
turned off. Exported tracks on Google Drive and external storage will not be deleted.
</string>
<string name="track_delete_one_confirm_message"
translation_description="When deleting one track, the confirmation message.">
@@ -17,6 +17,7 @@
package com.google.android.apps.mytracks.fragments;
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.app.Activity;
@@ -84,8 +85,11 @@ public class ConfirmDeleteDialogFragment extends AbstractMyTracksDialogFragment
int titleId;
int messageId;
if (trackIds.length == 1 && trackIds[0] == -1L) {
boolean driveSync = PreferencesUtils.getBoolean(
getActivity(), R.string.drive_sync_key, PreferencesUtils.DRIVE_SYNC_DEFAULT);
titleId = R.string.generic_delete_all_confirm_title;
messageId = R.string.track_delete_all_confirm_message;
messageId = driveSync ? R.string.track_delete_all_confirm_message_sync_on
: R.string.track_delete_all_confirm_message_sync_off;
} else {
titleId = trackIds.length > 1 ? R.string.generic_delete_selected_confirm_title
: R.string.track_delete_one_confirm_title;