diff --git a/app/src/main/java/fr/free/nrw/commons/profile/achievements/AchievementsFragment.java b/app/src/main/java/fr/free/nrw/commons/profile/achievements/AchievementsFragment.java index 47eb86c9d0..b9d86e074b 100644 --- a/app/src/main/java/fr/free/nrw/commons/profile/achievements/AchievementsFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/profile/achievements/AchievementsFragment.java @@ -64,7 +64,7 @@ public class AchievementsFragment extends CommonsDaggerSupportFragment { private CompositeDisposable compositeDisposable = new CompositeDisposable(); // To keep track of the number of wiki edits made by a user - private int numberOfEdits = 0; + private int numberOfEdits; private String userName; @@ -184,7 +184,7 @@ private void setAchievements() { setUploadCount(Achievements.from(response)); } else { Timber.d("success"); - // TODO Create a Method to Hide all the Statistics + hideStatistics(); binding.achievementBadgeImage.setVisibility(View.INVISIBLE); // If the number of edits made by the user are more than 150,000 // in some cases such high number of wiki edit counts cause the @@ -213,6 +213,41 @@ private void setAchievements() { } } + /** + * + */ + private void hideStatistics(){ + //Nearby Places + binding.wikidataEditsIcon.setVisibility(View.GONE); + binding.imagesNearbyData.setVisibility(View.GONE); + binding.imagesNearbyInfoIcon.setVisibility(View.GONE); + + //Featured Images + binding.featuredImageIcon.setVisibility(View.GONE); + binding.imagesFeaturedData.setVisibility(View.GONE); + binding.featuredImageIcon.setVisibility(View.GONE); + binding.wikidataEdits.setVisibility(View.GONE); + + //Quality Images + binding.featuredImageIcon.setVisibility(View.GONE); + binding.imagesFeaturedData.setVisibility(View.GONE); + binding.featuredImageIcon.setVisibility(View.GONE); + binding.imageFeatured.setVisibility(View.GONE); + + //Thanks Images + binding.qualityImageIcon.setVisibility(View.GONE); + binding.qualityImagesData.setVisibility(View.GONE); + binding.qualityImagesInfoIcon.setVisibility(View.GONE); + binding.qualityImages.setVisibility(View.GONE); + + //Nearby Places + binding.thanksImageIcon.setVisibility(View.GONE); + binding.thanksReceivedData.setVisibility(View.GONE); + binding.thanksReceivedInfoIcon.setVisibility(View.GONE); + binding.thanksReceived.setVisibility(View.GONE); + + } + /** * To call the API to fetch the count of wiki data edits * in the form of JavaRx Single object @@ -294,8 +329,7 @@ private void setAchievementsUploadCount(Achievements achievements, int uploadCou */ private void setUploadProgress(int uploadCount){ if (uploadCount==0){ - // TODO - //setZeroAchievements(); + setZeroAchievements(); }else { binding.imagesUploadedProgressbar.setVisibility(View.VISIBLE); binding.imagesUploadedProgressbar.setProgress