diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionController.java b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionController.java index fcfd32974..4bb07d191 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionController.java +++ b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionController.java @@ -46,7 +46,8 @@ public class ContributionController { private boolean isInAppCameraUpload; public LocationPermissionCallback locationPermissionCallback; private LocationPermissionsHelper locationPermissionsHelper; - LiveData> failedAndPendingContributionList; + // Temporarily disabled, see issue [https://github.com/commons-app/apps-android-commons/issues/5847] + // LiveData> failedAndPendingContributionList; LiveData> pendingContributionList; LiveData> 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 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 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(); +// } } diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java index a840aa8e1..d180dde6b 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java @@ -307,16 +307,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. @@ -535,7 +536,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(); } } @@ -761,19 +763,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 diff --git a/app/src/main/res/layout/pending_uploads_icon.xml b/app/src/main/res/layout/pending_uploads_icon.xml index 717bbd3bf..34a0b637e 100644 --- a/app/src/main/res/layout/pending_uploads_icon.xml +++ b/app/src/main/res/layout/pending_uploads_icon.xml @@ -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" />