Skip to content

Commit

Permalink
Updates to Compose 1.6.0 (#7)
Browse files Browse the repository at this point in the history
* Updates to Compose 1.6.0

* Updates to Android Gradle Plugin 8.1.3

* Fix lint warnings
  • Loading branch information
fornewid committed Mar 2, 2024
1 parent be08d8a commit 956507a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -124,7 +124,7 @@ public fun Modifier.placeholder(
val lastOutline = remember { Ref<Outline>() }

// The current highlight animation progress
var highlightProgress: Float by remember { mutableStateOf(0f) }
var highlightProgress: Float by remember { mutableFloatStateOf(0f) }

// This is our crossfade transition
val transitionState = remember { MutableTransitionState(visible) }.apply {
Expand All @@ -146,11 +146,12 @@ public fun Modifier.placeholder(
// Run the optional animation spec and update the progress if the placeholder is visible
val animationSpec = highlight?.animationSpec
if (animationSpec != null && (visible || placeholderAlpha >= 0.01f)) {
val infiniteTransition = rememberInfiniteTransition()
val infiniteTransition = rememberInfiniteTransition(label = "highlight transition")
highlightProgress = infiniteTransition.animateFloat(
initialValue = 0f,
targetValue = 1f,
animationSpec = animationSpec,
label = "highlight progress animation",
).value
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]

compose = "1.6.0-alpha03"
compose = "1.6.0"
composeCompiler = "1.4.8"
composeMaterial3 = "1.1.1"

dokka = "1.8.10"

gradlePlugin = "8.0.2"
gradlePlugin = "8.1.3"

ktlint = "0.45.2"
kotlin = "1.8.22"
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Jul 30 00:42:40 KST 2023
#Sat Mar 02 16:46:06 KST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=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
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 956507a

Please sign in to comment.