https://kotlinlang.org logo
#compose
Title
# compose
b

Bradleycorn

03/09/2021, 7:32 PM
Building this in the old view system was NOT fun, and involved writing a custom LayoutManager for the main recycler view, and using some wild stuff to link 3 recycler views together (main view, one for the row header, and one for the column header) and keep their scrolls/flings in sync. I haven't tried it yet, but I wonder how much easier this will be in Compose?
2
t

Tash

03/09/2021, 7:35 PM
Wow this looks like an interesting challenge to port to Compose. Complexity would mostly lie in connecting all the scroll states of the scrollable components together
c

Colton Idle

03/09/2021, 7:35 PM
I'm actually building a TV guide sort of thing in the view system and it is reallllly hard. I'm not sure how I would even attempt it compose, but would am curious to hear how someone like @Andrey Kulikov would go forward to build something like this. This is what I'm actually trying to build in legacy Android view land. So an additional piece of complexity is the fact that the column sizes can be variable sizes since a show can be 30 minutes long, or 60 minutes.
b

Bradleycorn

03/09/2021, 7:37 PM
I dubbed my final custom view,
SpreadsheetView
🙂 I feel your pain @Colton Idle. I didn't have to deal with cells that span multiple rows/columns like you do, and it was still a massive pain.
👍 1
a

Andrey Kulikov

03/09/2021, 7:39 PM
that is currently not possible with Lazy components. there are no grids scrolling in both ways
😱 1
but if all the cells are known to have the same fixed size maybe you don’t need it at all and can just apply two Modifier.scollable() for each direction and just draw the content right on Canvas using the current offsets?
💡 1
there is still no DrawScope.drawText() but you can use the regular Android one for it for now with
drawIntoCanvas
b

Bradleycorn

03/09/2021, 7:45 PM
interesting. In my case, the cells are all the same size, so I might be able to do something like that
s

Sergey Y.

03/09/2021, 7:51 PM
that is currently not possible with Lazy components. there are no grids scrolling in both ways
@Andrey Kulikov but is it planned to do such functionality? ☺️
b

Bradleycorn

03/09/2021, 7:52 PM
yes. we need
LazySpreadsheetLayout
😉
💯 1
❤️ 1
c

Colton Idle

03/09/2021, 7:52 PM
LazyTVGuide
if the Android team is taking suggestions 😂
b

Bradleycorn

03/09/2021, 7:53 PM
haha
s

Sergey Y.

03/09/2021, 7:54 PM
I bet that it will be in demand on android tv 😄
🤣 1
😄 1
a

Andrey Kulikov

03/09/2021, 8:02 PM
No, it is not planned for now. We don’t support even simpler staggered grids yet. Feel free to create a 3rt party library for it on top of SubcomposeLayout 🙂
👏 1
s

Sergey Y.

03/09/2021, 8:07 PM
Interestingly, I only found one sample with SubcomposeLayout, hopefully it will be described in the documentation. How to use it, etc 😀
r

rsktash

09/12/2021, 6:34 PM
@Zach Klippenstein (he/him) [MOD] Hi have you ever implemented excel like scrollable layout with frozen headers like this?

https://raw.githubusercontent.com/zhouchaoyuan/excelPanel/master/app/src/main/assets/roomFormDemo.gif

z

Zach Klippenstein (he/him) [MOD]

09/12/2021, 8:12 PM
Nope