Skip to content

Commit

Permalink
Update AndroidX. AGP 8.4.0-alpha08.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Feb 7, 2024
1 parent cae463f commit 69ffd40
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.github.reactivecircus.kstreamlined.android

import androidx.compose.animation.core.EaseInOutQuart
import androidx.compose.animation.core.tween
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBarsPadding
Expand Down Expand Up @@ -32,7 +31,6 @@ import io.github.reactivecircus.kstreamlined.android.foundation.designsystem.fou
import io.github.reactivecircus.kstreamlined.kmp.model.feed.FeedItem
import kotlin.math.absoluteValue

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun MainScreen(
onViewItem: (FeedItem) -> Unit,
Expand Down Expand Up @@ -102,7 +100,6 @@ fun MainScreen(
}
}

@OptIn(ExperimentalFoundationApi::class)
private fun Modifier.pagerScaleTransition(page: Int, pagerState: PagerState) = graphicsLayer {
val pageOffset = (pagerState.currentPage - page) + pagerState.currentPageOffsetFraction
lerp(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.reactivecircus.kstreamlined.android.foundation.commonui.feed

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -37,7 +36,6 @@ import io.github.reactivecircus.kstreamlined.kmp.model.feed.FeedItem
import io.github.reactivecircus.kstreamlined.kmp.model.feed.toDisplayable
import kotlinx.datetime.toInstant

@OptIn(ExperimentalFoundationApi::class)
@Composable
public fun KotlinYouTubeCard(
item: DisplayableFeedItem<FeedItem.KotlinYouTube>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.reactivecircus.kstreamlined.android.foundation.commonui.feed

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -44,7 +43,6 @@ import io.github.reactivecircus.kstreamlined.kmp.model.feed.FeedItem
import io.github.reactivecircus.kstreamlined.kmp.model.feed.toDisplayable
import kotlinx.datetime.toInstant

@OptIn(ExperimentalFoundationApi::class)
@Composable
public fun TalkingKotlinCard(
item: DisplayableFeedItem<FeedItem.TalkingKotlin>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.DefaultMarqueeDelayMillis
import androidx.compose.foundation.DefaultMarqueeIterations
import androidx.compose.foundation.DefaultMarqueeSpacing
import androidx.compose.foundation.DefaultMarqueeVelocity
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.MarqueeAnimationMode
import androidx.compose.foundation.MarqueeSpacing
import androidx.compose.foundation.basicMarquee
Expand All @@ -25,7 +24,6 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

@Stable
@OptIn(ExperimentalFoundationApi::class)
public fun Modifier.marqueeWithFadedEdges(
fadedEdgeMode: FadedEdgeMode = FadedEdgeMode.Both,
edgeWidth: Dp = DefaultEdgeWidth,
Expand All @@ -36,56 +34,52 @@ public fun Modifier.marqueeWithFadedEdges(
initialDelayMillis: Int = if (animationMode == MarqueeAnimationMode.Immediately) delayMillis else 0,
spacing: MarqueeSpacing = DefaultMarqueeSpacing,
velocity: Dp = DefaultMarqueeVelocity
): Modifier = this.then(
if (fadedEdgeMode != FadedEdgeMode.None) {
offset(x = -startEdgePadding)
.graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen }
} else {
Modifier
}
.drawWithContent {
drawContent()
when (fadedEdgeMode) {
FadedEdgeMode.Both -> {
drawFadedEdge(
edgeWidth = edgeWidth,
leftEdge = true,
)
drawFadedEdge(
edgeWidth = edgeWidth,
leftEdge = false,
)
}

FadedEdgeMode.Start -> drawFadedEdge(
): Modifier = if (fadedEdgeMode != FadedEdgeMode.None) {
offset(x = -startEdgePadding)
.graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen }
} else { this }
.drawWithContent {
drawContent()
when (fadedEdgeMode) {
FadedEdgeMode.Both -> {
drawFadedEdge(
edgeWidth = edgeWidth,
leftEdge = true,
)

FadedEdgeMode.End -> drawFadedEdge(
drawFadedEdge(
edgeWidth = edgeWidth,
leftEdge = false,
)

FadedEdgeMode.None -> Unit
}

FadedEdgeMode.Start -> drawFadedEdge(
edgeWidth = edgeWidth,
leftEdge = true,
)

FadedEdgeMode.End -> drawFadedEdge(
edgeWidth = edgeWidth,
leftEdge = false,
)

FadedEdgeMode.None -> Unit
}
.basicMarquee(
iterations = iterations,
animationMode = animationMode,
delayMillis = delayMillis,
initialDelayMillis = initialDelayMillis,
spacing = spacing,
velocity = velocity
)
.then(
if (fadedEdgeMode != FadedEdgeMode.None) {
padding(start = startEdgePadding)
} else {
Modifier
}
)
)
}
.basicMarquee(
iterations = iterations,
animationMode = animationMode,
delayMillis = delayMillis,
initialDelayMillis = initialDelayMillis,
spacing = spacing,
velocity = velocity
)
.then(
if (fadedEdgeMode != FadedEdgeMode.None) {
Modifier.padding(start = startEdgePadding)
} else {
Modifier
}
)

@JvmInline
public value class FadedEdgeMode private constructor(private val value: Int) {
Expand Down
16 changes: 8 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "2.0.0-Beta3"
ksp = "2.0.0-Beta3-1.0.17"
androidGradlePlugin = "8.4.0-alpha07"
androidGradlePlugin = "8.4.0-alpha08"
gradle-toolchainsResolverPlugin = "0.8.0"
appVersioning = "1.3.1"
apollo = "4.0.0-beta.4"
Expand All @@ -24,17 +24,17 @@ firebase-perfPlugin = "1.4.2"
firebase-crashlytics = "18.6.1"
firebase-crashlyticsPlugin = "2.9.9"
androidx-compose-compiler = "1.5.9-dev-k2.0.0-Beta3-7c5ec6895a0"
androidx-compose-ui = "1.7.0-alpha01"
androidx-compose-foundation = "1.7.0-alpha01"
androidx-compose-material3 = "1.2.0-rc01"
androidx-core = "1.13.0-alpha04"
androidx-compose-ui = "1.7.0-alpha02"
androidx-compose-foundation = "1.7.0-alpha02"
androidx-compose-material3 = "1.2.0"
androidx-core = "1.13.0-alpha05"
androidx-coreSplashscreen = "1.0.1"
androidx-activity = "1.9.0-alpha02"
androidx-activity = "1.9.0-alpha03"
androidx-lifecycle = "2.7.0"
androidx-dataStore = "1.1.0-beta01"
androidx-browser="1.8.0-beta01"
androidx-browser="1.8.0-beta02"
androidx-media3 = "1.2.1"
androidx-profileinstaller = "1.3.1"
androidx-profileinstaller = "1.4.0-alpha01"
androidx-benchmark = "1.2.3"
androidx-metrics = "1.0.0-beta01"
coil = "3.0.0-alpha04"
Expand Down

0 comments on commit 69ffd40

Please sign in to comment.