Releases: cheonjaeung/gridlayout-compose
2.7.4
2.7.3
Changed
- Fix
IllegalArgumentExceptionwhen usingHorizontalGridorVerticalGridinside an unbounded container such asColumnorLazyColumn.
2.7.2
Changed
- Fix
HorizontalGridandVerticalGridnot skipping items whose span exceeds the maximum span of the grid. - Fix
HorizontalGridandVerticalGridincorrectly accepting infinity size in constraints.
2.7.1
Changed
- Fix incorrect span size calculation when using non-uniform cell sizes like
ExtendedGridCells.TrackinHorizontalGrid,VerticalGrid, andBoxGrid. - Fix incorrect x position of spanned items in
BoxGridwhen layout direction is RTL.
2.7.0
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
ExtendedGridCellsfor more advanced grid cell management.- Add
Responsivefor switching cell management strategy based on layout size. - Add
Trackfor defining cell size individually by list ofGridTracks. Each cell can have a fixed or weighted size. - Add
GridTrackto define each cell size withExtendedGridCells.Track.
- Add
SimpleGridCells.FixedSizeis 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
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
BoxGridis now stable API.- New experimental modifier
fillMaxMainAxisSizeis added. - All grids now skip item measurement and placement when there is no available space or calculated cell size is invalid.
2.5.2
Changed
- Fix crash when an item composable has infinity constraints size in
HorizontalGridorVerticalGrid. - Fix incorrect min/max size validation when creating
OrientationIndependentConstraints.
2.5.1
Changed
- Optimize measurement performance of
HorizontalGridandVerticalGridvia reducing object memory allocation. - Compose dependencies are replaced with Compose Multiplatform plugin.
androidx.coredependency is removed from Android artifact.
2.5.0
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.FixedSizeis added. - Optimize arrangement performance of
BoxGrid. - Fix crash when
minSizeofAdaptivegrid cells is equal to negative spacing. - Spanned cell size calculation was incorrect when using
horizontalSpacingandverticalSpacingwith spanning inBoxGrid.
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
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.positiontoBoxGridScopefor setting row/column cell position at the same time. - Add
Modifier.spantoBoxGridScopefor setting row/column span at the same time. - Add
BoxGridItemSpanScopeforspanmodifier ofBoxGridScope. - Add
BoxGridItemSpan. It is a container represents row/column span size. - Remove
Modifier.rowSpanandModifier.columnSpanfromBoxGridScope. - Remove deprecated
HorizontalGridandVerticalGridwithalignmentparameter.
Replace it to composable withcontentAlignmentparameter. - Fix remaining cell size distribution of
SimpleGridCellmore properly.