Skip to content

Commit 7e44da8

Browse files
maskaravivekashishkumar468
authored andcommitted
Merge master (#3196)
* Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Mapped values-en-gb to values-en-rGB (#3161) Fixes "Error: Invalid resource directory name" bug. * Localisation updates from https://translatewiki.net. * Removes the "Other" deletion option mentioned in #3174 (#3183) * Localisation updates from https://translatewiki.net. * Renamed resource file to prevent build from failing (#3189) * Localisation updates from https://translatewiki.net. * Removed some jargon/slang from strings.xml (#3162) * Localisation updates from https://translatewiki.net. * solve issue Avoid 'form movements' in the login screen #1107 (#2936) * Disabled review buttons while an image is being loaded (#3185) * Disabled review buttons while an image is being loaded * Added javadocs for the new methods * Fix build
1 parent 5a2a06b commit 7e44da8

File tree

54 files changed

+580
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+580
-111
lines changed

app/src/main/java/fr/free/nrw/commons/delete/DeleteHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,17 @@ public void askReasonAndExecute(Media media,
154154
boolean[] checkedItems = {false, false, false, false};
155155
ArrayList<Integer> mUserReason = new ArrayList<>();
156156

157-
String[] reasonList = {"Reason 1", "Reason 2", "Reason 3", "Reason 4"};
157+
String[] reasonList = {"Reason 1", "Reason 2", "Reason 3"};
158158

159159

160160
if (problem == ReviewController.DeleteReason.SPAM) {
161161
reasonList[0] = context.getString(R.string.delete_helper_ask_spam_selfie);
162162
reasonList[1] = context.getString(R.string.delete_helper_ask_spam_blurry);
163163
reasonList[2] = context.getString(R.string.delete_helper_ask_spam_nonsense);
164-
reasonList[3] = context.getString(R.string.delete_helper_ask_spam_other);
165164
} else if (problem == ReviewController.DeleteReason.COPYRIGHT_VIOLATION) {
166165
reasonList[0] = context.getString(R.string.delete_helper_ask_reason_copyright_press_photo);
167166
reasonList[1] = context.getString(R.string.delete_helper_ask_reason_copyright_internet_photo);
168167
reasonList[2] = context.getString(R.string.delete_helper_ask_reason_copyright_logo);
169-
reasonList[3] = context.getString(R.string.delete_helper_ask_reason_copyright_other);
170168
}
171169

172170
alert.setMultiChoiceItems(reasonList, checkedItems, (dialogInterface, position, isChecked) -> {

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ protected void onCreate(Bundle savedInstanceState) {
120120
runRandomizer(); //Run randomizer whenever everything is ready so that a first random image will be added
121121
}
122122

123-
btnSkipImage.setOnClickListener(view -> runRandomizer());
123+
btnSkipImage.setOnClickListener(view -> {
124+
reviewPagerAdapter.disableButtons();
125+
runRandomizer();
126+
});
124127

125128
btnSkipImage.setOnTouchListener((view, event) -> {
126129
if (event.getAction() == MotionEvent.ACTION_UP && event.getRawX() >= (
@@ -142,6 +145,7 @@ public boolean runRandomizer() {
142145
.observeOn(AndroidSchedulers.mainThread())
143146
.subscribe(media -> {
144147
if (media != null) {
148+
reviewPagerAdapter.disableButtons();
145149
updateImage(media);
146150
}
147151
}));
@@ -169,6 +173,7 @@ private void updateImage(Media media) {
169173
String caption = String.format(getString(R.string.review_is_uploaded_by), fileName, revision.getUser());
170174
imageCaption.setText(caption);
171175
progressBar.setVisibility(View.GONE);
176+
reviewPagerAdapter.enableButtons();
172177
}));
173178
reviewPager.setCurrentItem(0);
174179
}

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
8181
.reviewController.reportSpam(requireActivity(), getReviewCallback()));
8282
break;
8383
case COPYRIGHT:
84+
enableButtons();
8485
question = getString(R.string.review_copyright);
8586
explanation = getString(R.string.review_copyright_explanation);
8687
yesButtonText = getString(R.string.review_copyright_yes_button_text);
@@ -90,6 +91,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
9091
.reportPossibleCopyRightViolation(requireActivity(), getReviewCallback()));
9192
break;
9293
case CATEGORY:
94+
enableButtons();
9395
question = getString(R.string.review_category);
9496
explanation = updateCategoriesQuestion();
9597
yesButtonText = getString(R.string.review_category_yes_button_text);
@@ -102,6 +104,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
102104
});
103105
break;
104106
case THANKS:
107+
enableButtons();
105108
question = getString(R.string.review_thanks);
106109
explanation = getString(R.string.review_thanks_explanation, getReviewActivity().reviewController.firstRevision.getUser());
107110
yesButtonText = getString(R.string.review_thanks_yes_button_text);
@@ -114,6 +117,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
114117
});
115118
break;
116119
default:
120+
enableButtons();
117121
question = "How did we get here?";
118122
explanation = "No idea.";
119123
yesButtonText = "yes";
@@ -142,6 +146,28 @@ public void onFailure() {
142146
};
143147
}
144148

149+
/**
150+
* This function is called when an image has
151+
* been loaded to enable the review buttons.
152+
*/
153+
public void enableButtons() {
154+
yesButton.setEnabled(true);
155+
yesButton.setAlpha(1);
156+
noButton.setEnabled(true);
157+
noButton.setAlpha(1);
158+
}
159+
160+
/**
161+
* This function is called when an image is being loaded
162+
* to disable the review buttons
163+
*/
164+
public void disableButtons() {
165+
yesButton.setEnabled(false);
166+
yesButton.setAlpha(0.5f);
167+
noButton.setEnabled(false);
168+
noButton.setAlpha(0.5f);
169+
}
170+
145171
@OnClick(R.id.button_no)
146172
void onNoButtonClicked() {
147173
getReviewActivity().swipeToNext();

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ void updateFileInformation() {
3434
}
3535
}
3636

37+
/**
38+
* This function is called when an image has
39+
* been loaded to enable the review buttons.
40+
*/
41+
public void enableButtons() {
42+
if (reviewImageFragments != null){
43+
reviewImageFragments[0].enableButtons();
44+
}
45+
}
46+
47+
/**
48+
* This function is called when an image is being loaded
49+
* to disable the review buttons
50+
*/
51+
public void disableButtons() {
52+
if (reviewImageFragments != null){
53+
reviewImageFragments[0].disableButtons();
54+
}
55+
}
56+
3757
@Override
3858
public Fragment getItem(int position) {
3959
Bundle bundle = new Bundle();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:app="http://schemas.android.com/apk/res-auto"
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
@@ -252,4 +252,4 @@
252252

253253
</RelativeLayout>
254254

255-
</ScrollView>
255+
</LinearLayout>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
android:layout_margin="@dimen/activity_margin_horizontal"
5959
android:background="@android:color/transparent"
6060
android:text="@string/yes"
61+
android:enabled="false"
62+
android:alpha="0.5"
6163
android:textAllCaps="true"
6264
android:textAlignment="center"
6365
android:textColor="@color/yes_button_color"/>
@@ -68,6 +70,8 @@
6870
android:layout_width="0dp"
6971
android:layout_height="48dp"
7072
android:layout_weight="1"
73+
android:enabled="false"
74+
android:alpha="0.5"
7175
android:layout_margin="@dimen/activity_margin_horizontal"
7276
android:background="@android:color/transparent"
7377
android:text="@string/no"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<string name="search_tab_title_categories">تصنيفات</string>
333333
<string name="explore_tab_title_featured">متميز</string>
334334
<string name="explore_tab_title_mobile">تم الرفع عبر المحمول</string>
335-
<string name="successful_wikidata_edit">تمت إضافة الصورة بنجاح إلى %1$s في ويكي بيانات!</string>
335+
<string name="successful_wikidata_edit" fuzzy="true">تمت إضافة الصورة بنجاح إلى %1$s في ويكي بيانات!</string>
336336
<string name="wikidata_edit_failure">فشل في تحديث كيان ويكي بيانات المقابل!</string>
337337
<string name="menu_set_wallpaper">تعيين كخلفية</string>
338338
<string name="wallpaper_set_successfully">تم تعيين خلفية بنجاح!</string>
@@ -458,7 +458,7 @@
458458
<string name="check_category_edit_summary">جارٍ طلب التحقق من التصنيف</string>
459459
<string name="check_category_success_title">تم طلب التحقق من التصنيف</string>
460460
<string name="check_category_failure_title">طلب التحقق من التصنيف لم ينجح</string>
461-
<string name="check_category_success_message">تم طلب التحقق بنجاح من التصنيف %1$s</string>
461+
<string name="check_category_success_message" fuzzy="true">تم طلب التحقق بنجاح من التصنيف %1$s</string>
462462
<string name="check_category_failure_message">لا يمكن طلب التحقق من التصنيف %1$s</string>
463463
<string name="check_category_toast">جارٍ طلب التحقق من التصنيف %1$s</string>
464464
<string name="nominate_for_deletion_edit_file_page">إضافة رسالة حذف إلى الملف</string>
@@ -540,7 +540,7 @@
540540
<string name="delete_helper_make_deletion_toast">تجري محاولة ترشيح %1$s للحذف</string>
541541
<string name="delete_helper_show_deletion_title">ترشيح للحذف</string>
542542
<string name="delete_helper_show_deletion_title_success">نجاح</string>
543-
<string name="delete_helper_show_deletion_message_if">تم بنجاح ترشيح %1$s للحذف.</string>
543+
<string name="delete_helper_show_deletion_message_if" fuzzy="true">تم بنجاح ترشيح %1$s للحذف.</string>
544544
<string name="delete_helper_show_deletion_title_failed">فشل</string>
545545
<string name="delete_helper_show_deletion_message_else">لا يمكن طلب الحذف.</string>
546546
<string name="delete_helper_ask_spam_selfie">سيلفي</string>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
<string name="search_tab_title_categories">Categoríes</string>
323323
<string name="explore_tab_title_featured">Destacada</string>
324324
<string name="explore_tab_title_mobile">Xubío dende\'l móvil</string>
325-
<string name="successful_wikidata_edit">Añadióse correutamente la imaxe a %1$s en Wikidata.</string>
325+
<string name="successful_wikidata_edit" fuzzy="true">Añadióse correutamente la imaxe a %1$s en Wikidata.</string>
326326
<string name="wikidata_edit_failure">Nun pudo anovase la entidá de Wikidata correspondiente.</string>
327327
<string name="menu_set_wallpaper">Poner como fondu</string>
328328
<string name="wallpaper_set_successfully">Fondu definíu correutamente</string>
@@ -506,7 +506,7 @@
506506
<string name="delete_helper_make_deletion_toast">Tentando marcar %1$s pal so desaniciu</string>
507507
<string name="delete_helper_show_deletion_title">Marcando pa desaniciar</string>
508508
<string name="delete_helper_show_deletion_title_success">Correuto</string>
509-
<string name="delete_helper_show_deletion_message_if">Marcóse correutamente %1$s pa desaniciar.</string>
509+
<string name="delete_helper_show_deletion_message_if" fuzzy="true">Marcóse correutamente %1$s pa desaniciar.</string>
510510
<string name="delete_helper_show_deletion_title_failed">Falló</string>
511511
<string name="delete_helper_show_deletion_message_else">Non pudo pidise\'l desaniciu.</string>
512512
<string name="delete_helper_ask_spam_selfie">Un autorretratu</string>

app/src/main/res/values-b+sr+Latn/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
<string name="provider_searches">Nedavno pretraženi upiti</string>
291291
<string name="error_loading_categories">Došlo je do greške pri učitavanju kategorija.</string>
292292
<string name="error_loading_subcategories">Došlo je do greške pri učitavanju potkategorija.</string>
293-
<string name="successful_wikidata_edit">Slika je uspešno dodata u %1$s na Vikipodacima.</string>
293+
<string name="successful_wikidata_edit" fuzzy="true">Slika je uspešno dodata u %1$s na Vikipodacima.</string>
294294
<string name="wikidata_edit_failure">Ažuriranje odgovarajućeg entiteta na Vikipodacima nije uspelo.</string>
295295
<string name="menu_set_wallpaper">Postavi kao pozadinu</string>
296296
<string name="wallpaper_set_successfully">Pozadina je uspešno postavljena.</string>

app/src/main/res/values-b+tg+Cyrl/strings.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<string name="app_name" fuzzy="true">Анбори Викимедиа</string>
3+
<string name="title_activity_explore">Омӯзиш</string>
4+
<string name="navigation_item_explore">Омӯзиш</string>
5+
<string name="preference_category_appearance">Намуд</string>
46
<string name="preference_category_general">Умумӣ</string>
57
<string name="preference_category_feedback">Пешниҳод</string>
68
<string name="preference_category_privacy">Ҳарими хусусӣ</string>
79
<string name="preference_category_location">Мавқеъ</string>
810
<string name="menu_settings">Танзимот</string>
911
<string name="username">Номи корбар</string>
1012
<string name="password">Гузарвожа</string>
13+
<string name="login_credential">Вурудшавӣ ба ҳисоби Commons Beta</string>
1114
<string name="login">Вуруд</string>
15+
<string name="forgot_password">Гузарвожаро фаромӯш кардед?</string>
16+
<string name="signup">Номнависӣ</string>
1217
<string name="logging_in_title">Дар ҳоли вуруд</string>
1318
<string name="logging_in_message">Лутфан мунтазир шавед…</string>
1419
<string name="login_success">Вуруд бо муваффақият!</string>
1520
<string name="login_failed">Вуруд номуваффақ шуд!</string>
21+
<string name="upload_failed">Парванда ёфта нашуд. Лутфан парвандаи дигареро интихоб кунед.</string>
22+
<string name="uploading_started">Боркунӣ оғоз шуд.</string>
1623
<string name="upload_failed_notification_subtitle">Барои дидан нохун занед</string>
1724
<string name="title_activity_contributions" fuzzy="true">Боргузориҳои ман</string>
1825
<string name="contribution_state_queued">Дар саф</string>
@@ -36,6 +43,7 @@
3643
<string name="display_list_button">Рӯйхат</string>
3744
<string name="categories_activity_title">Гурӯҳҳо</string>
3845
<string name="title_activity_settings">Танзимот</string>
46+
<string name="title_activity_signup">Номнависӣ</string>
3947
<string name="title_activity_category_details">Гурӯҳ</string>
4048
<string name="menu_about">Дар бораи</string>
4149
<string name="title_activity_about">Дар бораи</string>
@@ -103,6 +111,14 @@
103111
<string name="quiz">Пурсиш</string>
104112
<string name="question">Савол</string>
105113
<string name="result">Натиҷа</string>
114+
<string name="continue_message">Идома</string>
115+
<string name="correct">Ҷавоби дуруст</string>
116+
<string name="wrong">Ҷавоби хато</string>
117+
<string name="add_description">+ Иловаи тавзеҳот</string>
118+
<string name="no_recent_searches">Ҷустаниҳои охире нест</string>
119+
<string name="delete_search_dialog">Шумо аниқ мехоҳед ин ҷустаниро ҳазф кунед?</string>
120+
<string name="search_history_deleted">Таърихи ҷустуҷӯҳо ҳазф шуд</string>
121+
<string name="nominate_delete">Номзад барои ҳазф</string>
106122
<string name="delete">Ҳазв</string>
107123
<string name="statistics">Омор</string>
108124
<string name="level">Сатҳ</string>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Authors:
3+
* Ерней
4+
-->
5+
<resources>
6+
<string name="crash_dialog_ok_toast">Рәхмәт!</string>
7+
</resources>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<string name="categories_activity_title">Категории</string>
8282
<string name="title_activity_settings">Настройки</string>
8383
<string name="title_activity_signup">Регистриране</string>
84-
<string name="title_activity_featured_images">Избрани картини</string>
84+
<string name="title_activity_featured_images">Избрани изображения</string>
8585
<string name="title_activity_category_details">Категория</string>
8686
<string name="menu_about">За приложението</string>
8787
<string name="about_license">Приложението на Commons е с отворен код. Неговите създатели и поддръжници са получателите на ресурсите на общността на Уикимедия, както и на членовете на общността. Фондация Уикимедия не участва в създаването, развитието и поддръжката.</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
<string name="error_loading_categories">Ur fazi zo bet pa\'z oc\'h bet o pellgargañ rummadoù</string>
297297
<string name="search_tab_title_media" fuzzy="true">MEDIA</string>
298298
<string name="search_tab_title_categories" fuzzy="true">RUMMADOÙ</string>
299-
<string name="successful_wikidata_edit">Skeudenn ouzhpennet mat da %1$s e Wikidata !</string>
299+
<string name="successful_wikidata_edit" fuzzy="true">Skeudenn ouzhpennet mat da %1$s e Wikidata !</string>
300300
<string name="menu_set_wallpaper">Spisaat evel drekleur</string>
301301
<string name="quiz">Kwiz</string>
302302
<string name="question">Goulenn</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
<string name="error_loading_subcategories">Chyba při načítání podkategorií.</string>
325325
<string name="search_tab_title_media" fuzzy="true">MÉDIA</string>
326326
<string name="search_tab_title_categories" fuzzy="true">KATEGORIE</string>
327-
<string name="successful_wikidata_edit">Obrázek byl úspěšně přidán do položky %1$s na Wikidatech!</string>
327+
<string name="successful_wikidata_edit">Obrázek byl přidán do položky %1$s na Wikidatech!</string>
328328
<string name="wikidata_edit_failure">Nepodařilo se aktualizovat příslušnou položku na Wikidatech!</string>
329329
<string name="menu_set_wallpaper">Nastavit jako pozadí</string>
330330
<string name="wallpaper_set_successfully">Pozadí bylo úspěšně nastaveno!</string>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,5 @@
228228
<string name="menu_search_button">Chwilio</string>
229229
<string name="search_commons">Chwilio o fewn Comin</string>
230230
<string name="title_activity_search">Chwilio</string>
231-
<string name="successful_wikidata_edit">Mae %1$s o luniau wedi\'u hychwanegu ar Wicidata!</string>
231+
<string name="successful_wikidata_edit" fuzzy="true">Mae %1$s o luniau wedi\'u hychwanegu ar Wicidata!</string>
232232
</resources>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
<string name="search_tab_title_categories">Kategorien</string>
329329
<string name="explore_tab_title_featured">Vorgestellt</string>
330330
<string name="explore_tab_title_mobile">Über mobil hochgeladen</string>
331-
<string name="successful_wikidata_edit">Bild erfolgreich nach %1$s auf Wikidata hinzugefügt!</string>
331+
<string name="successful_wikidata_edit" fuzzy="true">Bild erfolgreich nach %1$s auf Wikidata hinzugefügt!</string>
332332
<string name="wikidata_edit_failure">Fehler bei der Aktualisierung des dazugehörigen Wikidata-Objekts!</string>
333333
<string name="menu_set_wallpaper">Als Hintergrundbild festlegen</string>
334334
<string name="wallpaper_set_successfully">Hintergrundbild erfolgreich festgelegt!</string>
@@ -454,7 +454,7 @@
454454
<string name="check_category_edit_summary">Kategorieprüfung anfordern</string>
455455
<string name="check_category_success_title">Kategorieprüfung angefordert</string>
456456
<string name="check_category_failure_title">Die Anfrage zur Kategorieprüfung funktionierte nicht</string>
457-
<string name="check_category_success_message">Kategorieprüfung für %1$s erfolgreich angefordert</string>
457+
<string name="check_category_success_message" fuzzy="true">Kategorieprüfung für %1$s erfolgreich angefordert</string>
458458
<string name="check_category_failure_message">Eine Kategorieprüfung für %1$s konnte nicht angefordert werden</string>
459459
<string name="check_category_toast">Kategorieprüfung für %1$s anfordern</string>
460460
<string name="nominate_for_deletion_edit_file_page">Löschnachricht zur Datei hinzufügen</string>

0 commit comments

Comments
 (0)