@@ -61,7 +61,7 @@ public DeleteHelper(MediaWikiApi mwApi,
61
61
public Single <Boolean > makeDeletion (Context context , Media media , String reason ) {
62
62
viewUtil .showShortToast (context , context .getString (R .string .delete_helper_make_deletion_toast_1 )
63
63
+ " " + media .getDisplayTitle () + " " + context .getString (R .string .delete_helper_make_deletion_toast_2 ));
64
- return Single .fromCallable (() -> delete (context , media , reason ))
64
+ return Single .fromCallable (() -> delete (media , reason ))
65
65
.flatMap (result -> Single .fromCallable (() ->
66
66
showDeletionNotification (context , media , result )));
67
67
}
@@ -72,7 +72,7 @@ public Single<Boolean> makeDeletion(Context context, Media media, String reason)
72
72
* @param reason
73
73
* @return
74
74
*/
75
- private boolean delete (Context context , Media media , String reason ) {
75
+ private boolean delete (Media media , String reason ) {
76
76
String editToken ;
77
77
String authCookie ;
78
78
String summary = "Nominating " + media .getFilename () + " for deletion." ;
@@ -92,7 +92,7 @@ private boolean delete(Context context, Media media, String reason) {
92
92
reason +
93
93
" ~~~~" ;
94
94
95
- String logPageString = "\n " + " {{Commons:Deletion requests" + media .getFilename () +
95
+ String logPageString = "\n {{Commons:Deletion requests" + media .getFilename () +
96
96
"}}\n " ;
97
97
SimpleDateFormat sdf = new SimpleDateFormat ("yyyy/MM/dd" , Locale .getDefault ());
98
98
String date = sdf .format (calendar .getTime ());
@@ -124,15 +124,16 @@ private boolean delete(Context context, Media media, String reason) {
124
124
125
125
private boolean showDeletionNotification (Context context , Media media , boolean result ) {
126
126
String message ;
127
- String title = context .getString (R .string .delete_helper_show_deletion_notification_title );
127
+ String title = context .getString (R .string .delete_helper_show_deletion_title );
128
128
129
129
if (result ) {
130
- title += context .getString (R .string .delete_helper_show_deletion_notification_title_if );
131
- message = context .getString (R .string .delete_helper_show_deletion_notification_message_if_1 )+ " "
132
- + media .getDisplayTitle () + context .getString (R .string .delete_helper_show_deletion_notification_message_if_2 );
130
+ title += ": " + context .getString (R .string .delete_helper_show_deletion_title_if );
131
+ message = context .getString (R .string .delete_helper_show_deletion_message_if_1 )+ " "
132
+ + media .getDisplayTitle () + ": "
133
+ + context .getString (R .string .delete_helper_show_deletion_message_if_2 ) + "." ;
133
134
} else {
134
- title += context .getString (R .string .delete_helper_show_deletion_notification_title_else );
135
- message = context .getString (R .string .delete_helper_show_deletion_notification_message_else ) ;
135
+ title += ": " + context .getString (R .string .delete_helper_show_deletion_title_else );
136
+ message = context .getString (R .string .delete_helper_show_deletion_message_else ) + "." ;
136
137
}
137
138
138
139
String urlForDelete = BuildConfig .COMMONS_URL + "/wiki/Commons:Deletion_requests/" + media .getFilename ();
@@ -164,15 +165,15 @@ public void askReasonAndExecute(Media media,
164
165
165
166
166
167
if (problem == ReviewController .DeleteReason .SPAM ) {
167
- reasonList [0 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_spam_selfie );
168
- reasonList [1 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_spam_blurry );
169
- reasonList [2 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_spam_nonsense );
170
- reasonList [3 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_spam_other );
168
+ reasonList [0 ] = context .getString (R .string .delete_helper_ask_spam_selfie );
169
+ reasonList [1 ] = context .getString (R .string .delete_helper_ask_spam_blurry );
170
+ reasonList [2 ] = context .getString (R .string .delete_helper_ask_spam_nonsense );
171
+ reasonList [3 ] = context .getString (R .string .delete_helper_ask_spam_other );
171
172
} else if (problem == ReviewController .DeleteReason .COPYRIGHT_VIOLATION ) {
172
- reasonList [0 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_copyright_press_photo );
173
- reasonList [1 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_copyright_internet_photo );
174
- reasonList [2 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_copyright_logo );
175
- reasonList [3 ] = context .getString (R .string .delete_helper_ask_reason_and_execute_reason_copyright_other );
173
+ reasonList [0 ] = context .getString (R .string .delete_helper_ask_reason_copyright_press_photo );
174
+ reasonList [1 ] = context .getString (R .string .delete_helper_ask_reason_copyright_internet_photo );
175
+ reasonList [2 ] = context .getString (R .string .delete_helper_ask_reason_copyright_logo );
176
+ reasonList [3 ] = context .getString (R .string .delete_helper_ask_reason_copyright_other );
176
177
}
177
178
178
179
alert .setMultiChoiceItems (reasonList , checkedItems , (dialogInterface , position , isChecked ) -> {
@@ -183,9 +184,9 @@ public void askReasonAndExecute(Media media,
183
184
}
184
185
});
185
186
186
- alert .setPositiveButton (context .getString (R .string .delete_helper_ask_reason_and_execute_alert_set_positive_button ), (dialogInterface , i ) -> {
187
+ alert .setPositiveButton (context .getString (R .string .ok ), (dialogInterface , i ) -> {
187
188
188
- String reason = context .getString (R .string .delete_helper_ask_reason_and_execute_alert_set_positive_button_reason ) + " " ;
189
+ String reason = context .getString (R .string .delete_helper_ask_alert_set_positive_button_reason ) + " " ;
189
190
for (int j = 0 ; j < mUserReason .size (); j ++) {
190
191
reason = reason + reasonList [mUserReason .get (j )];
191
192
if (j != mUserReason .size () - 1 ) {
@@ -205,7 +206,7 @@ public void askReasonAndExecute(Media media,
205
206
});
206
207
207
208
});
208
- alert .setNegativeButton (context .getString (R .string .delete_helper_ask_reason_and_execute_alert_set_negative_button ), (dialog , which ) -> reviewCallback .onFailure ());
209
+ alert .setNegativeButton (context .getString (R .string .cancel ), (dialog , which ) -> reviewCallback .onFailure ());
209
210
AlertDialog d = alert .create ();
210
211
d .show ();
211
212
}
0 commit comments