diff --git a/app/src/main/java/fr/free/nrw/commons/review/ReviewActivity.java b/app/src/main/java/fr/free/nrw/commons/review/ReviewActivity.java
index 918f03048..13d945190 100644
--- a/app/src/main/java/fr/free/nrw/commons/review/ReviewActivity.java
+++ b/app/src/main/java/fr/free/nrw/commons/review/ReviewActivity.java
@@ -4,24 +4,21 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
-import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
-
-import com.facebook.drawee.view.SimpleDraweeView;
-import com.google.android.material.navigation.NavigationView;
-import com.viewpagerindicator.CirclePageIndicator;
-
-import java.util.ArrayList;
-
-import javax.inject.Inject;
-
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
+import com.facebook.drawee.view.SimpleDraweeView;
+import com.google.android.material.navigation.NavigationView;
+import com.viewpagerindicator.CirclePageIndicator;
import fr.free.nrw.commons.Media;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.auth.AuthenticatedActivity;
@@ -32,10 +29,12 @@ import fr.free.nrw.commons.utils.ViewUtil;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
+import java.util.ArrayList;
+import javax.inject.Inject;
public class ReviewActivity extends AuthenticatedActivity {
- @BindView(R.id.reviewPagerIndicator)
+ @BindView(R.id.pager_indicator_review)
public CirclePageIndicator pagerIndicator;
@BindView(R.id.toolbar)
Toolbar toolbar;
@@ -43,20 +42,16 @@ public class ReviewActivity extends AuthenticatedActivity {
NavigationView navigationView;
@BindView(R.id.drawer_layout)
DrawerLayout drawerLayout;
- @BindView(R.id.reviewPager)
+ @BindView(R.id.view_pager_review)
ReviewViewPager reviewPager;
@BindView(R.id.skip_image)
- Button skip_image_button;
- @BindView(R.id.imageView)
+ Button btnSkipImage;
+ @BindView(R.id.review_image_view)
SimpleDraweeView simpleDraweeView;
- @BindView(R.id.progressBar)
+ @BindView(R.id.pb_review_image)
ProgressBar progressBar;
- @BindView(R.id.imageCaption)
+ @BindView(R.id.tv_image_caption)
TextView imageCaption;
- @BindView(R.id.skip_image_info)
- ImageView skipImageInfo;
- @BindView(R.id.review_image_info)
- ImageView reviewImageInfo;
public ReviewPagerAdapter reviewPagerAdapter;
public ReviewController reviewController;
@Inject
@@ -96,6 +91,7 @@ public class ReviewActivity extends AuthenticatedActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_review);
ButterKnife.bind(this);
+ setSupportActionBar(toolbar);
initDrawer();
reviewController = new ReviewController(deleteHelper, this);
@@ -108,9 +104,17 @@ public class ReviewActivity extends AuthenticatedActivity {
runRandomizer(); //Run randomizer whenever everything is ready so that a first random image will be added
- skip_image_button.setOnClickListener(view -> runRandomizer());
- skipImageInfo.setOnClickListener(view -> showSkipImageInfo());
- reviewImageInfo.setOnClickListener(view -> showReviewImageInfo());
+ btnSkipImage.setOnClickListener(view -> runRandomizer());
+
+ btnSkipImage.setOnTouchListener((view, event) -> {
+ if (event.getAction() == MotionEvent.ACTION_UP && event.getRawX() >= (
+ btnSkipImage.getRight() - btnSkipImage
+ .getCompoundDrawables()[2].getBounds().width())) {
+ showSkipImageInfo();
+ return true;
+ }
+ return false;
+ });
}
@SuppressLint("CheckResult")
@@ -187,4 +191,22 @@ public class ReviewActivity extends AuthenticatedActivity {
null,
null);
}
+
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.menu_review_activty, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.menu_image_info:
+ showReviewImageInfo();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
}
diff --git a/app/src/main/java/fr/free/nrw/commons/review/ReviewImageFragment.java b/app/src/main/java/fr/free/nrw/commons/review/ReviewImageFragment.java
index 3ec22cdd3..5f4e16d29 100644
--- a/app/src/main/java/fr/free/nrw/commons/review/ReviewImageFragment.java
+++ b/app/src/main/java/fr/free/nrw/commons/review/ReviewImageFragment.java
@@ -10,11 +10,12 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
-
-import org.wikipedia.dataclient.mwapi.MwQueryPage;
-
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
+import org.wikipedia.dataclient.mwapi.MwQueryPage;
public class ReviewImageFragment extends CommonsDaggerSupportFragment {
@@ -27,16 +28,18 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
private String fileName;
private String catString;
- private View textViewQuestionContext;
- private View textViewQuestion;
-
- private Button yesButton;
- private Button noButton;
-
-
public ProgressBar progressBar;
private MwQueryPage.Revision revision;
+ @BindView(R.id.tv_review_question)
+ TextView textViewQuestion;
+ @BindView(R.id.tv_review_question_context)
+ TextView textViewQuestionContext;
+ @BindView(R.id.button_yes)
+ Button yesButton;
+ @BindView(R.id.button_no)
+ Button noButton;
+
public void update(int position, String fileName) {
this.position = position;
@@ -50,9 +53,9 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
if (catString != null && !catString.equals("") && textViewQuestionContext != null) {
catString = "" + catString + "";
String stringToConvertHtml = String.format(getResources().getString(R.string.review_category_explanation), catString);
- ((TextView) textViewQuestionContext).setText(Html.fromHtml(stringToConvertHtml));
+ textViewQuestionContext.setText(Html.fromHtml(stringToConvertHtml));
} else if (textViewQuestionContext != null) {
- ((TextView) textViewQuestionContext).setText(getResources().getString(R.string.review_no_category));
+ textViewQuestionContext.setText(getResources().getString(R.string.review_no_category));
}
}
}
@@ -68,10 +71,7 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
position = getArguments().getInt("position");
View layoutView = inflater.inflate(R.layout.fragment_review_image, container,
false);
- textViewQuestion = layoutView.findViewById(R.id.reviewQuestion);
- textViewQuestionContext = layoutView.findViewById(R.id.reviewQuestionContext);
- yesButton = layoutView.findViewById(R.id.yesButton);
- noButton = layoutView.findViewById(R.id.noButton);
+ ButterKnife.bind(this,layoutView);
String question, explanation, yesButtonText, noButtonText;
switch (position) {
@@ -118,10 +118,8 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
noButtonText = "no";
}
- noButton.setOnClickListener(view -> getReviewActivity().swipeToNext());
-
- ((TextView) textViewQuestion).setText(question);
- ((TextView) textViewQuestionContext).setText(explanation);
+ textViewQuestion.setText(question);
+ textViewQuestionContext.setText(explanation);
yesButton.setText(yesButtonText);
noButton.setText(noButtonText);
@@ -132,6 +130,11 @@ public class ReviewImageFragment extends CommonsDaggerSupportFragment {
return layoutView;
}
+ @OnClick(R.id.button_no)
+ public void onNoButtonClicked() {
+ getReviewActivity().swipeToNext();
+ }
+
private ReviewActivity getReviewActivity() {
return (ReviewActivity) requireActivity();
}
diff --git a/app/src/main/res/layout/activity_review.xml b/app/src/main/res/layout/activity_review.xml
index 51064b10c..579677559 100644
--- a/app/src/main/res/layout/activity_review.xml
+++ b/app/src/main/res/layout/activity_review.xml
@@ -1,80 +1,56 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/drawer_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
-
-
+ android:layout_height="match_parent"
+ android:orientation="vertical">
-
-
+
-
+
-
+
-
-
-
-
-
-
+
+ android:visibility="gone"
+ tools:visibility="visible"/>
-
+
-
-
+
+
+
-
+
-
-
-
+
diff --git a/app/src/main/res/layout/fragment_review_image.xml b/app/src/main/res/layout/fragment_review_image.xml
index 73111165e..6e9bb9e84 100644
--- a/app/src/main/res/layout/fragment_review_image.xml
+++ b/app/src/main/res/layout/fragment_review_image.xml
@@ -1,70 +1,80 @@
+
+
+ android:layout_above="@id/ll_container_buttons">
+
+
-
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
diff --git a/app/src/main/res/menu/menu_review_activty.xml b/app/src/main/res/menu/menu_review_activty.xml
new file mode 100644
index 000000000..a099ac6a7
--- /dev/null
+++ b/app/src/main/res/menu/menu_review_activty.xml
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 9655b2b02..95000138d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -500,14 +500,14 @@ Upload your first media by tapping on the add button.
spam
It is copyright violation because it is
copyRightViolation
- NO, MIS-CATEGORIZED
- SEEMS FINE
- NO, OUT OF SCOPE
- SEEMS FINE
- NO, COPYRIGHT VIOLATION
- SEEMS FINE
- YES, WHY NOT
- NEXT IMAGE
+ No, mis-categorized
+ Seems fine
+ No, out of scope
+ Seems fine
+ No, copyright violation
+ Seems fine
+ Yes, why not
+ Next image
Clicking this button will give you another recently uploaded image from Wikimedia Commons
You can review images and improve the quality of Wikimedia Commoms.\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.
@@ -539,4 +539,5 @@ Upload your first media by tapping on the add button.
Examples of images not to upload
SKIP THIS IMAGE
Download Failed!!. We cannot download the file without external storage permission.
+ Image Info