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

I add tiny mode and backgroudimage for the JSBadgeView #54

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

zzzworm
Copy link

@zzzworm zzzworm commented Dec 2, 2015

thanks your project!,we use it in our project,we add tiny mode and backgroudimage for the JSBadgeView, also make some propriety can modify by user. Could you consider add it to your master branch?

@zxwcool
Copy link

zxwcool commented Jan 1, 2016

how to use the 'tinymode', could U give some illustration or example?

@JaviSoto
Copy link
Owner

JaviSoto commented Jan 1, 2016

Hi! Thanks for the PR.

There are some unrelated changes in this PR. Would you mind submitting a different one for each of the features that you'd like to add / change?

Also, please take a look at the current code style to keep your code consistent with it.
And to better understand the changes, could you attach screenshots of the before and after? Thank you!

grant.zhou added 2 commits January 16, 2019 10:12
@zzzworm
Copy link
Author

zzzworm commented Jan 16, 2019

how to use the 'tinymode', could U give some illustration or example?

Hi! Thanks for the PR.

There are some unrelated changes in this PR. Would you mind submitting a different one for each of the features that you'd like to add / change?

Also, please take a look at the current code style to keep your code consistent with it.
And to better understand the changes, could you attach screenshots of the before and after? Thank you!

it shows in the demo, when number >= 100, the badge just show a red "dot"

@@ -301,19 +331,51 @@ - (void)drawRect:(CGRect)rect
const CGFloat marginToDrawInside = [self marginToDrawInside];
const CGRect rectToDraw = CGRectInset(rect, marginToDrawInside, marginToDrawInside);

UIBezierPath *borderPath = [UIBezierPath bezierPathWithRoundedRect:rectToDraw byRoundingCorners:(UIRectCorner)UIRectCornerAllCorners cornerRadii:CGSizeMake(JSBadgeViewCornerRadius, JSBadgeViewCornerRadius)];
UIBezierPath *borderPath;
Copy link
Owner

Choose a reason for hiding this comment

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

Before adding all these new features to the API, I believe this implementation would need to simplify. This class used -drawRect: back when it was doing complicated shadows and gradients. Now that it only supports "flat UI", there's no reason to continue doing this. Adding all this code just further complicates this implementation.
Given that I don't really have time to maintain this library, I will push back on these changes for that reason. I will however appreciate re-doing this view with AutoLayout, and without drawing with CoreGraphics instead.

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.

None yet

3 participants