Skip to content

Commit

Permalink
Merge pull request #5 from LDRAlighieri/update/dependencies
Browse files Browse the repository at this point in the history
Fiberglass items @immutable -> @stable, Update dependencies
  • Loading branch information
LDRAlighieri committed Aug 21, 2023
2 parents 46b7b14 + dad8316 commit 7d219da
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 61 deletions.
25 changes: 18 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# ChangeLog


## Version 0.3.0

* Update: Fiberglass(`composites-fiberglass`) module:
- Fiberglass items now @Stable
- FiberglassFlowColumn and FiberglassFlowRow API
* Update: Target SDK to v34.
* Update: Kotlin to v1.9.0.
* Update: Compose BOM to v2023.08.00.
* Update: Minor update of other libraries.


## Version 0.2.0

* New: Fiberglass(`composites-fiberglass`) composites:
* New: Fiberglass(`composites-fiberglass`) module:
- Fiberglass flow column Composite
- Fiberglass flow row Composite
- Fiberglass lazy horizontal grid Composite
Expand Down Expand Up @@ -31,11 +42,11 @@
## Version 0.1.0

* New: Fiberglass(`composites-fiberglass`) module:
- Fiberglass column Composite
- Fiberglass lazy column Composite
- Fiberglass lazy column Composite for `LazyPagingItems`
- Fiberglass lazy column Composite with sticky headers
- Fiberglass row Composite
- Fiberglass lazy row Composite
- Fiberglass column Composite
- Fiberglass lazy column Composite
- Fiberglass lazy column Composite for `LazyPagingItems`
- Fiberglass lazy column Composite with sticky headers
- Fiberglass row Composite
- Fiberglass lazy row Composite
* Update: Kotlin to v1.8.0.
* Update: Compose BOM to v2023.01.00.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![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.21-blue.svg?logo=kotlin)](https://kotlinlang.org)
[![Compose BOM Version](https://img.shields.io/badge/Compose-v2023.06.01-blue.svg?logo=jetpackcompose)](https://developer.android.com/jetpack/compose)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.9.0-blue.svg?logo=kotlin)](https://kotlinlang.org)
[![Compose BOM Version](https://img.shields.io/badge/Compose-v2023.08.00-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)
Expand All @@ -16,6 +16,11 @@
Please consider giving this repository a star ⭐ if you like the project.


## Articles
* [Compose these composites][compose-these-composites]
* [Reach out to infinity][reach-out-to-infinity]


## Modules
* [composites-fiberglass] — A tool for building complex screens based on simple blocks.

Expand All @@ -26,7 +31,7 @@ Add one or more dependencies:

```kotlin
dependencies {
implementation("ru.ldralighieri.composites:composites-fiberglass:0.2.0")
implementation("ru.ldralighieri.composites:composites-fiberglass:0.3.0")
}
```

Expand Down Expand Up @@ -81,5 +86,7 @@ limitations under the License.


[compose]: https://developer.android.com/jetpack/compose
[compose-these-composites]: https://medium.com/@ldralighieri/compose-these-composites-8ea923e4a34c
[reach-out-to-infinity]: https://medium.com/@ldralighieri/reach-out-to-infinity-bba17019a938
[composites-fiberglass]: https://github.com/LDRAlighieri/Composites/tree/main/composites-fiberglass
[performance]: https://developer.android.com/jetpack/compose/performance#build-release
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ import com.android.build.api.dsl.CommonExtension
import org.gradle.api.plugins.ExtensionAware
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

internal fun CommonExtension<*, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
internal fun CommonExtension<*, *, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.gradle.api.Project
import java.io.File

internal fun Project.configureAndroidCompose(
extension: CommonExtension<*, *, *, *>,
extension: CommonExtension<*, *, *, *, *>,
) {
extension.apply {
buildFeatures.compose = true
Expand All @@ -42,15 +42,15 @@ internal fun Project.configureAndroidCompose(
private fun Project.buildComposeMetricsParameters(): List<String> = buildList {
val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics")
if (enableMetricsProvider.orNull == "true") {
val metricsFolder = File(project.buildDir, "compose-metrics")
val metricsFolder = File(project.layout.buildDirectory.asFile.get(), "compose-metrics")
add("-P")
add("plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination="
+ metricsFolder.absolutePath)
}

val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports")
if (enableReportsProvider.orNull == "true") {
val reportsFolder = File(project.buildDir, "compose-reports")
val reportsFolder = File(project.layout.buildDirectory.asFile.get(), "compose-reports")
add("-P")
add("plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination="
+ reportsFolder.absolutePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.provideDelegate

internal fun Project.configureKotlinAndroid(
commonExtension: CommonExtension<*, *, *, *>,
commonExtension: CommonExtension<*, *, *, *, *>,
) {
val compileSdk: String by project
val minSdk: String by project
Expand Down
2 changes: 1 addition & 1 deletion composites-fiberglass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add dependency:

```kotlin
dependencies {
implementation("ru.ldralighieri.composites:composites-fiberglass:0.2.0")
implementation("ru.ldralighieri.composites:composites-fiberglass:0.3.0")
}
```

Expand Down
4 changes: 2 additions & 2 deletions composites-fiberglass/api/composites-fiberglass.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ public final class ru/ldralighieri/composites/fiberglass/column/FiberglassColumn
}

public final class ru/ldralighieri/composites/fiberglass/column/FiberglassFlowColumnKt {
public static final fun FiberglassFlowColumn (Ljava/util/List;Ljava/util/Map;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/ui/Alignment$Horizontal;ILandroidx/compose/runtime/Composer;II)V
public static final fun FiberglassFlowColumn (Ljava/util/List;Ljava/util/Map;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/foundation/layout/Arrangement$Horizontal;ILandroidx/compose/runtime/Composer;II)V
}

public final class ru/ldralighieri/composites/fiberglass/column/FiberglassLazyColumnKt {
Expand Down Expand Up @@ -37,7 +37,7 @@ public abstract interface class ru/ldralighieri/composites/fiberglass/model/Fibe
}

public final class ru/ldralighieri/composites/fiberglass/row/FiberglassFlowRowKt {
public static final fun FiberglassFlowRow (Ljava/util/List;Ljava/util/Map;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/foundation/layout/Arrangement$Horizontal;Landroidx/compose/ui/Alignment$Vertical;ILandroidx/compose/runtime/Composer;II)V
public static final fun FiberglassFlowRow (Ljava/util/List;Ljava/util/Map;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/foundation/layout/Arrangement$Horizontal;Landroidx/compose/foundation/layout/Arrangement$Vertical;ILandroidx/compose/runtime/Composer;II)V
}

public final class ru/ldralighieri/composites/fiberglass/row/FiberglassLazyRowKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import ru.ldralighieri.composites.fiberglass.model.FiberglassItem
* @param contentPadding A padding around the whole content. Negative padding is not permitted — it
* will cause IllegalArgumentException.
* @param verticalArrangement The vertical arrangement of the layout's children.
* @param horizontalAlignment The horizontal alignment of the layout's children.
* @param horizontalArrangement The horizontal arrangement of the layout's virtual columns.
* @param maxItemsInEachColumn The maximum number of items per column
*/
@Composable
Expand All @@ -48,14 +48,14 @@ fun FiberglassFlowColumn(
modifier: Modifier = Modifier,
contentPadding: PaddingValues = PaddingValues(0.dp),
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start,
maxItemsInEachColumn: Int = Int.MAX_VALUE
) {
Box(modifier = modifier) {
FlowColumn(
modifier = Modifier.padding(contentPadding),
verticalArrangement = verticalArrangement,
horizontalAlignment = horizontalAlignment,
horizontalArrangement = horizontalArrangement,
maxItemsInEachColumn = maxItemsInEachColumn
) {
items.forEach { item ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package ru.ldralighieri.composites.fiberglass.model

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.lazy.LazyItemScope
Expand Down Expand Up @@ -74,14 +73,12 @@ typealias FiberglassLazyGridItemSlots = Map<KClass<out FiberglassItem>, Fibergla
/**
* Fiberglass[Vertical|Horizontal]Grid slot alias
*/
@OptIn(ExperimentalFoundationApi::class)
typealias FiberglassLazyStaggeredGridItemSlot =
@Composable LazyStaggeredGridItemScope.(item: FiberglassItem) -> Unit

/**
* Fiberglass[Vertical|Horizontal]Grid slots map alias
*/
@OptIn(ExperimentalFoundationApi::class)
typealias FiberglassLazyStaggeredGridItemSlots =
Map<KClass<out FiberglassItem>, FiberglassLazyStaggeredGridItemSlot>

Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

package ru.ldralighieri.composites.fiberglass.model

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable

/**
* Item interface for Fiberglass
*/
@Immutable
@Stable
interface FiberglassItem {
val id: Any
}

/**
* StickyHeader interface for FiberglassLazyColumn
*/
@Immutable
@Stable
interface FiberglassStickyHeaderItem : FiberglassItem {
val title: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import ru.ldralighieri.composites.fiberglass.model.FiberglassRowItemSlots
* @param contentPadding A padding around the whole content. Negative padding is not permitted — it
* will cause IllegalArgumentException.
* @param horizontalArrangement The horizontal arrangement of the layout's children.
* @param verticalAlignment The vertical alignment of the layout's children.
* @param verticalArrangement The vertical arrangement of the layout's virtual rows.
* @param maxItemsInEachRow The maximum number of items per row
*/
@Composable
Expand All @@ -48,14 +48,14 @@ fun FiberglassFlowRow(
modifier: Modifier = Modifier,
contentPadding: PaddingValues = PaddingValues(0.dp),
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start,
verticalAlignment: Alignment.Vertical = Alignment.Top,
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
maxItemsInEachRow: Int = Int.MAX_VALUE
) {
Box(modifier = modifier) {
FlowRow(
modifier = Modifier.padding(contentPadding),
horizontalArrangement = horizontalArrangement,
verticalAlignment = verticalAlignment,
verticalArrangement = verticalArrangement,
maxItemsInEachRow = maxItemsInEachRow
) {
items.forEach { item ->
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ systemProp.org.gradle.internal.http.socketTimeout=120000

# Maven
GROUP=ru.ldralighieri.composites
VERSION_NAME=0.3.0-SNAPSHOT
VERSION_NAME=0.3.0

POM_DESCRIPTION=Composites are a group of tools and handy libraries that make it easier to use Jetpack Compose.

Expand All @@ -31,9 +31,9 @@ SONATYPE_AUTOMATIC_RELEASE=true

# Android
android.useAndroidX=true
buildTools=33.0.2
compileSdk=33
targetSdk=33
buildTools=34.0.0
compileSdk=34
targetSdk=34
minSdk=21

# Build features
Expand Down
18 changes: 9 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
[versions]
# Plugins
agp = "8.0.2"
agp = "8.1.0"
dokka = "1.8.20"
spotless = "6.19.0"
mavenPublish = "0.25.2"
spotless = "6.20.0"
mavenPublish = "0.25.3"
bcv = "0.13.2"
gver = "0.47.0"

# Kotlin
kotlin = "1.8.21"
kotlin = "1.9.0"

# Androidx
androidxCoreSplashscreen = "1.0.1"
androidxActivity = "1.7.2"
androidxPagingCompose = "3.2.0-beta01"
androidxNavigation = "2.7.0"
androidxPagingCompose = "3.2.0"
# Compose
androidxComposeCompiler = "1.4.7"
androidxComposeBom = "2023.06.01"
androidxComposeCompiler = "1.5.1"
androidxComposeBom = "2023.08.00"
# Accompanist
accompanist = "0.30.1"

Expand All @@ -31,6 +32,7 @@ ktlint = "0.49.1"
# Androidx
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidxCoreSplashscreen" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivity" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigation" }
androidx-paging-compose = { module = "androidx.paging:paging-compose", version.ref = "androidxPagingCompose" }
# Compose
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidxComposeBom" }
Expand All @@ -48,8 +50,6 @@ androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-mani

# Accompanist
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
accompanist-navigation-material = { module = "com.google.accompanist:accompanist-navigation-material", version.ref = "accompanist" }
accompanist-navigation-animation = { module = "com.google.accompanist:accompanist-navigation-animation", version.ref = "accompanist" }

# Google
google-material = { module = "com.google.android.material:material", version.ref = "googleMaterial" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
3 changes: 1 addition & 2 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies {
// Androidx
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.navigation.compose)

// Compose
implementation(platform(libs.androidx.compose.bom))
Expand All @@ -71,8 +72,6 @@ dependencies {

// Accompanist
implementation(libs.accompanist.systemuicontroller)
implementation(libs.accompanist.navigation.material)
implementation(libs.accompanist.navigation.animation)

// Google
implementation(libs.google.material)
Expand Down
Loading

0 comments on commit 7d219da

Please sign in to comment.