mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-14 06:43:06 +02:00
Update Back and reset settings, remove are you sure on the dialog title
This commit is contained in:
+5
-1
@@ -82,15 +82,19 @@ public class ConfirmDeleteDialogFragment extends DialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final long[] trackIds = getArguments().getLongArray(KEY_TRACK_IDS);
|
||||
int titleId;
|
||||
int messageId;
|
||||
if (trackIds.length == 1 && trackIds[0] == -1L) {
|
||||
titleId = R.string.track_delete_all_confirm_title;
|
||||
messageId = R.string.track_delete_all_confirm_message;
|
||||
} else {
|
||||
titleId = trackIds.length > 1 ? R.string.generic_delete_selected_confirm_title
|
||||
: R.string.track_delete_one_confirm_title;
|
||||
messageId = trackIds.length > 1 ? R.string.track_delete_multiple_confirm_message
|
||||
: R.string.track_delete_one_confirm_message;
|
||||
}
|
||||
return DialogUtils.createConfirmationDialog(
|
||||
getActivity(), messageId, new DialogInterface.OnClickListener() {
|
||||
getActivity(), titleId, getString(messageId), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onConfirmDeleteDone(trackIds);
|
||||
|
||||
+4
-4
@@ -16,11 +16,11 @@
|
||||
|
||||
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;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
@@ -92,8 +92,8 @@ public class ConfirmPlayDialogFragment extends DialogFragment {
|
||||
textView.setText(R.string.track_detail_play_confirm_message);
|
||||
checkBox = (CheckBox) view.findViewById(R.id.confirm_dialog_check_box);
|
||||
|
||||
return new AlertDialog.Builder(fragmentActivity).setNegativeButton(R.string.generic_no, null)
|
||||
.setPositiveButton(R.string.generic_yes, new DialogInterface.OnClickListener() {
|
||||
return DialogUtils.createConfirmationDialog(fragmentActivity,
|
||||
R.string.track_detail_play_confirm_title, view, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
long[] trackIds = getArguments().getLongArray(KEY_TRACK_IDS);
|
||||
@@ -101,6 +101,6 @@ public class ConfirmPlayDialogFragment extends DialogFragment {
|
||||
fragmentActivity, R.string.confirm_play_earth_key, !checkBox.isChecked());
|
||||
caller.onConfirmPlayDone(trackIds);
|
||||
}
|
||||
}).setTitle(R.string.generic_confirm_title).setView(view).create();
|
||||
});
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -77,10 +77,12 @@ public class DeleteMarkerDialogFragment extends DialogFragment {
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
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;
|
||||
return DialogUtils.createConfirmationDialog(
|
||||
fragmentActivity, messageId, new DialogInterface.OnClickListener() {
|
||||
fragmentActivity, titleId, getString(messageId), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
new Thread(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user