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

Create percentage bars in Stats cards #10073

Merged
merged 5 commits into from Jun 21, 2019

Conversation

@planarvoid
Copy link
Contributor

commented Jun 20, 2019

Fixes #9459
This PR adds the percentage bar to the Posts/Pages, Authors and Tags/Categories. The logic is that the biggest value (by views) gets 100% width and the other values get width by the percentage of the biggest value. I've created a drawable for the rounded corners of the progress bar that's used for showing the progress. I've also noticed the subtext field was never used so I removed it.

To test:

  • Go to Stats/DWMY
  • Check that the Posts/Pages block contains the percentage bar
  • Check that the lines with the bar are higher
  • Check that the lines without the bar are still the same height
  • Check that the Authors block contains the percentage bar
  • Expand an Author
  • Check that the author's posts don't have the percentage bar
  • Check that the author's posts have lower height than authors
  • Go to Insights/Tags&Categories
  • Check that the items have the percentage bar
  • Check that the expanded category items don't have the percentage bar

Screenshot_1561012756
Screenshot_1561012748

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@planarvoid planarvoid added this to the 12.8 milestone Jun 20, 2019

@planarvoid planarvoid requested a review from khaykov Jun 20, 2019

@planarvoid planarvoid self-assigned this Jun 20, 2019

@planarvoid planarvoid requested a review from SylvesterWilmott Jun 20, 2019

@SylvesterWilmott

This comment has been minimized.

Copy link

commented Jun 20, 2019

Looks fantastic @planarvoid , thanks!

@khaykov
Copy link
Member

left a comment

Bar looks fancy and works well I left just one small comment about the code :)

@@ -148,6 +150,17 @@ constructor(
return items
}

private fun getBarWidth(

This comment has been minimized.

Copy link
@khaykov

khaykov Jun 21, 2019

Member

Do you think we can extract this function to some Utils class, as we are using it all around the place?

This comment has been minimized.

Copy link
@planarvoid

planarvoid Jun 21, 2019

Author Contributor

I was thinking about it :-), I think it makes sense

@khaykov khaykov self-assigned this Jun 21, 2019

@planarvoid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 21, 2019

@khaykov thanks for the review, I've extracted the common utility method and wrote some tests 👍

@khaykov
Copy link
Member

left a comment

Thanks for the fixes! Looks great 👍

@khaykov khaykov merged commit 010931d into develop Jun 21, 2019

4 checks passed

Peril All green. Well done.
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: strings-check Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details

@khaykov khaykov deleted the feature/add_row_percentage_to_stats branch Jun 21, 2019

@designsimply

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2019

Beta tested with alpha-177 and it looks great! 👍

Adding a couple screenshots for reference:

Screenshot_20190703-115236 Screenshot_20190703-115303 Screenshot_20190703-115521

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.