mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +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 | ||||
|      * 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 +535,7 @@ public class ContributionsFragment | |||
|             if (!isUserProfile) { | ||||
|                 setNotificationCount(); | ||||
|                 fetchCampaigns(); | ||||
|                 setUploadIconVisibility(); | ||||
| //                setUploadIconVisibility(); | ||||
|                 setUploadIconCount(); | ||||
|             } | ||||
|         } | ||||
|  | @ -765,15 +765,15 @@ public class ContributionsFragment | |||
|      * | ||||
|      * @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 | ||||
|  |  | |||
|  | @ -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="visible" /> | ||||
| 
 | ||||
|     <TextView | ||||
|       android:id="@+id/pending_uploads_count_badge" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bxy379987
						bxy379987