Simplify peer review button text (#3376) (#4303)

* Simplify peer review button text (#3376)

The lengthy button text was not showing correctly, discussions concluded
that the button texts could be simplified to just "yes" or "no". To ensure
code read-ability, the buttons were renamed. Also made slight code style
adjustments to ReviewImageFragment.java and fragment_review_image.md.

Bug: #3376

* Remove string translate file changes from patch
This commit is contained in:
Gabriel Lee 2021-03-24 09:38:53 +00:00 committed by GitHub
parent 0857eae082
commit 7a04a2bf9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 41 deletions

View file

@ -43,7 +43,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
// Constant variable used to store user's key name for onSaveInstanceState method
private final String SAVED_USER = "saved_user";
//Variable that stores the value of user
// Variable that stores the value of user
private String user;
public void update(int position) {
@ -81,18 +81,18 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
case SPAM:
question = getString(R.string.review_spam);
explanation = getString(R.string.review_spam_explanation);
yesButtonText = getString(R.string.review_spam_yes_button_text);
noButtonText = getString(R.string.review_spam_no_button_text);
yesButton.setOnClickListener(view -> getReviewActivity()
yesButtonText = getString(R.string.yes);
noButtonText = getString(R.string.no);
noButton.setOnClickListener(view -> getReviewActivity()
.reviewController.reportSpam(requireActivity(), getReviewCallback()));
break;
case COPYRIGHT:
enableButtons();
question = getString(R.string.review_copyright);
explanation = getString(R.string.review_copyright_explanation);
yesButtonText = getString(R.string.review_copyright_yes_button_text);
noButtonText = getString(R.string.review_copyright_no_button_text);
yesButton.setOnClickListener(view -> getReviewActivity()
yesButtonText = getString(R.string.yes);
noButtonText = getString(R.string.no);
noButton.setOnClickListener(view -> getReviewActivity()
.reviewController
.reportPossibleCopyRightViolation(requireActivity(), getReviewCallback()));
break;
@ -100,9 +100,9 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
enableButtons();
question = getString(R.string.review_category);
explanation = updateCategoriesQuestion();
yesButtonText = getString(R.string.review_category_yes_button_text);
noButtonText = getString(R.string.review_category_no_button_text);
yesButton.setOnClickListener(view -> {
yesButtonText = getString(R.string.yes);
noButtonText = getString(R.string.no);
noButton.setOnClickListener(view -> {
getReviewActivity()
.reviewController
.reportWrongCategory(requireActivity(), getReviewCallback());
@ -113,7 +113,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
enableButtons();
question = getString(R.string.review_thanks);
//Get existing user name if it is already saved using savedInstanceState else get from reviewController
// Get existing user name if it is already saved using savedInstanceState else get from reviewController
if (savedInstanceState == null) {
if (getReviewActivity().reviewController.firstRevision != null) {
user = getReviewActivity().reviewController.firstRevision.getUser();
@ -127,11 +127,12 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
explanation = getString(R.string.review_thanks_explanation, user);
}
// Note that the yes and no buttons are swapped in this section
yesButtonText = getString(R.string.review_thanks_yes_button_text);
noButtonText = getString(R.string.review_thanks_no_button_text);
yesButton.setTextColor(Color.parseColor("#228b22"));
noButton.setTextColor(Color.parseColor("#116aaa"));
yesButton.setOnClickListener(view -> {
yesButton.setTextColor(Color.parseColor("#116aaa"));
noButton.setTextColor(Color.parseColor("#228b22"));
noButton.setOnClickListener(view -> {
getReviewActivity().reviewController.sendThanks(getReviewActivity());
getReviewActivity().swipeToNext();
});
@ -202,8 +203,8 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
noButton.setAlpha(0.5f);
}
@OnClick(R.id.button_no)
void onNoButtonClicked() {
@OnClick(R.id.button_yes)
void onYesButtonClicked() {
getReviewActivity().swipeToNext();
}

View file

@ -50,6 +50,20 @@
android:padding="@dimen/miniscule_margin"
android:weightSum="2">
<Button
android:id="@+id/button_no"
android:layout_width="@dimen/dimen_0"
android:layout_height="@dimen/fragment_height"
android:layout_weight="1"
android:layout_margin="@dimen/activity_margin_horizontal"
android:background="@android:color/transparent"
android:text="@string/no"
android:enabled="false"
android:alpha="0.5"
android:textAllCaps="true"
android:textAlignment="center"
android:textColor="@color/no_button_color"/>
<Button
android:id="@+id/button_yes"
android:layout_width="@dimen/dimen_0"
@ -64,21 +78,6 @@
android:textAlignment="center"
android:textColor="@color/yes_button_color"/>
<Button
android:textAllCaps="true"
android:id="@+id/button_no"
android:layout_width="@dimen/dimen_0"
android:layout_height="@dimen/fragment_height"
android:layout_weight="1"
android:enabled="false"
android:alpha="0.5"
android:layout_margin="@dimen/activity_margin_horizontal"
android:background="@android:color/transparent"
android:text="@string/no"
android:textAlignment="center"
android:textColor="@color/no_button_color"
/>
</LinearLayout>
</RelativeLayout>

View file

@ -69,8 +69,8 @@
<color name="swipe_red" tools:ignore="MissingDefaultResource">#FF0000</color>
<color name="color_error">#FF0000</color>
<color name="yes_button_color">#B22222</color>
<color name="no_button_color">#006400</color>
<color name="yes_button_color">#006400</color>
<color name="no_button_color">#B22222</color>
<color name="current_marker_stroke">#55000000</color>
<color name="current_marker_fill">#11000000</color>

View file

@ -438,14 +438,8 @@ Upload your first media by tapping on the add button.</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_c_violation_report_question">It is copyright violation because it is</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>
<string name="review_spam_no_button_text">Seems fine</string>
<string name="review_copyright_yes_button_text">No, copyright violation</string>
<string name="review_copyright_no_button_text">Seems fine</string>
<string name="review_thanks_yes_button_text">Yes, why not</string>
<string name="review_thanks_no_button_text">Next image</string>
<string name="review_thanks_yes_button_text">Next image</string>
<string name="review_thanks_no_button_text">Yes, why not</string>
<string name="skip_image_explanation">Clicking this button will give you another recently uploaded image from Wikimedia Commons</string>
<string name="review_image_explanation">You can review images and improve the quality of Wikimedia Commons.\n The four parameters of review are: \n - Is this image in-scope? \n - Does this image follow the rules of copyright? \n - Is this image correctly categorized? \n - If all goes well you can also thank the contributor.</string>