Improve delete marker confirmation tite and message

This commit is contained in:
Jimmy Shih
2013-12-11 10:30:33 -08:00
parent 7cbda8a9d5
commit 20bd0287dc
4 changed files with 25 additions and 11 deletions
+10 -6
View File
@@ -789,8 +789,12 @@ limitations under the License.
translation_description="The text on a button to say cancel.">
Cancel
</string>
<string name="generic_delete_all_confirm_title"
translation_description="When deleting all the items, the title on the confirmation dialog.">
Delete all?
</string>
<string name="generic_delete_selected_confirm_title"
translation_description="When deleting selected items, the title of the confirmation dialog.">
translation_description="When deleting selected items, the title on the confirmation dialog.">
Delete selected?
</string>
<string name="generic_description"
@@ -1038,6 +1042,10 @@ limitations under the License.
translation_description="When adding a marker, the message indicating it is canceled.">
Canceled, no marker added.
</string>
<string name="marker_delete_all_confirm_message"
translation_description="When deleting all markers, the confirmation message.">
All markers for this track will be permanently deleted from the device.
</string>
<string name="marker_delete_one_confirm_message"
translation_description="When deleting one marker, the confirmation message.">
The marker will be permanently deleted from the device.
@@ -1048,7 +1056,7 @@ limitations under the License.
</string>
<string name="marker_delete_multiple_confirm_message"
translation_description="When deleting multiple markers, the confirmation message.">
All markers for this track will be permanently deleted from the device.
The selected markers will be permanently deleted from the device.
</string>
<string name="marker_label_end"
translation_description="When inserting a marker to indicate the end of a track, the marker's
@@ -2293,10 +2301,6 @@ limitations under the License.
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 and on external storage.
</string>
<string name="track_delete_all_confirm_title"
translation_description="When deleting all the tracks, the title of the confirmation dialog.">
Delete all?
</string>
<string name="track_delete_one_confirm_message"
translation_description="When deleting one track, the confirmation message.">
The track and its markers will be permanently deleted from the device. If Google Drive sync is
@@ -318,6 +318,9 @@ public class MarkerListActivity extends AbstractMyTracksActivity implements Dele
}
return true;
case R.id.list_context_menu_delete:
if (markerIds.length > 1 && markerIds.length == listView.getCount()) {
markerIds = new long[] { -1L };
}
DeleteMarkerDialogFragment.newInstance(markerIds)
.show(getSupportFragmentManager(), DeleteMarkerDialogFragment.DELETE_MARKER_DIALOG_TAG);
return true;
@@ -84,7 +84,7 @@ public class ConfirmDeleteDialogFragment extends AbstractMyTracksDialogFragment
int titleId;
int messageId;
if (trackIds.length == 1 && trackIds[0] == -1L) {
titleId = R.string.track_delete_all_confirm_title;
titleId = R.string.generic_delete_all_confirm_title;
messageId = R.string.track_delete_all_confirm_message;
} else {
titleId = trackIds.length > 1 ? R.string.generic_delete_selected_confirm_title
@@ -76,10 +76,17 @@ public class DeleteMarkerDialogFragment extends AbstractMyTracksDialogFragment {
protected Dialog createDialog() {
final FragmentActivity fragmentActivity = getActivity();
final long[] markerIds = getArguments().getLongArray(KEY_MARKER_IDS);
int titleId = markerIds.length > 1 ? R.string.generic_delete_selected_confirm_title
: R.string.marker_delete_one_confirm_title;
int messageId = markerIds.length > 1 ? R.string.marker_delete_multiple_confirm_message
: R.string.marker_delete_one_confirm_message;
int titleId;
int messageId;
if (markerIds.length == 1 && markerIds[0] == -1L) {
titleId = R.string.generic_delete_all_confirm_title;
messageId = R.string.marker_delete_all_confirm_message;
} else {
titleId = markerIds.length > 1 ? R.string.generic_delete_selected_confirm_title
: R.string.marker_delete_one_confirm_title;
messageId = markerIds.length > 1 ? R.string.marker_delete_multiple_confirm_message
: R.string.marker_delete_one_confirm_message;
}
return DialogUtils.createConfirmationDialog(
fragmentActivity, titleId, getString(messageId), new DialogInterface.OnClickListener() {
@Override