diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fd47e8..780196f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v2.4.2 - name: Build the sample app to verify it works run: ./gradlew sample:assemble diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bec67e6..136f75a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,7 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v2.4.2 - name: Build the sample app to verify it works run: ./gradlew sample:assemble diff --git a/CHANGELOG.md b/CHANGELOG.md index b914dce..f21b2f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,17 @@ # ChangeLog +## Version 0.1.2 + +* Fix: Paging FiberglassLazyColumn after paging-compose v1.0.0-alpha19. +* Update: Kotlin to v1.8.21. +* Update: Compose BOM to v2023.05.01. +* Update: Minor update of other libraries. + + ## Version 0.1.1 -* Fix: Row and Column key +* Fix: Row and Column key. * Update: Row and Column are no longer scrollable by default. You need to explicitly set the scroll state. diff --git a/README.md b/README.md index b81e677..b8e0234 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ [![Maven Central](https://img.shields.io/maven-central/v/ru.ldralighieri.composites/composites-fiberglass.svg)](https://search.maven.org/search?q=g:ru.ldralighieri.composites) -[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.8.0-blue.svg?logo=kotlin)](https://kotlinlang.org) -[![Compose BOM Version](https://img.shields.io/badge/Compose-v2023.01.00-blue.svg?logo=jetpackcompose)](https://developer.android.com/jetpack/compose) +[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.8.21-blue.svg?logo=kotlin)](https://kotlinlang.org) +[![Compose BOM Version](https://img.shields.io/badge/Compose-v2023.05.01-blue.svg?logo=jetpackcompose)](https://developer.android.com/jetpack/compose) [![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg)](https://android-arsenal.com/api?level=21) -![Publish status](https://github.com/LDRAlighieri/Composites/actions/workflows/publish.yml/badge.svg) +[![Publish status](https://github.com/LDRAlighieri/Composites/actions/workflows/publish.yml/badge.svg)](https://github.com/LDRAlighieri/Composites/actions)
@@ -12,7 +12,7 @@
# Composites (work in progress 🚧🔧️👷⛏🚧)
-✨ Composites are a group of tools and handy libraries that make it easier to use [Jetpack Compose][compose].
+✨ Composites are a collection of tools and handy libraries that make it easier to use [Jetpack Compose][compose].
Please consider giving this repository a star ⭐ if you like the project.
@@ -26,7 +26,7 @@ Add one or more dependencies:
```kotlin
dependencies {
- implementation("ru.ldralighieri.composites:composites-fiberglass:0.1.1")
+ implementation("ru.ldralighieri.composites:composites-fiberglass:0.1.2")
}
```
@@ -39,7 +39,7 @@ repositories {
```
Snapshot build:
-[![Nexus](https://img.shields.io/nexus/s/ru.ldralighieri.composites/composites-fiberglass?server=https://oss.sonatype.org)](https://oss.sonatype.org/content/repositories/snapshots/ru/ldralighieri/composites/)
+[![Maven Central](https://img.shields.io/nexus/s/ru.ldralighieri.composites/composites-fiberglass?server=https://oss.sonatype.org)](https://oss.sonatype.org/content/repositories/snapshots/ru/ldralighieri/composites/)
```kotlin
repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
diff --git a/build-logic/gradle/wrapper/gradle-wrapper.jar b/build-logic/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index f6b961f..0000000
Binary files a/build-logic/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/build-logic/gradle/wrapper/gradle-wrapper.properties b/build-logic/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 1da5c18..0000000
--- a/build-logic/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Wed Dec 04 14:00:15 VLAT 2019
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
diff --git a/build.gradle.kts b/build.gradle.kts
index ca9d65b..b8dfcc7 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -30,7 +30,7 @@ plugins {
// Binary compatibility validator
apiValidation {
- ignoredProjects.addAll(listOf("sample"))
+ ignoredProjects.add("sample")
}
// Dependency updates
diff --git a/composites-fiberglass/README.md b/composites-fiberglass/README.md
index 5254ae7..e5b7ee0 100644
--- a/composites-fiberglass/README.md
+++ b/composites-fiberglass/README.md
@@ -24,7 +24,7 @@ Add dependency:
```kotlin
dependencies {
- implementation("ru.ldralighieri.composites:composites-fiberglass:0.1.1")
+ implementation("ru.ldralighieri.composites:composites-fiberglass:0.1.2")
}
```
diff --git a/composites-fiberglass/src/main/kotlin/ru/ldralighieri/composites/fiberglass/column/FiberglassLazyColumn.kt b/composites-fiberglass/src/main/kotlin/ru/ldralighieri/composites/fiberglass/column/FiberglassLazyColumn.kt
index 2300d89..8ce650d 100644
--- a/composites-fiberglass/src/main/kotlin/ru/ldralighieri/composites/fiberglass/column/FiberglassLazyColumn.kt
+++ b/composites-fiberglass/src/main/kotlin/ru/ldralighieri/composites/fiberglass/column/FiberglassLazyColumn.kt
@@ -30,7 +30,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.paging.compose.LazyPagingItems
-import androidx.paging.compose.items
+import androidx.paging.compose.itemContentType
+import androidx.paging.compose.itemKey
import ru.ldralighieri.composites.fiberglass.model.FiberglassItem
import ru.ldralighieri.composites.fiberglass.model.FiberglassLazyItemSlots
import ru.ldralighieri.composites.fiberglass.model.FiberglassStickyHeaderItem
@@ -125,11 +126,12 @@ fun FiberglassLazyColumn(
userScrollEnabled = userScrollEnabled
) {
items(
- items = items,
- key = { it.id }
- ) { item ->
- item?.let {
- itemSlots[it::class]?.let { slot -> slot(item) }
+ count = items.itemCount,
+ key = items.itemKey { it.id },
+ contentType = items.itemContentType { it::class.simpleName }
+ ) { index ->
+ items[index]?.let {
+ itemSlots[it::class]?.let { slot -> slot(it) }
}
}
}
diff --git a/gradle.properties b/gradle.properties
index 79e9278..e20568d 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -8,7 +8,7 @@ systemProp.org.gradle.internal.http.socketTimeout=120000
# Maven
GROUP=ru.ldralighieri.composites
-VERSION_NAME=0.2.0-SNAPSHOT
+VERSION_NAME=0.1.2
POM_DESCRIPTION=Composites are a group of tools and handy libraries that make it easier to use Jetpack Compose.
@@ -31,13 +31,10 @@ SONATYPE_AUTOMATIC_RELEASE=true
# Android
android.useAndroidX=true
-buildTools=33.0.1
+buildTools=33.0.2
compileSdk=33
targetSdk=33
minSdk=21
# Build features
-android.defaults.buildfeatures.aidl=false
-android.defaults.buildfeatures.buildconfig=false
-android.defaults.buildfeatures.renderscript=false
android.defaults.buildfeatures.shaders=false
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 5aa15fd..ab22aea 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,27 +1,27 @@
[versions]
# Plugins
-agp = "7.4.1"
-dokka = "1.7.20"
-spotless = "6.15.0"
-mavenPublish = "0.24.0"
-bcv = "0.12.1"
-gver = "0.45.0"
+agp = "8.0.1"
+dokka = "1.8.10"
+spotless = "6.18.0"
+mavenPublish = "0.25.2"
+bcv = "0.13.1"
+gver = "0.46.0"
# Kotlin
-kotlin = "1.8.10"
+kotlin = "1.8.21"
# Androidx
-androidxCoreSplashscreen = "1.0.0"
-androidxActivity = "1.6.1"
-androidxPagingCompose = "1.0.0-alpha17"
+androidxCoreSplashscreen = "1.0.1"
+androidxActivity = "1.7.1"
+androidxPagingCompose = "1.0.0-alpha19"
# Compose
-androidxComposeCompiler = "1.4.2"
-androidxComposeBom = "2023.01.00"
+androidxComposeCompiler = "1.4.7"
+androidxComposeBom = "2023.05.01"
# Accompanist
-accompanist = "0.28.0"
+accompanist = "0.30.1"
# Google
-googleMaterial="1.8.0"
+googleMaterial="1.9.0"
# Lint
ktlint = "0.46.1"
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 9c7eb7f..357d821 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -18,4 +18,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
diff --git a/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/CompositesScreen.kt b/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/CompositesScreen.kt
index fa34f71..2b5f26c 100644
--- a/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/CompositesScreen.kt
+++ b/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/CompositesScreen.kt
@@ -31,7 +31,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
-import androidx.compose.material3.TopAppBarDefaults
+import androidx.compose.material3.TopAppBarDefaults.topAppBarColors
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@@ -55,9 +55,10 @@ fun CompositesScreen(onFiberglassClick: () -> Unit) {
style = AppTheme.typography.headlineSmall
)
},
- colors = TopAppBarDefaults.smallTopAppBarColors(
+ colors = topAppBarColors(
containerColor = AppTheme.colors.surfaceColorAtElevation(3.dp),
- titleContentColor = AppTheme.colors.onSurface
+ titleContentColor = AppTheme.colors.onSurface,
+ actionIconContentColor = AppTheme.colors.onSurfaceVariant
)
)
diff --git a/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/app/CompositesApp.kt b/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/app/CompositesApp.kt
index d9562d3..a76e1de 100644
--- a/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/app/CompositesApp.kt
+++ b/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/app/CompositesApp.kt
@@ -21,7 +21,7 @@ import androidx.compose.foundation.LocalOverscrollConfiguration
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
-import androidx.compose.foundation.layout.consumedWindowInsets
+import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
@@ -50,7 +50,7 @@ fun CompositesApp(appState: CompositesAppState) {
navigate = appState::navigate,
modifier = Modifier
.padding(innerPadding)
- .consumedWindowInsets(innerPadding)
+ .consumeWindowInsets(innerPadding)
)
}
}
diff --git a/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/fiberglass/FiberglassScreen.kt b/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/fiberglass/FiberglassScreen.kt
index 96f75f9..3fb2440 100644
--- a/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/fiberglass/FiberglassScreen.kt
+++ b/sample/src/main/kotlin/ru/ldralighieri/composites/sample/ui/fiberglass/FiberglassScreen.kt
@@ -31,7 +31,7 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
-import androidx.compose.material3.TopAppBarDefaults
+import androidx.compose.material3.TopAppBarDefaults.topAppBarColors
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
@@ -65,10 +65,11 @@ fun FiberglassScreen(onBackClick: () -> Unit) {
Icon(imageVector = Icons.Default.ArrowBack, contentDescription = "")
}
},
- colors = TopAppBarDefaults.smallTopAppBarColors(
+ colors = topAppBarColors(
containerColor = AppTheme.colors.surfaceColorAtElevation(3.dp),
navigationIconContentColor = AppTheme.colors.onSurface,
- titleContentColor = AppTheme.colors.onSurface
+ titleContentColor = AppTheme.colors.onSurface,
+ actionIconContentColor = AppTheme.colors.onSurfaceVariant
)
)