This message was deleted.
# compose-android
s
This message was deleted.
s
Not sure then. Maybe provide a screenshot of what you want and a screenshot of what you get
Is it for the vertical line between the points?
Don’t think you can do that with a simple column/row setup like that. I’d do something like this
Copy code
Column {
  LineWithText(filledCircle = true, text = "AED ...")
  LineWithText(filledCircle = false, text = "AED ...")
}
Where
LineWithText
would be responsible for drawing this part [pic] (Yes with the line cutoff like that)
The API could look smth like this
Copy code
@Composable
fun LineWithText(
  text: String,
  isCircleFilled: Boolean,
  hasPreviousItem: Boolean,
  hasNextItem: Boolean,
)
Where the has[X]Item would control if the line is drawn above/below the circle too
Or just try out some existing solutions https://github.com/yeocak/ComposableTimelineView
🙌 1
a
I think you'd have to draw this yourself using canvas-related APIs. I would certainly prefer that. Otherwise you can try to find some libraries if they provide you with appropriate customisation.
🙌 1
y
I think this talk might be a good starting point.

https://youtu.be/xcfEQO0k_gU

🙌 1
1
s
Honestly, I can definitely imagine each text item to be one which has a fixed width canvas at the beginning, and the text with weight(1f) at the end. With a pure canvas approach you need to draw text in there, which makes me feel like it'd be at least more complicated no?
y
Watch the video, you can lay out the text items in a custom layout, then use positioning to render just the joined dots with info from that layout.
1
🙌 1
p
@huthefa You can checkout my library for drawing a timeline view in Compose. I have used Canvas to draw the lines and points. https://github.com/pushpalroy/jetlime