mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-02 15:53:55 +01:00
fix issue5847 as owner required: make the icon always visible and just adjust the count accordingly,comment the setVisibility method and make pending_upload_icon always visible
This commit is contained in:
parent
ef3f6b7977
commit
8e4833ec78
2 changed files with 20 additions and 19 deletions
|
|
@ -310,13 +310,13 @@ public class ContributionsFragment
|
||||||
* Sets the visibility of the upload icon based on the number of failed and pending
|
* Sets the visibility of the upload icon based on the number of failed and pending
|
||||||
* contributions.
|
* contributions.
|
||||||
*/
|
*/
|
||||||
public void setUploadIconVisibility() {
|
// public void setUploadIconVisibility() {
|
||||||
contributionController.getFailedAndPendingContributions();
|
// contributionController.getFailedAndPendingContributions();
|
||||||
contributionController.failedAndPendingContributionList.observe(getViewLifecycleOwner(),
|
// contributionController.failedAndPendingContributionList.observe(getViewLifecycleOwner(),
|
||||||
list -> {
|
// list -> {
|
||||||
updateUploadIcon(list.size());
|
// updateUploadIcon(list.size());
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the count for the upload icon based on the number of pending and failed contributions.
|
* Sets the count for the upload icon based on the number of pending and failed contributions.
|
||||||
|
|
@ -535,7 +535,7 @@ public class ContributionsFragment
|
||||||
if (!isUserProfile) {
|
if (!isUserProfile) {
|
||||||
setNotificationCount();
|
setNotificationCount();
|
||||||
fetchCampaigns();
|
fetchCampaigns();
|
||||||
setUploadIconVisibility();
|
// setUploadIconVisibility();
|
||||||
setUploadIconCount();
|
setUploadIconCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -765,15 +765,15 @@ public class ContributionsFragment
|
||||||
*
|
*
|
||||||
* @param count The number of pending uploads.
|
* @param count The number of pending uploads.
|
||||||
*/
|
*/
|
||||||
public void updateUploadIcon(int count) {
|
// public void updateUploadIcon(int count) {
|
||||||
if (pendingUploadsImageView != null) {
|
// if (pendingUploadsImageView != null) {
|
||||||
if (count != 0) {
|
// if (count != 0) {
|
||||||
pendingUploadsImageView.setVisibility(View.VISIBLE);
|
// pendingUploadsImageView.setVisibility(View.VISIBLE);
|
||||||
} else {
|
// } else {
|
||||||
pendingUploadsImageView.setVisibility(View.GONE);
|
// pendingUploadsImageView.setVisibility(View.GONE);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace whatever is in the current contributionsFragmentContainer view with
|
* Replace whatever is in the current contributionsFragmentContainer view with
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,12 @@
|
||||||
android:id="@+id/pending_uploads_image_view"
|
android:id="@+id/pending_uploads_image_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
app:srcCompat="?attr/upload_icon_drawable" />
|
android:visibility="visible"
|
||||||
|
app:srcCompat="?attr/upload_icon_drawable"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/pending_uploads_count_badge"
|
android:id="@+id/pending_uploads_count_badge"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue