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
Dynamic segment sizing #34
Conversation
Hey @rmvz3 all these changes are in the branch called |
@maxcampolo I've just realized. That's why I deleted my question. My fault ¯_(ツ)_/¯ Thank you |
No love for this PR? |
Hello @maxcampolo , thank you for a great work. I have tested your PR and found some issues with cell width and also with wrong positioning of indicator Can you fix them? |
@Tykhonkov sure thing let me look at this. The first image looks correct, the cell sizes based on the size of the content contained in it, using the image width if there is no label. The second image indicator position is definitely wrong. Any specifics on reproducing? Thanks! |
…text. Also updates example project to optionally take a segmentioPosition parameter.
@Tykhonkov I pushed some updates that should fix these issues. I also updated the example project so to test you can just add the Thanks for reviewing! |
i'll test it |
Apologies for bothering, but may I ask if this PR is going to be merged any time soon? |
@maxcampolo Could you please update your request by pulling last changes in our master branch ? |
@AndrewPetrov okay I've merged the latest from master and updated the PR. Thanks for reviewing! |
@maxcampolo I'm sorry but your fix still has some issues with highlighting |
@AndrewPetrov sorry about that! This was just a bug calculating the position in the .fixed segment width option. Turned out to be misplaced |
…n .fixed Segmentio position, remove warnings
fc8e132
to
2f3211e
Compare
Could this please be merged? |
This PR adds support for dynamic segment sizing based on the content size of the segment. Instead of fixing the number of visible cells, each cell is a different size based on the length of its title (plus the image in the case of the imageBefore and imageAfter styles). The way to use it is to pass a SegmentioPosition option in the initializer, either .dynamic or .fixed(maxVisibleItems: 3). The fixed option is the same behavior that exists currently.
Changes:
There are quite a few changes in this PR so if you want anything updated, changed, done differently, etc. please let me know and I’m happy to do it!
Ty for the awesome framework.