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

Enhancements #1

Closed
otymartin opened this issue Mar 16, 2019 · 4 comments
Closed

Enhancements #1

otymartin opened this issue Mar 16, 2019 · 4 comments

Comments

@otymartin
Copy link

@slavenko
This is perfect, I've been looking for a label that behaves just like the Robinhood app stock price label.

Some enhancements,

Can you enable some customizations like, I would like to have the fraction digits to have the same font as the whole number. I want to use it in products but when I instantiated my own SMCounterLabel and set a value, it crashed.

@slavenko
Copy link
Owner

Hi there @otymartin , sorry for not replying sooner, I was on a vacation.

I've added some quick customizations, now the font is now the same size by default, but there's a boolean property on the class: tinyDecimalNumbers which allows you to set the appropriate font size.

I can't seem to reproduce crashing issue, can you see in the debugger why and where it crashes?

TBH, this started as a fun exercise, but quickly got way too complicated, and now I'm planing to rewrite everything from the start, I'm having some trouble with the text alignment, and some strange animation issues, so keep that in mind if you plan to use this on anything semi-serious. This is not production ready code at all, but I hope it will be soon. Cheers

@otymartin
Copy link
Author

@slavenko Hey,

This library is definitely worthy of production level code as its the best counting label animation I've seen especially when dealing with currency values. I think the crash occurred when trying to manipulate the font size of the smaller fraction digits but I couldn't follow the logic of the code so i probably messed with the wrong values. A rewrite would definitely be welcome 💯 👍

@slavenko
Copy link
Owner

Refactored code, and added some customizations. Still some small issues with text alignment, but nothing serious, major performance/animation improvement.

All suggestions are more than welcome.

@otymartin
Copy link
Author

Thanks @slavenko

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

No branches or pull requests

2 participants