Skip to content

Commit 874e761

Browse files
silkypriyadomdomegg
authored andcommitted
Add information icons to explan peer review activity (commons-app#2783)
1 parent 3876e1c commit 874e761

File tree

3 files changed

+70
-9
lines changed

3 files changed

+70
-9
lines changed

app/src/main/java/fr/free/nrw/commons/review/ReviewActivity.java

+31-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.os.Bundle;
77
import android.view.View;
88
import android.widget.Button;
9+
import android.widget.ImageView;
910
import android.widget.ProgressBar;
1011
import android.widget.TextView;
1112

@@ -17,16 +18,20 @@
1718

1819
import javax.inject.Inject;
1920

21+
import androidx.appcompat.app.AlertDialog;
2022
import androidx.appcompat.widget.Toolbar;
2123
import androidx.drawerlayout.widget.DrawerLayout;
2224
import butterknife.BindView;
2325
import butterknife.ButterKnife;
26+
import butterknife.OnClick;
2427
import fr.free.nrw.commons.Media;
2528
import fr.free.nrw.commons.R;
2629
import fr.free.nrw.commons.Utils;
30+
import fr.free.nrw.commons.achievements.AchievementsActivity;
2731
import fr.free.nrw.commons.auth.AuthenticatedActivity;
2832
import fr.free.nrw.commons.delete.DeleteHelper;
2933
import fr.free.nrw.commons.mwapi.MediaWikiApi;
34+
import fr.free.nrw.commons.utils.DialogUtil;
3035
import fr.free.nrw.commons.utils.MediaDataExtractorUtil;
3136
import fr.free.nrw.commons.utils.ViewUtil;
3237
import io.reactivex.android.schedulers.AndroidSchedulers;
@@ -55,10 +60,12 @@ public class ReviewActivity extends AuthenticatedActivity {
5560
ProgressBar progressBar;
5661
@BindView(R.id.imageCaption)
5762
TextView imageCaption;
58-
63+
@BindView(R.id.skip_image_info)
64+
ImageView skipImageInfo;
65+
@BindView(R.id.review_image_info)
66+
ImageView reviewImageInfo;
5967
public ReviewPagerAdapter reviewPagerAdapter;
6068
public ReviewController reviewController;
61-
6269
@Inject
6370
MediaWikiApi mwApi;
6471
@Inject
@@ -107,6 +114,8 @@ protected void onCreate(Bundle savedInstanceState) {
107114
runRandomizer(); //Run randomizer whenever everything is ready so that a first random image will be added
108115

109116
skip_image_button.setOnClickListener(view -> runRandomizer());
117+
skipImageInfo.setOnClickListener(view -> showSkipImageInfo());
118+
reviewImageInfo.setOnClickListener(view -> showReviewImageInfo());
110119
}
111120

112121
@SuppressLint("CheckResult")
@@ -168,4 +177,24 @@ public void swipeToNext() {
168177
runRandomizer();
169178
}
170179
}
180+
181+
public void showSkipImageInfo(){
182+
DialogUtil.showAlertDialog(ReviewActivity.this,
183+
getString(R.string.skip_image),
184+
getString(R.string.skip_image_explanation),
185+
getString(android.R.string.ok),
186+
"",
187+
null,
188+
null);
189+
}
190+
191+
public void showReviewImageInfo() {
192+
DialogUtil.showAlertDialog(ReviewActivity.this,
193+
getString(R.string.title_activity_review),
194+
getString(R.string.review_image_explanation),
195+
getString(android.R.string.ok),
196+
"",
197+
null,
198+
null);
199+
}
171200
}

app/src/main/res/layout/activity_review.xml

+37-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
android:id="@+id/drawer_layout"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent">
@@ -15,19 +16,48 @@
1516

1617
<include layout="@layout/toolbar" />
1718

18-
<Button
19-
android:id="@+id/skip_image"
19+
<ImageView
20+
android:layout_width="22dp"
21+
android:layout_height="22dp"
22+
android:id="@+id/review_image_info"
23+
app:srcCompat="@drawable/ic_info_outline_24dp"
24+
android:tint="@color/white"
25+
android:layout_alignParentRight="true"
26+
android:layout_margin="20dp"/>
27+
28+
<LinearLayout
29+
android:id="@+id/skip_image_row"
2030
android:layout_width="match_parent"
2131
android:layout_height="25dp"
22-
android:background="@android:color/transparent"
2332
android:layout_below="@+id/toolbar"
24-
android:text="@string/skip_image"
25-
android:textColor="@color/button_blue_dark"
26-
android:textStyle="bold" />
33+
android:orientation="horizontal">
34+
35+
<Button
36+
android:id="@+id/skip_image"
37+
android:layout_width="130dp"
38+
android:layout_height="match_parent"
39+
android:background="@android:color/transparent"
40+
android:text="@string/skip_image"
41+
android:textColor="@color/button_blue_dark"
42+
android:textStyle="bold"
43+
android:layout_marginLeft="120dp"/>
44+
45+
<ImageView
46+
android:layout_width="15dp"
47+
android:layout_height="15dp"
48+
android:id="@+id/skip_image_info"
49+
android:layout_marginTop="4dp"
50+
android:layout_marginRight="@dimen/activity_margin_horizontal"
51+
android:layout_marginEnd="@dimen/activity_margin_horizontal"
52+
android:layout_gravity="top"
53+
app:srcCompat="@drawable/ic_info_outline_24dp"
54+
android:tint="@color/button_blue_dark" />
55+
56+
</LinearLayout>
2757
<ScrollView
2858
android:layout_width="match_parent"
2959
android:layout_height="wrap_content"
30-
android:layout_below="@+id/skip_image"
60+
android:layout_below="@+id/skip_image_row"
3161
android:layout_above="@+id/reviewPagerIndicator"
3262
>
3363

app/src/main/res/values/strings.xml

+2
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ Upload your first media by tapping on the add button.</string>
508508
<string name="review_copyright_no_button_text">SEEMS FINE</string>
509509
<string name="review_thanks_yes_button_text">YES, WHY NOT</string>
510510
<string name="review_thanks_no_button_text">NEXT IMAGE</string>
511+
<string name="skip_image_explanation">Clicking this button will give you another recently uploaded image from Wikimedia Commons</string>
512+
<string name="review_image_explanation">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.</string>
511513

512514
<plurals name="receiving_shared_content">
513515
<item quantity="one">Receiving shared content. Processing the image might take some time depending on the size of the image and your device</item>

0 commit comments

Comments
 (0)