Skip to content

Commit

Permalink
Merge pull request #6 from LDRAlighieri/update/dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
LDRAlighieri committed Dec 20, 2023
2 parents 0125b0d + bb20368 commit 73888fa
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2

- name: Check build-logic
run: ./gradlew check -p build-logic

- name: Check spotless
run: ./gradlew spotlessCheck --no-configuration-cache

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2

- name: Check build-logic
run: ./gradlew check -p build-logic

- name: Check spotless
run: ./gradlew spotlessCheck --no-configuration-cache

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# ChangeLog


## Version 0.3.1

* Update: Kotlin to v1.9.21.
* Update: Compose BOM to v2023.10.01.
* Update: Minor update of other libraries.


## Version 0.3.0

* Update: Fiberglass(`composites-fiberglass`) module:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2023 Vladimir Raupov

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 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.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)
[![Kotlin Version](https://img.shields.io/badge/Kotlin-v1.9.21-blue.svg?logo=kotlin)](https://kotlinlang.org)
[![Compose BOM Version](https://img.shields.io/badge/Compose-v2023.10.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)
Expand Down Expand Up @@ -31,7 +31,7 @@ Add one or more dependencies:

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

Expand Down
43 changes: 26 additions & 17 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
@file:Suppress("UnstableApiUsage")

/*
* Copyright 2023 Vladimir Raupov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Copyright 2023 Vladimir Raupov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
`kotlin-dsl`
Expand All @@ -26,10 +28,17 @@ java {
}

dependencies {
implementation(libs.android.gradlePlugin)
implementation(libs.kotlin.gradlePlugin)
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.spotless.gradlePlugin)
implementation(libs.dokka.gradlePlugin)
implementation(libs.spotless.gradlePlugin)
}

tasks {
validatePlugins {
enableStricterValidation = true
failOnWarning = true
}
}

gradlePlugin {
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.3.0")
implementation("ru.ldralighieri.composites:composites-fiberglass:0.3.1")
}
```

Expand Down
2 changes: 1 addition & 1 deletion 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.4.0-SNAPSHOT
VERSION_NAME=0.3.1

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

Expand Down
26 changes: 11 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
[versions]
# Plugins
agp = "8.1.0"
dokka = "1.8.20"
spotless = "6.20.0"
agp = "8.2.0"
dokka = "1.9.10"
spotless = "6.23.3"
mavenPublish = "0.25.3"
bcv = "0.13.2"
gver = "0.47.0"
gver = "0.50.0"

# Kotlin
kotlin = "1.9.0"
kotlin = "1.9.21"

# Androidx
androidxCoreSplashscreen = "1.0.1"
androidxActivity = "1.7.2"
androidxNavigation = "2.7.0"
androidxPagingCompose = "3.2.0"
androidxActivity = "1.8.2"
androidxNavigation = "2.7.6"
androidxPagingCompose = "3.2.1"
# Compose
androidxComposeCompiler = "1.5.1"
androidxComposeBom = "2023.08.00"
# Accompanist
accompanist = "0.30.1"
androidxComposeCompiler = "1.5.7"
androidxComposeBom = "2023.10.01"

# Google
googleMaterial="1.9.0"
googleMaterial="1.11.0"

# Lint
ktlint = "0.49.1"
Expand All @@ -48,8 +46,6 @@ androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test-junit4" }
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }

# Accompanist
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", 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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3 changes: 0 additions & 3 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ dependencies {
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.ui.tooling)

// Accompanist
implementation(libs.accompanist.systemuicontroller)

// Google
implementation(libs.google.material)
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@

package ru.ldralighieri.composites.sample.ui

import android.graphics.Color
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.WindowCompat
import ru.ldralighieri.composites.sample.ui.app.CompositesApp
Expand All @@ -28,10 +31,12 @@ class SampleActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT),
navigationBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT)
)
super.onCreate(savedInstanceState)

WindowCompat.setDecorFitsSystemWindows(window, false)

setContent {
CompositesApp(
rememberCompositesAppState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,37 @@

package ru.ldralighieri.composites.sample.ui.app

import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.LocalOverscrollConfiguration
import androidx.compose.foundation.background
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import androidx.compose.ui.graphics.toArgb
import ru.ldralighieri.composites.sample.navigation.AppNavHost
import ru.ldralighieri.composites.sample.theme.AppTheme

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CompositesApp(appState: CompositesAppState) {
fun ComponentActivity.CompositesApp(appState: CompositesAppState) {
val currentThemeIsDark = isSystemInDarkTheme()
val isDarkMode by rememberSaveable { mutableStateOf(currentThemeIsDark) }

ChangeSystemBarsTheme(isDarkMode)

ProvideDefaults {
Column {
Scaffold(
Expand All @@ -49,6 +59,7 @@ fun CompositesApp(appState: CompositesAppState) {
onBackClick = appState::onBackClick,
navigate = appState::navigate,
modifier = Modifier
.background(color = AppTheme.colors.background)
.padding(innerPadding)
.consumeWindowInsets(innerPadding)
)
Expand All @@ -58,16 +69,26 @@ fun CompositesApp(appState: CompositesAppState) {
}

@Composable
private fun ProvideDefaults(content: @Composable () -> Unit) {
AppTheme(dynamicColor = true) {
val systemUiController = rememberSystemUiController()
val useDarkIcons = !isSystemInDarkTheme()
private fun ComponentActivity.ChangeSystemBarsTheme(isDarkMode: Boolean) {
val barColor = AppTheme.colors.background.toArgb()
LaunchedEffect(isDarkMode) {
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(
lightScrim = android.graphics.Color.TRANSPARENT,
darkScrim = android.graphics.Color.TRANSPARENT,
) { isDarkMode },

DisposableEffect(systemUiController, useDarkIcons) {
systemUiController.setSystemBarsColor(color = Color.Transparent, darkIcons = useDarkIcons)
onDispose {}
}
navigationBarStyle = SystemBarStyle.auto(
lightScrim = barColor,
darkScrim = barColor,
) { isDarkMode },
)
}
}

@Composable
private fun ProvideDefaults(content: @Composable () -> Unit) {
AppTheme(dynamicColor = true) {
@OptIn(ExperimentalFoundationApi::class)
CompositionLocalProvider(
LocalOverscrollConfiguration provides null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package ru.ldralighieri.composites.sample.ui.fiberglass

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
Expand Down

0 comments on commit 73888fa

Please sign in to comment.