Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate CupertinoScrollDecayAnimationSpec and CupertinoOverscrollEffect #1806

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import androidx.compose.ui.unit.LayoutDirection
internal actual fun rememberPlatformOverscrollEffect(): OverscrollEffect? =
rememberOverscrollEffect(applyClip = false)

@OptIn(ExperimentalFoundationApi::class)
@Composable
internal fun rememberOverscrollEffect(applyClip: Boolean): OverscrollEffect {
val density = LocalDensity.current.density
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.animation.core.AnimationState
import androidx.compose.animation.core.VectorConverter
import androidx.compose.animation.core.animateTo
import androidx.compose.animation.core.spring
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.OverscrollEffect
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -86,8 +85,7 @@ private data class CupertinoOverscrollAvailableDelta(
* @param applyClip Some consumers of overscroll effect apply clip by themselves and some don't,
* thus this flag is needed to update our modifier chain and make the clipping correct in every case while avoiding redundancy
*/
@ExperimentalFoundationApi
class CupertinoOverscrollEffect(
internal class CupertinoOverscrollEffect(
private val density: Float,
layoutDirection: LayoutDirection,
val applyClip: Boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 The Android Open Source Project
* Copyright 2025 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package androidx.compose.animation.core.cupertino
package androidx.compose.foundation.cupertino

import androidx.compose.animation.core.FloatDecayAnimationSpec
import kotlin.math.abs
Expand All @@ -30,7 +30,7 @@ import platform.UIKit.UIScrollViewDecelerationRateNormal
* @property decelerationRate The rate at which the velocity decelerates over time.
* Default value is equal to one used by default UIScrollView behavior.
*/
class CupertinoScrollDecayAnimationSpec(
internal class CupertinoScrollDecayAnimationSpec(
private val decelerationRate: Float = UIScrollViewDecelerationRateNormal.toFloat()
) : FloatDecayAnimationSpec {

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

package androidx.compose.foundation.gestures

import androidx.compose.animation.core.cupertino.CupertinoScrollDecayAnimationSpec
import androidx.compose.animation.core.generateDecayAnimationSpec
import androidx.compose.foundation.cupertino.CupertinoScrollDecayAnimationSpec
import androidx.compose.foundation.gestures.cupertino.CupertinoFlingBehavior
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
Expand Down