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 ability to define footer row(s) #17

Closed mr-m-1t closed 5 months ago

mr-m-1t commented 7 months ago

Hello :wave: This library looks pretty slick, I'd love to use it in my project.

A common use case for tables is to display a footer, for example to show totals or averages:

Example - click to expand | student | quiz 1 | quiz 2 | final exam | | ------- | ------ | ------ | ---------- | | Alice | 78% | 84% | 85% | | Bob | 87% | 87% | 85% | | Carol | 92% | 87% | 78% | | Dave | 88% | 83% | 82% | | ------- | ------ | ------ | ---------- | | average | 86% | 85% | 82% |

Is it feasible to extend this project to allow a fixed footer row, similar to how a fixed header row is can be set? Perhaps something like this:

Example - click to expand ```kt public fun lazyTablePinConfiguration( columns: Int = 0, rows: Int = 0, ): LazyTablePinConfiguration { ... } // could become public fun lazyTablePinConfiguration( columns: Int = 0, rows: Int = 0, // the count of pinned footer rows endRows: Int = 0, ): LazyTablePinConfiguration { ... } ```

I did see #7, and the snippet provided there could be adapted to achieve this behavior. However showing a footer row is a very common use case for tables, and as such I believe it makes sense to add the capability to this library.

oleksandrbalan commented 7 months ago

Hi, thx 🤗

Yea, I agree it would be nice feature for LazyTable, I will mark your issue as an enchantment and will look on it when I have time. Unfortunately I cannot promise any timings :confused:

mr-m-1t commented 7 months ago

Awesome! My team may be able to allocate some time for this, would you be open to a PR adding footer functionality?

oleksandrbalan commented 7 months ago

Sure thing 👍

mattgraham1 commented 6 months ago

@oleksandrbalan We created a PR (https://github.com/oleksandrbalan/lazytable/pull/19) for these changes. For whatever reason I'm unable to add you as a reviewer so I'm pinging you here hoping you see it. Please review it when you have time and let us know if you see any needed changes. Thank you!

oleksandrbalan commented 6 months ago

Awesome, thank you very much! I will try to look on it as soon as possible 👀

mattgraham1 commented 5 months ago

Following up to see if you'll be able to review this PR. I'd really appreciate it and please let us know if there are any concerns. Thank you very much!

oleksandrbalan commented 5 months ago

@mattgraham1 Sorry for the late response, I have checked it and everything works fine 👍 Even the iOS configuration (for me at least 😅).

image

There are just few nitpicks in PR from me, thx!

mattgraham1 commented 5 months ago

Thanks you for checking iOS. I'm 98% Android developer so probably a setup issue with iOS on my side. I've address all the PR feedback you gave. Thanks again!

oleksandrbalan commented 5 months ago

Available in 1.7.0 :clap: :rocket: