Skip to content

Commit

Permalink
hide statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
neeldoshii committed Mar 28, 2024
1 parent 2f94524 commit 759016d
Showing 1 changed file with 38 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<JSONobject>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 759016d

Please sign in to comment.