-
Notifications
You must be signed in to change notification settings - Fork 31
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
Custom Ticks #9
Custom Ticks #9
Conversation
Finalizing custom tick spacing and animation setup. Add var to toggle tick transparency.
Removing team info from PR
I've fixed the track width issue we talked about. Currently passing in a Tick with a 0 value will inset the tick from the left enough so that it is in the center of the thumb image, which is about 15px from left by default. I was wondering if I should provide an option to disable inlay of the tick by the radius of the thumb image, and decided to be agile and maybe wait until someone asked for that. This is working fantastically now. It would probably be super easy to modify the previous code to use the new shorter layout methods for odd or evenly spaced ticks. I'll be opening later PRs to add a color to the tick itself so that the default color can be overridden on a tick by tick basis. |
Fixed a bug where the custom thumb adjustment value being positive should pop the tick up higher instead of the inverse, because the differentials are more negative the higher they pop up.
Library/HUMSlider.m
Outdated
static CGFloat const HUMTickWidth = 1; | ||
|
||
// Default Constants | ||
static CGFloat const DefaultThumbPxWidth = 30; //Size of apple's default thumb icon. | ||
static CGFloat const DefaultThumbPxWidth = 31; //Size of apple's default thumb icon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this can be removed
@thejeff77 Mind if I reopen this? Was planning on getting you more feedback this weekend or next week |
…ts and changed an integer reference.
No problem, I have a tricky bug to fix, and realized I have quite a bit of cleanup to do. I'm working on this more today, and can re-open as soon as the code looks a little better. I hope that works! I did a major refactor & am making sure all of the old and new functionality works together. I could never have done this without the code there in the first place to use as an example. Thanks :) |
Awesome! Ping me when it's up and I'll take a look |
All done. Much better now. Pretty much re-factored how the consistently spaced tick marks worked - it no longer requires an odd number. It didn't make sense to have two separate implementations in there - one for custom ticks the other for consistently spaced ticks. Also added a feature that hugs the tick to the outside of the slider as it moves by - this is cool when the slider is moving slowly for playback type stuff. Added some public properties for more control over how the slider looks when dragged / not dragged. More specifically - one var to keep them from disappearing when the user isn't touching the slider. Another one to prevent them from being lowered while the slider isn't being dragged. Also removed the copyright, as this causes issues with open source review boards and can be perceived as a conflict with an open source MIT license. |
@designatednerd this is ready for a review. |
Added custom ticks to the HUMSlider.
Added various option parameters to enhance the customization potential for the slider.