Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue5847 as required(make the icon always visible and just adjust the count accordingly) #5901

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,13 @@ public void setNotificationCount() {
* 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.
Expand Down Expand Up @@ -535,7 +535,7 @@ public void onResume() {
if (!isUserProfile) {
setNotificationCount();
fetchCampaigns();
setUploadIconVisibility();
// setUploadIconVisibility();
setUploadIconCount();
}
}
Expand Down Expand Up @@ -765,15 +765,15 @@ public void updateErrorIcon(int errorCount) {
*
* @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
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/pending_uploads_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
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"
app:srcCompat="?attr/upload_icon_drawable" />
android:visibility="visible"
app:srcCompat="?attr/upload_icon_drawable"
tools:visibility="gone" />

<TextView
android:id="@+id/pending_uploads_count_badge"
Expand Down