Skip to content

Commit d3bc072

Browse files
Issue #3428: Swapped text in dialog buttons (#3496)
* Issue #3428: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other * Fixed Issue #3428 so it actually works correctly now: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other * Made sure that all of the places where the two types of showAlertDialog accurately match up with the new position of positive and negative text on the dialog box Also removed occurences of empty lambda expressions and used null instead * modified deletThisPicture to be accurate lambda call * reverted mistake where ellipses replaced the three dots
1 parent d028cf1 commit d3bc072

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ private void showNearbyCardPermissionRationale() {
445445
DialogUtil.showAlertDialog(getActivity(),
446446
getString(R.string.nearby_card_permission_title),
447447
getString(R.string.nearby_card_permission_explanation),
448-
this::displayYouWontSeeNearbyMessage,
449448
this::requestLocationPermission,
449+
this::displayYouWontSeeNearbyMessage,
450450
checkBoxView,
451451
false);
452452
}

app/src/main/java/fr/free/nrw/commons/quiz/QuizChecker.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ private void callQuiz(Activity activity) {
151151
activity.getString(R.string.quiz_alert_message, REVERT_PERCENTAGE_FOR_MESSAGE),
152152
activity.getString(R.string.about_translate_proceed),
153153
activity.getString(android.R.string.cancel),
154-
() -> startQuizActivity(activity), null);
154+
() -> startQuizActivity(activity),
155+
null);
155156
}
156157

157158
private void startQuizActivity(Activity activity) {

app/src/main/java/fr/free/nrw/commons/upload/categories/UploadCategoriesFragment.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ public void showNoCategorySelected() {
167167
DialogUtil.showAlertDialog(getActivity(),
168168
getString(R.string.no_categories_selected),
169169
getString(R.string.no_categories_selected_warning_desc),
170-
getString(R.string.no_go_back),
171170
getString(R.string.yes_submit),
172-
null,
173-
() -> goToNextScreen());
171+
getString(R.string.no_go_back),
172+
() -> goToNextScreen(),
173+
null);
174+
174175
}
175176

176177
@Override

app/src/main/java/fr/free/nrw/commons/upload/mediaDetails/UploadMediaDetailFragment.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,11 @@ public void showDuplicatePicturePopup() {
354354
String.format(Locale.getDefault(),
355355
uploadTitleFormat,
356356
uploadItem.getFileName()),
357-
() -> {
358-
359-
},
360357
() -> {
361358
uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP);
362359
onNextButtonClicked();
363-
});
360+
}, null);
361+
364362
}
365363

366364
@Override
@@ -370,11 +368,12 @@ public void showBadImagePopup(Integer errorCode) {
370368
DialogUtil.showAlertDialog(getActivity(),
371369
getString(R.string.warning),
372370
errorMessageForResult,
373-
() -> deleteThisPicture(),
374371
() -> {
375372
uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP);
376373
onNextButtonClicked();
377-
});
374+
},
375+
() -> deleteThisPicture()
376+
);
378377
}
379378
//If the error message is null, we will probably not show anything
380379
}

app/src/main/java/fr/free/nrw/commons/utils/DialogUtil.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public static void showAlertDialog(Activity activity,
4444
showAlertDialog(activity,
4545
title,
4646
message,
47-
activity.getString(R.string.no),
4847
activity.getString(R.string.yes),
48+
activity.getString(R.string.no),
4949
onPositiveBtnClick,
5050
onNegativeBtnClick);
5151
}
@@ -96,8 +96,8 @@ public static void showAlertDialog(Activity activity,
9696
showAlertDialog(activity,
9797
title,
9898
message,
99-
activity.getString(R.string.no),
10099
activity.getString(R.string.yes),
100+
activity.getString(R.string.no),
101101
onPositiveBtnClick,
102102
onNegativeBtnClick,
103103
customView,

0 commit comments

Comments
 (0)