mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +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
|
* @param featuredImages
|
||||||
*/
|
*/
|
||||||
var featuredImages = 0
|
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
|
* getter function to get count of images uploaded
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -57,12 +66,14 @@ class Achievements {
|
||||||
articlesUsingImages: Int,
|
articlesUsingImages: Int,
|
||||||
thanksReceived: Int,
|
thanksReceived: Int,
|
||||||
featuredImages: Int,
|
featuredImages: Int,
|
||||||
|
qualityImages: Int,
|
||||||
imagesUploaded: Int,
|
imagesUploaded: Int,
|
||||||
revertCount: Int) {
|
revertCount: Int) {
|
||||||
this.uniqueUsedImages = uniqueUsedImages
|
this.uniqueUsedImages = uniqueUsedImages
|
||||||
this.articlesUsingImages = articlesUsingImages
|
this.articlesUsingImages = articlesUsingImages
|
||||||
this.thanksReceived = thanksReceived
|
this.thanksReceived = thanksReceived
|
||||||
this.featuredImages = featuredImages
|
this.featuredImages = featuredImages
|
||||||
|
this.qualityImages = qualityImages
|
||||||
this.imagesUploaded = imagesUploaded
|
this.imagesUploaded = imagesUploaded
|
||||||
this.revertCount = revertCount
|
this.revertCount = revertCount
|
||||||
}
|
}
|
||||||
|
|
@ -91,8 +102,8 @@ class Achievements {
|
||||||
response.uniqueUsedImages,
|
response.uniqueUsedImages,
|
||||||
response.articlesUsingImages,
|
response.articlesUsingImages,
|
||||||
response.thanksReceived,
|
response.thanksReceived,
|
||||||
response.featuredImages.qualityImages
|
response.featuredImages.featuredPicturesOnWikimediaCommons,
|
||||||
+ response.featuredImages.featuredPicturesOnWikimediaCommons, 0,
|
response.featuredImages.qualityImages, 0,
|
||||||
response.deletedUploads
|
response.deletedUploads
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,9 @@ public class AchievementsFragment extends CommonsDaggerSupportFragment {
|
||||||
@BindView(R.id.image_featured)
|
@BindView(R.id.image_featured)
|
||||||
TextView imagesFeatured;
|
TextView imagesFeatured;
|
||||||
|
|
||||||
|
@BindView(R.id.quality_images)
|
||||||
|
TextView tvQualityImages;
|
||||||
|
|
||||||
@BindView(R.id.images_revert_limit_text)
|
@BindView(R.id.images_revert_limit_text)
|
||||||
TextView imagesRevertLimitText;
|
TextView imagesRevertLimitText;
|
||||||
|
|
||||||
|
|
@ -414,6 +417,7 @@ public class AchievementsFragment extends CommonsDaggerSupportFragment {
|
||||||
imagesUsedByWikiProgressBar.setProgressTextFormatPattern
|
imagesUsedByWikiProgressBar.setProgressTextFormatPattern
|
||||||
(achievements.getUniqueUsedImages() + "/" + levelInfo.getMaxUniqueImages());
|
(achievements.getUniqueUsedImages() + "/" + levelInfo.getMaxUniqueImages());
|
||||||
imagesFeatured.setText(String.valueOf(achievements.getFeaturedImages()));
|
imagesFeatured.setText(String.valueOf(achievements.getFeaturedImages()));
|
||||||
|
tvQualityImages.setText(String.valueOf(achievements.getQualityImages()));
|
||||||
String levelUpInfoString = getString(R.string.level).toUpperCase();
|
String levelUpInfoString = getString(R.string.level).toUpperCase();
|
||||||
levelUpInfoString += " " + levelInfo.getLevelNumber();
|
levelUpInfoString += " " + levelInfo.getLevelNumber();
|
||||||
levelNumber.setText(levelUpInfoString);
|
levelNumber.setText(levelUpInfoString);
|
||||||
|
|
@ -492,6 +496,12 @@ public class AchievementsFragment extends CommonsDaggerSupportFragment {
|
||||||
,getResources().getString(R.string.thanks_received_explanation));
|
,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
|
* takes title and message as input to display alerts
|
||||||
* @param title
|
* @param title
|
||||||
|
|
|
||||||
BIN
app/src/main/res/drawable-hdpi/ic_quality_images_logo.png
Executable file
BIN
app/src/main/res/drawable-hdpi/ic_quality_images_logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_quality_images_logo.png
Executable file
BIN
app/src/main/res/drawable-mdpi/ic_quality_images_logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_quality_images_logo.png
Executable file
BIN
app/src/main/res/drawable-xhdpi/ic_quality_images_logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_quality_images_logo.png
Executable file
BIN
app/src/main/res/drawable-xxhdpi/ic_quality_images_logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_quality_images_logo.png
Executable file
BIN
app/src/main/res/drawable-xxxhdpi/ic_quality_images_logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
|
|
@ -406,6 +406,74 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginTop="@dimen/activity_margin_horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_toStartOf="@+id/quality_images"
|
||||||
|
android:layout_toLeftOf="@+id/quality_images"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/overflow_icon_dimen"
|
||||||
|
android:layout_height="@dimen/overflow_icon_dimen"
|
||||||
|
android:id="@+id/quality_image_icon"
|
||||||
|
app:srcCompat="@drawable/ic_quality_images_logo"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="?android:textAppearanceMedium"
|
||||||
|
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||||
|
android:text="@string/statistics_quality" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/medium_width"
|
||||||
|
android:layout_height="@dimen/medium_height"
|
||||||
|
android:id="@+id/quality_images_info"
|
||||||
|
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_gravity="top"
|
||||||
|
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||||
|
android:tint="@color/primaryDarkColor" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="?android:textAppearanceMedium"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
tools:text="2"
|
||||||
|
android:text="0"
|
||||||
|
android:id="@+id/quality_images"
|
||||||
|
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||||
|
android:layout_marginEnd="@dimen/half_standard_height"
|
||||||
|
android:layout_marginRight="@dimen/half_standard_height" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
||||||
|
|
@ -697,4 +697,6 @@ Upload your first media by tapping on the add button.</string>
|
||||||
<string name="limited_connection_enabled">Limited connection mode enabled!</string>
|
<string name="limited_connection_enabled">Limited connection mode enabled!</string>
|
||||||
<string name="limited_connection_disabled">Limited connection mode disabled. Pending uploads will resume now.</string>
|
<string name="limited_connection_disabled">Limited connection mode disabled. Pending uploads will resume now.</string>
|
||||||
<string name="limited_connection">Limited Connection</string>
|
<string name="limited_connection">Limited Connection</string>
|
||||||
|
<string name="statistics_quality">Quality Images</string>
|
||||||
|
<string name="quality_images_info">Quality images are diagrams or photographs that meet certain quality standards (which are mostly technical in nature) and are valuable for Wikimedia projects</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue