Skip to content

Commit 43f314d

Browse files
maskaravivekneslihanturan
authored andcommitted
Remove commented code (commons-app#2701)
1 parent 013e1a5 commit 43f314d

File tree

2 files changed

+0
-131
lines changed

2 files changed

+0
-131
lines changed

app/src/main/java/fr/free/nrw/commons/delete/DeleteTask.java

-44
Original file line numberDiff line numberDiff line change
@@ -249,49 +249,5 @@ public void onClick(DialogInterface dialogInterface, int i) {
249249
AlertDialog d = alert.create();
250250
d.show();
251251

252-
// AlertDialog.Builder alert = new AlertDialog.Builder(context);
253-
// alert.setMessage(question);
254-
// final EditText input = ne
255-
// w EditText(context);
256-
// input.setText(defaultValue);
257-
// alert.setView(input);
258-
// input.requestFocus();
259-
// alert.setPositiveButton(R.string.ok, (dialog, whichButton) -> {
260-
// String reason = input.getText().toString();
261-
//
262-
// ((ReviewActivity)context).reviewController.swipeToNext();
263-
// ((ReviewActivity)context).runRandomizer();
264-
//
265-
// DeleteTask deleteTask = new DeleteTask(context, media, reason);
266-
// deleteTask.execute();
267-
// });
268-
// alert.setNegativeButton(R.string.cancel, (dialog, whichButton) -> {
269-
// });
270-
// AlertDialog d = alert.create();
271-
// input.addTextChangedListener(new TextWatcher() {
272-
// private void handleText() {
273-
// final Button okButton = d.getButton(AlertDialog.BUTTON_POSITIVE);
274-
// if (input.getText().length() == 0) {
275-
// okButton.setEnabled(false);
276-
// } else {
277-
// okButton.setEnabled(true);
278-
// }
279-
// }
280-
//
281-
// @Override
282-
// public void afterTextChanged(Editable arg0) {
283-
// handleText();
284-
// }
285-
//
286-
// @Override
287-
// public void beforeTextChanged(CharSequence s, int start, int count, int after) {
288-
// }
289-
//
290-
// @Override
291-
// public void onTextChanged(CharSequence s, int start, int before, int count) {
292-
// }
293-
// });
294-
// d.show();
295-
// d.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(defaultValue.length() > 0);
296252
}
297253
}

app/src/main/java/fr/free/nrw/commons/mwapi/ApacheHttpClientMediaWikiApi.java

-87
Original file line numberDiff line numberDiff line change
@@ -1032,78 +1032,6 @@ public boolean isUserBlockedFromCommons() {
10321032
return userBlocked;
10331033
}
10341034

1035-
// /**
1036-
// * This takes userName as input, which is then used to fetch the feedback/achievements
1037-
// * statistics using OkHttp and JavaRx. This function return JSONObject
1038-
// * @param userName MediaWiki user name
1039-
// * @return
1040-
// */
1041-
// @Override
1042-
// public Single<FeedbackResponse> getAchievements(String userName) {
1043-
// final String fetchAchievementUrlTemplate =
1044-
// wikiMediaToolforgeUrl + "urbanecmbot/commonsmisc/feedback.py";
1045-
// return Single.fromCallable(() -> {
1046-
// String url = String.format(
1047-
// Locale.ENGLISH,
1048-
// fetchAchievementUrlTemplate,
1049-
// new PageTitle(userName).getText());
1050-
// HttpUrl.Builder urlBuilder = HttpUrl.parse(url).newBuilder();
1051-
// urlBuilder.addQueryParameter("user", userName);
1052-
// Timber.i("Url %s", urlBuilder.toString());
1053-
// Request request = new Request.Builder()
1054-
// .url(urlBuilder.toString())
1055-
// .build();
1056-
// Response response = okHttpClient.newCall(request).execute();
1057-
// if (response != null && response.body() != null && response.isSuccessful()) {
1058-
// String json = response.body().string();
1059-
// if (json == null) {
1060-
// return null;
1061-
// }
1062-
// return gson.fromJson(json, FeedbackResponse.class);
1063-
// }
1064-
// return null;
1065-
// });
1066-
//
1067-
// }
1068-
1069-
// /**
1070-
// * The method returns the picture of the day
1071-
// *
1072-
// * @return Media object corresponding to the picture of the day
1073-
// */
1074-
// @Override
1075-
// @Nullable
1076-
// public Single<Media> getPictureOfTheDay() {
1077-
// return Single.fromCallable(() -> {
1078-
// CustomApiResult apiResult = null;
1079-
// try {
1080-
// String template = "Template:Potd/" + DateUtils.getCurrentDate();
1081-
// CustomMwApi.RequestBuilder requestBuilder = api.action("query")
1082-
// .param("generator", "images")
1083-
// .param("format", "xml")
1084-
// .param("titles", template)
1085-
// .param("prop", "imageinfo")
1086-
// .param("iiprop", "url|extmetadata");
1087-
//
1088-
// apiResult = requestBuilder.get();
1089-
// } catch (IOException e) {
1090-
// Timber.e(e, "Failed to obtain searchCategories");
1091-
// }
1092-
//
1093-
// if (apiResult == null) {
1094-
// return null;
1095-
// }
1096-
//
1097-
// CustomApiResult imageNode = apiResult.getNode("/api/query/pages/page");
1098-
// if (imageNode == null
1099-
// || imageNode.getDocument() == null) {
1100-
// return null;
1101-
// }
1102-
//
1103-
// return CategoryImageUtils.getMediaFromPage(imageNode.getDocument());
1104-
// });
1105-
// }
1106-
11071035
private Date parseMWDate(String mwDate) {
11081036
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH); // Assuming MW always gives me UTC
11091037
isoFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
@@ -1125,21 +1053,6 @@ public void logout() {
11251053
}
11261054
}
11271055

1128-
// @Override public Single<CampaignResponseDTO> getCampaigns() {
1129-
// return Single.fromCallable(() -> {
1130-
// Request request = new Request.Builder().url(WIKIMEDIA_CAMPAIGNS_BASE_URL).build();
1131-
// Response response = okHttpClient.newCall(request).execute();
1132-
// if (response != null && response.body() != null && response.isSuccessful()) {
1133-
// String json = response.body().string();
1134-
// if (json == null) {
1135-
// return null;
1136-
// }
1137-
// return gson.fromJson(json, CampaignResponseDTO.class);
1138-
// }
1139-
// return null;
1140-
// });
1141-
// }
1142-
11431056
private String formatMWDate(Date date) {
11441057
return isoFormat.format(date);
11451058
}

0 commit comments

Comments
 (0)