oleksandrbalan / lazytable

Lazy layout to display columns and rows of data on the two directional plane.
Apache License 2.0
261 stars 12 forks source link

Add support for androidx.compose.material.pullrefresh #22

Open leinardi opened 4 months ago

leinardi commented 4 months ago

It would be nice to be able to use the official androidx.compose.material.pullrefresh together with the LazyTable.

Since LazyTable is build on top of the androidx.compose.foundation.lazy.layout.LazyLayout I just assumed that pullrefresh would work out-of-the-box but that doesn't seem to be the case.

Here you can find a patch that adds it to the Android demo project.

oleksandrbalan commented 4 months ago

Thanks for the report and a patch 👍

Unfortunatelly, as for now, LazyTable and MinaBox use very primitive drag modifier, which does not support nested scroll or even overscroll.

I need to investigate how DraggableModifier works and how it could be adopted for 2D space 👀

leinardi commented 4 months ago

@oleksandrbalan I found these examples that seem interesting:

  1. https://github.com/SmartToolFactory/Jetpack-Compose-Tutorials/blob/80adc2f01a73d7a477769cc63824d5402b9674bb/Tutorial1-1Basics/src/main/java/com/smarttoolfactory/tutorial1_1basics/chapter5_gesture/Tutorial5_9_5DragableNestedScroll.kt#L77
  2. https://github.com/DroidKaigi/conference-app-2023/blob/f255ed2f6f07f9f6f83bc3b15384b9bcf001d8e8/feature/sessions/src/main/java/io/github/droidkaigi/confsched2023/sessions/section/TimetableGrid.kt#L191

The 2nd example is actually implementing a 2d grid that scrolls on both axis.

One more question: if I would like to play a little with the source code of both LazyTable and MinaBox what would be the easiest way to compile both of them from source, since LazyTable depends on the maven artifact and not on the source code of MinaBox?

oleksandrbalan commented 4 months ago

Thanks for links 👍

I have thinking to adopt Draggable and Scrollable nodes to support 2D orientation, but that's not an easy task to do 😞

As to the second question, the easiest way as for me would be to add MinaBox as a separate module in your local repo.