Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5661 statistics to badges #5917

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

YujingZHG
Copy link

Description (required)

Fixes #5661

What changes did you make and why?

Transformed the statistics of achievement into badges. Each badge changes to gray and hides its count if the value is 0.

  • Added badgeRender(Map<ImageView, TextView> badgeMap) function, used to render badges with a filter, and the GrayFilter(ImageView imageView) function applies the gray filter.

  • Used Google’s FlexboxLayout to enable badges to wrap automatically in the layout.

  • Added String Badges in Strings.xml, drawable badge_number_background.xml in drawable for displaying.

Tests performed (required)

Tested AchievementsFragmentUnitTests on Medium Phone API 33 (Android 13.0 "Tiramisu" | arm64 emulator).

Screenshots (for UI changes only)
Set badges numbers to 0
image
None 0 badges
image


  • I've read CONTRIBUTING.md

@nicolas-raoul
Copy link
Member

Looks great! :-)

@YujingZHG
Copy link
Author

Hi @nicolas-raoul what should I do with the failing check? or just leave it there?

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested, it is generally great, I only found these issues:

  • Tapping the "featured images" icon shows the "thanks received" tooltip.
  • Tapping the "quality images" icon shows the "featured images" tooltip.
  • I am pretty sure I have 100+ nearby uploads and zero featured images, but I see this:
    Screenshot_20241104-101610~2.png

If the count was already incorrect in the main branch, then no need to fix the count.

@@ -370,7 +370,8 @@
<string name="delete">Delete</string>
<string name="Achievements">Achievements</string>
<string name="Profile">Profile</string>
<string name="statistics">Statistics</string>
<string name="statistics">Badges</string>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this one be removed?

@nicolas-raoul
Copy link
Member

I will check whether unit tests fail in master. If yes then don't worry.

@nicolas-raoul
Copy link
Member

Please do not worry about unit tests, this is tracked at #5921

But do you have time to check #5917 (review) ? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transform the achievement page's "statistics" section into a "badges" section
2 participants