mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Replace with enum two strings that were in strings.xml but were used as (#2939)
constants. Remove strings from strings.xml Issue # 2931
This commit is contained in:
parent
2164fb00f3
commit
41b53f4560
3 changed files with 11 additions and 7 deletions
|
|
@ -20,6 +20,7 @@ import fr.free.nrw.commons.mwapi.MediaWikiApi;
|
|||
import fr.free.nrw.commons.notification.NotificationHelper;
|
||||
import fr.free.nrw.commons.review.ReviewActivity;
|
||||
import fr.free.nrw.commons.utils.ViewUtil;
|
||||
import fr.free.nrw.commons.review.ReviewController;
|
||||
import fr.free.nrw.commons.utils.ViewUtilWrapper;
|
||||
import io.reactivex.Single;
|
||||
import timber.log.Timber;
|
||||
|
|
@ -142,7 +143,7 @@ public class DeleteHelper {
|
|||
* @param question
|
||||
* @param problem
|
||||
*/
|
||||
public void askReasonAndExecute(Media media, Context context, String question, String problem) {
|
||||
public void askReasonAndExecute(Media media, Context context, String question, ReviewController.DeleteReason problem) {
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(context);
|
||||
alert.setTitle(question);
|
||||
|
||||
|
|
@ -152,12 +153,12 @@ public class DeleteHelper {
|
|||
String[] reasonList = {"Reason 1", "Reason 2", "Reason 3", "Reason 4"};
|
||||
|
||||
|
||||
if (problem.equals("spam")) {
|
||||
if (problem == ReviewController.DeleteReason.SPAM) {
|
||||
reasonList[0] = "A selfie";
|
||||
reasonList[1] = "Blurry";
|
||||
reasonList[2] = "Nonsense";
|
||||
reasonList[3] = "Other";
|
||||
} else if (problem.equals("copyRightViolation")) {
|
||||
} else if (problem == ReviewController.DeleteReason.COPYRIGHT_VIOLATION) {
|
||||
reasonList[0] = "Press photo";
|
||||
reasonList[1] = "Random photo from internet";
|
||||
reasonList[2] = "Logo";
|
||||
|
|
|
|||
|
|
@ -74,18 +74,23 @@ public class ReviewController {
|
|||
}
|
||||
}
|
||||
|
||||
public enum DeleteReason {
|
||||
SPAM,
|
||||
COPYRIGHT_VIOLATION
|
||||
}
|
||||
|
||||
public void reportSpam(@NonNull Activity activity) {
|
||||
deleteHelper.askReasonAndExecute(new Media("File:" + fileName),
|
||||
activity,
|
||||
activity.getResources().getString(R.string.review_spam_report_question),
|
||||
activity.getResources().getString(R.string.review_spam_report_problem));
|
||||
DeleteReason.SPAM);
|
||||
}
|
||||
|
||||
public void reportPossibleCopyRightViolation(@NonNull Activity activity) {
|
||||
deleteHelper.askReasonAndExecute(new Media("File:" + fileName),
|
||||
activity,
|
||||
activity.getResources().getString(R.string.review_c_violation_report_question),
|
||||
activity.getResources().getString(R.string.review_c_violation_report_problem));
|
||||
DeleteReason.COPYRIGHT_VIOLATION);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
|
|
|
|||
|
|
@ -497,9 +497,7 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="review_no_category">Oh, this is not even categorized!</string>
|
||||
<string name="review_category_explanation">This image is under %1$s categories.</string>
|
||||
<string name="review_spam_report_question">It is out of scope because it is</string>
|
||||
<string name="review_spam_report_problem">spam</string>
|
||||
<string name="review_c_violation_report_question">It is copyright violation because it is </string>
|
||||
<string name="review_c_violation_report_problem">copyRightViolation</string>
|
||||
<string name="review_category_yes_button_text">No, mis-categorized</string>
|
||||
<string name="review_category_no_button_text">Seems fine</string>
|
||||
<string name="review_spam_yes_button_text">No, out of scope</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue