mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
*Distinctively show quality images and featured images in Achievements
This commit is contained in:
parent
2ea966ab09
commit
285422e23d
9 changed files with 93 additions and 2 deletions
|
|
@ -32,6 +32,15 @@ class Achievements {
|
|||
* @param featuredImages
|
||||
*/
|
||||
var featuredImages = 0
|
||||
/**
|
||||
* getter function to get count of featured images
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* setter function to set count of featured images
|
||||
* @param featuredImages
|
||||
*/
|
||||
var qualityImages = 0
|
||||
/**
|
||||
* getter function to get count of images uploaded
|
||||
* @return
|
||||
|
|
@ -57,12 +66,14 @@ class Achievements {
|
|||
articlesUsingImages: Int,
|
||||
thanksReceived: Int,
|
||||
featuredImages: Int,
|
||||
qualityImages: Int,
|
||||
imagesUploaded: Int,
|
||||
revertCount: Int) {
|
||||
this.uniqueUsedImages = uniqueUsedImages
|
||||
this.articlesUsingImages = articlesUsingImages
|
||||
this.thanksReceived = thanksReceived
|
||||
this.featuredImages = featuredImages
|
||||
this.qualityImages = qualityImages
|
||||
this.imagesUploaded = imagesUploaded
|
||||
this.revertCount = revertCount
|
||||
}
|
||||
|
|
@ -91,8 +102,8 @@ class Achievements {
|
|||
response.uniqueUsedImages,
|
||||
response.articlesUsingImages,
|
||||
response.thanksReceived,
|
||||
response.featuredImages.qualityImages
|
||||
+ response.featuredImages.featuredPicturesOnWikimediaCommons, 0,
|
||||
response.featuredImages.featuredPicturesOnWikimediaCommons,
|
||||
response.featuredImages.qualityImages, 0,
|
||||
response.deletedUploads
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ public class AchievementsFragment extends CommonsDaggerSupportFragment {
|
|||
@BindView(R.id.image_featured)
|
||||
TextView imagesFeatured;
|
||||
|
||||
@BindView(R.id.quality_images)
|
||||
TextView tvQualityImages;
|
||||
|
||||
@BindView(R.id.images_revert_limit_text)
|
||||
TextView imagesRevertLimitText;
|
||||
|
||||
|
|
@ -414,6 +417,7 @@ public class AchievementsFragment extends CommonsDaggerSupportFragment {
|
|||
imagesUsedByWikiProgressBar.setProgressTextFormatPattern
|
||||
(achievements.getUniqueUsedImages() + "/" + levelInfo.getMaxUniqueImages());
|
||||
imagesFeatured.setText(String.valueOf(achievements.getFeaturedImages()));
|
||||
tvQualityImages.setText(String.valueOf(achievements.getQualityImages()));
|
||||
String levelUpInfoString = getString(R.string.level).toUpperCase();
|
||||
levelUpInfoString += " " + levelInfo.getLevelNumber();
|
||||
levelNumber.setText(levelUpInfoString);
|
||||
|
|
@ -492,6 +496,12 @@ public class AchievementsFragment extends CommonsDaggerSupportFragment {
|
|||
,getResources().getString(R.string.thanks_received_explanation));
|
||||
}
|
||||
|
||||
@OnClick(R.id.quality_images_info)
|
||||
public void showQualityImagesInfo() {
|
||||
launchAlert(getResources().getString(R.string.statistics_quality)
|
||||
, getResources().getString(R.string.quality_images_info));
|
||||
}
|
||||
|
||||
/**
|
||||
* takes title and message as input to display alerts
|
||||
* @param title
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue