Skip to content

Releases: cheonjaeung/gridlayout-compose

2.7.4

03 Jun 06:11

Choose a tag to compare

Changed

  • Reduce object memory allocation of HorizontalGrid, VerticalGrid and BoxGrid.
  • Skip unnecessary intrinsic size calculation when Modifier.fillMaxMainAxisSize is not applied.

2.7.3

15 May 09:48

Choose a tag to compare

Changed

  • Fix IllegalArgumentException when using HorizontalGrid or VerticalGrid inside an unbounded container such as Column or LazyColumn.

2.7.2

10 May 08:52

Choose a tag to compare

Changed

  • Fix HorizontalGrid and VerticalGrid not skipping items whose span exceeds the maximum span of the grid.
  • Fix HorizontalGrid and VerticalGrid incorrectly accepting infinity size in constraints.

2.7.1

04 Apr 15:18

Choose a tag to compare

Changed

  • Fix incorrect span size calculation when using non-uniform cell sizes like ExtendedGridCells.Track in HorizontalGrid, VerticalGrid, and BoxGrid.
  • Fix incorrect x position of spanned items in BoxGrid when layout direction is RTL.

2.7.0

02 Mar 06:29

Choose a tag to compare

This release introduces new grid cell managements called ExtendedGridCells for advanced use cases.

For example, you can switch cell management strategy responsively:

VerticalGrid(
    columns = ExtendedGridCells.SimpleGridCells.Responsive { availableWidth ->
        if (availableWidth < 600.dp) {
            SimpleGridCells.Fixed(3)
        } else {
            SimpleGridCells.Adaptive(150.dp)
        }
    },
    modifier = Modifier.fillMaxWidth()
) { /* content */ }

And you can define cell size individually:

VerticalGrid(
    columns = ExtendedGridCells.SimpleGridCells.Track(
        GridTrack.Fixed(100.dp),
        GridTrack.Weight(2f),
        GridTrack.Weight(1f)
    ),
    modifier = Modifier.width(400.dp)
) { /* content */ }

For more information, see the documentation.

Changed

  • Add ExtendedGridCells for more advanced grid cell management.
    • Add Responsive for switching cell management strategy based on layout size.
    • Add Track for defining cell size individually by list of GridTracks. Each cell can have a fixed or weighted size.
    • Add GridTrack to define each cell size with ExtendedGridCells.Track.
  • SimpleGridCells.FixedSize is now stable API.
  • The minimum SDK version is updated to 23 for the Android artifact.

Dependencies

Project dependencies are updated.

  • Kotlin 2.2.20 -> 2.3.10
  • Compose 1.9.0 -> 1.10.0
  • Gradle 8.14.3 -> 8.14.4
  • Android Gradle Plugin 8.13.0 -> 8.13.2
  • Android Minimum SDK 21 -> 23

2.6.0

18 Dec 08:44

Choose a tag to compare

This release introduces a new experimental modifier, fillMaxMainAxisSize.
It makes the item have the same size to the maximum of the main axis sizes.

Changed

  • BoxGrid is now stable API.
  • New experimental modifier fillMaxMainAxisSize is added.
  • All grids now skip item measurement and placement when there is no available space or calculated cell size is invalid.

2.5.2

04 Nov 12:51

Choose a tag to compare

Changed

  • Fix crash when an item composable has infinity constraints size in HorizontalGrid or VerticalGrid.
  • Fix incorrect min/max size validation when creating OrientationIndependentConstraints.

2.5.1

02 Nov 06:08

Choose a tag to compare

Changed

  • Optimize measurement performance of HorizontalGrid and VerticalGrid via reducing object memory allocation.
  • Compose dependencies are replaced with Compose Multiplatform plugin.
  • androidx.core dependency is removed from Android artifact.

2.5.0

16 Oct 11:47

Choose a tag to compare

This release introduces a new cell strategy, SimpleGridCells.FixedSize. FixedSize is a cell strategy class that make each cell to have exact size. This class is now experimental feature. You should opt-in to use it.

Changed

  • New experimental cell strategy SimpleGridCells.FixedSize is added.
  • Optimize arrangement performance of BoxGrid.
  • Fix crash when minSize of Adaptive grid cells is equal to negative spacing.
  • Spanned cell size calculation was incorrect when using horizontalSpacing and verticalSpacing with spanning in BoxGrid.

Dependencies

Project dependencies are updated.

  • Kotlin 2.1.0 -> 2.2.20
  • Android Gradle Plugin 8.10.1 -> 8.13.0
  • Compose 1.8.0 -> 1.9.0
  • Target SDK (Android Only) 35 -> 36

2.4.0

01 Aug 11:46

Choose a tag to compare

This release contains breaking changes for the experimental feature, BoxGrid. BoxGridScope's rowSpan and columnSpan modifier is replaced to span modifier. And also span modifier's parameter now receive BoxGridItemSpanScope instead of GridItemSpanScope. It contains more information for calculating box grid item span.

Changed

  • Add Modifier.position to BoxGridScope for setting row/column cell position at the same time.
  • Add Modifier.span to BoxGridScope for setting row/column span at the same time.
  • Add BoxGridItemSpanScope for span modifier of BoxGridScope.
  • Add BoxGridItemSpan. It is a container represents row/column span size.
  • Remove Modifier.rowSpan and Modifier.columnSpan from BoxGridScope.
  • Remove deprecated HorizontalGrid and VerticalGrid with alignment parameter.
    Replace it to composable with contentAlignment parameter.
  • Fix remaining cell size distribution of SimpleGridCell more properly.