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

Automatic spacing based on time of entries #11

Closed
bbrosius opened this issue Sep 4, 2020 · 6 comments
Closed

Automatic spacing based on time of entries #11

bbrosius opened this issue Sep 4, 2020 · 6 comments

Comments

@bbrosius
Copy link

bbrosius commented Sep 4, 2020

I'm curious if there is a way to make the timeline adjust where items appear based on the gap in time between events. For example items that are five minutes apart might be spaced 5 px. Whereas items an hour apart would have more spacing say 20 px.

If this isn't something that can be done automatically in the library, I'd be any thoughts you had on how to manually do this in the app using the library.

@softmarshmallow
Copy link
Member

quick answer:
if you are trying to visualize time gap, you can set itemgap to zero, and give TimelineEvent#content's padding by the size by interval you want.

also, problem that your having is not quite general. which means it might not be right to implement in the package itself.
if you suggest any references (screen, mockup, or service) i'de be glad to implement it as in-the-box. (if it is general problem)

p.s other solution: // or since timeline view is internally just a listview, you can pass seperator builder to it, having different sized diver by the time interval.

@softmarshmallow
Copy link
Member

I'll close this issue. if you have any other question, please re-open it or create a new one. thanks

@bbrosius
Copy link
Author

bbrosius commented Sep 9, 2020

@softmarshmallow Thanks for the help. I was able to get this largely working using a separator builder. I noticed two things not sure if they're bugs or not. When I start supplying a separator builder for some reason the line starts drawing on top of the first indicator dot instead of underneath it. If I comment out the separator builder it worked as normal. Also when using the separator builder the lines are broken as they don't seem to take all of the space of the separator. I've attached a screenshot. I plan to continue to play around if I figure out a fix would you be interested in a pull request?

Simulator Screen Shot - iPhone SE (2nd generation) - 2020-09-09 at 15 39 14

@softmarshmallow
Copy link
Member

@bbrosius sure i’de be happy to.
seperator builder might be a bug, since adding a padding to each item instead using seperator builder will work.

however, again, Id’e be happy to take your PR and add as contributor

Ill take a look on this issue in this weekend

@softmarshmallow
Copy link
Member

@bbrosius haven't heard you for a while. would it be ok to close this issue? or shall i wait for the PR

@bbrosius
Copy link
Author

@softmarshmallow Sorry didn't manage to get to it last week. I still plan to submit a PR but we can close this issue.

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