Merge branch 'main' into bugfix/no-internet-feedback-crash

This commit is contained in:
Nicolas Raoul 2024-12-13 22:13:05 +09:00 committed by GitHub
commit 69046c3068
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 86 additions and 36 deletions

View file

@ -46,7 +46,8 @@ public class ContributionController {
private boolean isInAppCameraUpload;
public LocationPermissionCallback locationPermissionCallback;
private LocationPermissionsHelper locationPermissionsHelper;
LiveData<PagedList<Contribution>> failedAndPendingContributionList;
// Temporarily disabled, see issue [https://github.com/commons-app/apps-android-commons/issues/5847]
// LiveData<PagedList<Contribution>> failedAndPendingContributionList;
LiveData<PagedList<Contribution>> pendingContributionList;
LiveData<PagedList<Contribution>> failedContributionList;
@ -383,21 +384,22 @@ public class ContributionController {
}
/**
* Temporarily disabled, see issue [https://github.com/commons-app/apps-android-commons/issues/5847]
* Fetches the contributions with the state "IN_PROGRESS", "QUEUED", "PAUSED" and "FAILED" and
* then it populates the `failedAndPendingContributionList`.
**/
void getFailedAndPendingContributions() {
final PagedList.Config pagedListConfig =
(new PagedList.Config.Builder())
.setPrefetchDistance(50)
.setPageSize(10).build();
Factory<Integer, Contribution> factory;
factory = repository.fetchContributionsWithStates(
Arrays.asList(Contribution.STATE_IN_PROGRESS, Contribution.STATE_QUEUED,
Contribution.STATE_PAUSED, Contribution.STATE_FAILED));
LivePagedListBuilder livePagedListBuilder = new LivePagedListBuilder(factory,
pagedListConfig);
failedAndPendingContributionList = livePagedListBuilder.build();
}
// void getFailedAndPendingContributions() {
// final PagedList.Config pagedListConfig =
// (new PagedList.Config.Builder())
// .setPrefetchDistance(50)
// .setPageSize(10).build();
// Factory<Integer, Contribution> factory;
// factory = repository.fetchContributionsWithStates(
// Arrays.asList(Contribution.STATE_IN_PROGRESS, Contribution.STATE_QUEUED,
// Contribution.STATE_PAUSED, Contribution.STATE_FAILED));
//
// LivePagedListBuilder livePagedListBuilder = new LivePagedListBuilder(factory,
// pagedListConfig);
// failedAndPendingContributionList = livePagedListBuilder.build();
// }
}

View file

@ -303,16 +303,17 @@ public class ContributionsFragment
}
/**
* Temporarily disabled, see issue [https://github.com/commons-app/apps-android-commons/issues/5847]
* Sets the visibility of the upload icon based on the number of failed and pending
* contributions.
*/
public void setUploadIconVisibility() {
contributionController.getFailedAndPendingContributions();
contributionController.failedAndPendingContributionList.observe(getViewLifecycleOwner(),
list -> {
updateUploadIcon(list.size());
});
}
// public void setUploadIconVisibility() {
// contributionController.getFailedAndPendingContributions();
// contributionController.failedAndPendingContributionList.observe(getViewLifecycleOwner(),
// list -> {
// updateUploadIcon(list.size());
// });
// }
/**
* Sets the count for the upload icon based on the number of pending and failed contributions.
@ -531,7 +532,8 @@ public class ContributionsFragment
if (!isUserProfile) {
setNotificationCount();
fetchCampaigns();
setUploadIconVisibility();
// Temporarily disabled, see issue [https://github.com/commons-app/apps-android-commons/issues/5847]
// setUploadIconVisibility();
setUploadIconCount();
}
}
@ -757,19 +759,18 @@ public class ContributionsFragment
}
/**
* Updates the visibility of the pending uploads ImageView based on the given count.
*
* Temporarily disabled, see issue [https://github.com/commons-app/apps-android-commons/issues/5847]
* @param count The number of pending uploads.
*/
public void updateUploadIcon(int count) {
if (pendingUploadsImageView != null) {
if (count != 0) {
pendingUploadsImageView.setVisibility(View.VISIBLE);
} else {
pendingUploadsImageView.setVisibility(View.GONE);
}
}
}
// public void updateUploadIcon(int count) {
// if (pendingUploadsImageView != null) {
// if (count != 0) {
// pendingUploadsImageView.setVisibility(View.VISIBLE);
// } else {
// pendingUploadsImageView.setVisibility(View.GONE);
// }
// }
// }
/**
* Replace whatever is in the current contributionsFragmentContainer view with

View file

@ -14,10 +14,10 @@
android:id="@+id/pending_uploads_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginEnd="@dimen/activity_margin_horizontal"
android:layout_marginRight="@dimen/activity_margin_horizontal"
android:gravity="center"
android:visibility="visible"
app:srcCompat="?attr/upload_icon_drawable" />
<TextView

View file

@ -804,4 +804,10 @@
<string name="red_pin">Dette sted har endnu ikke noget billede, så gå hen og tag et!</string>
<string name="green_pin">Dette sted har allerede et billede.</string>
<string name="grey_pin">Tjekker nu, om dette sted har et billede.</string>
<string name="error_while_loading">Fejl under indlæsning</string>
<string name="no_usages_found">Ingen anvendelser fundet</string>
<string name="usages_on_commons_heading">Commons</string>
<string name="usages_on_other_wikis_heading">Andre wikier</string>
<string name="bullet_point"></string>
<string name="file_usages_container_heading">Filanvendelser</string>
</resources>

View file

@ -43,6 +43,7 @@
* Miguel2706
* Mirzali
* No se
* Osvaldorino
* Pompilos
* Raos10
* Rodney Araujo
@ -407,6 +408,7 @@
<string name="delete">Borrar</string>
<string name="Achievements">Logros</string>
<string name="Profile">Perfil</string>
<string name="badges">Las insignias</string>
<string name="statistics">Estadísticas</string>
<string name="statistics_thanks">Agradecimientos recibidos</string>
<string name="statistics_featured">Imágenes destacadas</string>

View file

@ -842,4 +842,10 @@
<string name="red_pin">Cet endroit n\'a pas encore de photo, allez en prendre une !</string>
<string name="green_pin">Cet endroit a déjà une photo.</string>
<string name="grey_pin">Je vérifie maintenant si cet endroit a une photo.</string>
<string name="error_while_loading">Erreur lors du chargement</string>
<string name="no_usages_found">Aucune utilisation trouvée</string>
<string name="usages_on_commons_heading">Commons</string>
<string name="usages_on_other_wikis_heading">Autres wikis</string>
<string name="bullet_point"></string>
<string name="file_usages_container_heading">Utilisations du fichier</string>
</resources>

View file

@ -770,4 +770,7 @@
<string name="red_pin">Questo posto non ha ancora una foto, scattane una!</string>
<string name="green_pin">Questo posto ha già una foto.</string>
<string name="grey_pin">Ora controlliamo se questo posto ha una foto.</string>
<string name="usages_on_commons_heading">Commons</string>
<string name="usages_on_other_wikis_heading">Altri wiki</string>
<string name="file_usages_container_heading">Utilizzi del file</string>
</resources>

View file

@ -389,11 +389,13 @@
<string name="delete">מחיקה</string>
<string name="Achievements">הישגים</string>
<string name="Profile">פרופיל</string>
<string name="badges">סמלים</string>
<string name="statistics">סטטיסטיקה</string>
<string name="statistics_thanks">התודה התקבלה</string>
<string name="statistics_featured">תמונות מומלצות</string>
<string name="statistics_wikidata_edits">תמונות דרך \"מקומות בסביבה\"</string>
<string name="level" fuzzy="true">רמה</string>
<string name="level">רמה %d</string>
<string name="profileLevel">%s (רמה %s)</string>
<string name="images_uploaded">תמונות שהועלו</string>
<string name="image_reverts">תמונות שלא שוחזרו</string>
<string name="images_used_by_wiki">תמונות בשימוש</string>
@ -834,4 +836,10 @@
<string name="red_pin">אין עדיין תמונה למקום הזה, אפשר פשוט לצלם אחת!</string>
<string name="green_pin">למקום הזה כבר יש תמונה.</string>
<string name="grey_pin">עכשיו מתבצעת בדיקה האם למקום הזה יש תמונה.</string>
<string name="error_while_loading">אירעה שגיאה בעת טעינה</string>
<string name="no_usages_found">לא נמצאו שימושים</string>
<string name="usages_on_commons_heading">ויקישיתוף</string>
<string name="usages_on_other_wikis_heading">אתרי ויקי אחרים</string>
<string name="bullet_point"></string>
<string name="file_usages_container_heading">שימושים בקובץ</string>
</resources>

View file

@ -526,4 +526,7 @@
<string name="custom_selector_confirm_deletion_title">Läsche confirméieren</string>
<string name="custom_selector_delete">Läschen</string>
<string name="custom_selector_cancel">Ofbriechen</string>
<string name="error_while_loading">Feeler beim Lueden</string>
<string name="usages_on_commons_heading">Commons</string>
<string name="usages_on_other_wikis_heading">Aner Wikien</string>
</resources>

View file

@ -800,4 +800,10 @@
<string name="red_pin">Местово сè уште нема слика. Направете ја!</string>
<string name="green_pin">Местово веќе има слика.</string>
<string name="grey_pin">Проверувам дали местово има слика.</string>
<string name="error_while_loading">Грешка при вчитување</string>
<string name="no_usages_found">Не најдов употреби</string>
<string name="usages_on_commons_heading">Ризница</string>
<string name="usages_on_other_wikis_heading">Други викија</string>
<string name="bullet_point"></string>
<string name="file_usages_container_heading">Употреби на податотеката</string>
</resources>

View file

@ -194,6 +194,7 @@
<string name="Achievements">ਪ੍ਰਾਪਤੀਆਂ</string>
<string name="statistics">ਅੰਕੜੇ</string>
<string name="statistics_thanks">ਧੰਨਵਾਦ ਪ੍ਰਾਪਤ ਹੋਏ</string>
<string name="level">ਪੱਧਰ %d</string>
<string name="achievements_share_message">ਆਪਣੀਆਂ ਪ੍ਰਾਪਤੀਆਂ ਨੂੰ ਆਪਣੇ ਦੋਸਤਾਂ ਨਾਲ ਸਾਂਝਾ ਕਰੋ!</string>
<string name="read_notifications">ਸੂਚਨਾਵਾਂ (ਪੜ੍ਹਿਆਂ)</string>
<string name="list_sheet">ਸੂਚੀ</string>
@ -215,4 +216,9 @@
<string name="leaderboard_column_user">ਵਰਤੋਂਕਾਰ</string>
<string name="location_updated">ਟਿਕਾਣਾ ਨਵਿਆਈਆ ਗਿਆ</string>
<string name="invalid_login_message">ਤੁਹਾਡੇ ਦਾਖਲੇ ਦੀ ਮਿਆਦ ਪੁੱਗ ਗਈ ਹੈ। ਕਿਰਪਾ ਕਰਕੇ ਦੁਬਾਰਾ ਦਾਖਲ ਹੋਵੋ।</string>
<string name="error_while_loading">ਲੱਦਨ ਵਿੱਚ ਗਲਤੀ</string>
<string name="no_usages_found">ਕੋਈ ਵਰਤੋਂ ਨਹੀਂ ਲੱਭੀ</string>
<string name="usages_on_commons_heading">ਸ਼ਾਮਲਾਟ</string>
<string name="usages_on_other_wikis_heading">ਹੋਰ ਵਿਕੀਆਂ</string>
<string name="file_usages_container_heading">ਫ਼ਾਈਲ ਦੀ ਵਰਤੋਂ</string>
</resources>

View file

@ -796,4 +796,10 @@
<string name="red_pin">Ës pòst a l\'ha ancor gnun-e fòto, ch\'a na pija un-a!</string>
<string name="green_pin">Ës pòst a l\'ha già dle fòto.</string>
<string name="grey_pin">An camin ch\'as verìfica si cost pòst -sì a l\'ha dle fòto.</string>
<string name="error_while_loading">Eror durant ël cariament</string>
<string name="no_usages_found">Gnun usagi trovà</string>
<string name="usages_on_commons_heading">Commons</string>
<string name="usages_on_other_wikis_heading">Àutre wiki</string>
<string name="bullet_point"></string>
<string name="file_usages_container_heading">Usagi dl\'archivi</string>
</resources>

View file

@ -205,4 +205,5 @@
<string name="set_up_avatar_toast_string">\"Set as avatar\" should be translated the same as {{msg-wm|Commons-android-strings-menu set avatar}}.</string>
<string name="multiple_files_depiction">{{Doc-commons-app-depicts}}</string>
<string name="custom_selector_delete">An answer to the question in {{msg-wm|Commons-android-strings-custom selector confirm deletion message}}.</string>
<string name="bullet_point">{{optional}}</string>
</resources>