From afc34a44b9c99f206955ede7fde3c871933449ed Mon Sep 17 00:00:00 2001 From: Halil Ozercan Date: Wed, 13 Mar 2024 19:18:39 +0000 Subject: [PATCH] Stabilize `rememberTextFieldState` Relnote: "`rememberTextFieldState` is graduated to a Stable API." Test: N/A Change-Id: I3799979f1211c2182f32e45af82be5d13e181f3d --- compose/foundation/foundation/api/current.txt | 2 +- compose/foundation/foundation/api/restricted_current.txt | 2 +- .../androidx/compose/foundation/text/input/TextFieldState.kt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/compose/foundation/foundation/api/current.txt b/compose/foundation/foundation/api/current.txt index 9d277bbe967e7..e82b0afcc6e75 100644 --- a/compose/foundation/foundation/api/current.txt +++ b/compose/foundation/foundation/api/current.txt @@ -1763,7 +1763,7 @@ package androidx.compose.foundation.text.input { public final class TextFieldStateKt { method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static void clearText(androidx.compose.foundation.text.input.TextFieldState); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static suspend Object? forEachTextValue(androidx.compose.foundation.text.input.TextFieldState, kotlin.jvm.functions.Function2,?> block, kotlin.coroutines.Continuation); - method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Composable public static androidx.compose.foundation.text.input.TextFieldState rememberTextFieldState(optional String initialText, optional long initialSelection); + method @androidx.compose.runtime.Composable public static androidx.compose.foundation.text.input.TextFieldState rememberTextFieldState(optional String initialText, optional long initialSelection); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static void setTextAndPlaceCursorAtEnd(androidx.compose.foundation.text.input.TextFieldState, String text); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static void setTextAndSelectAll(androidx.compose.foundation.text.input.TextFieldState, String text); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static kotlinx.coroutines.flow.Flow textAsFlow(androidx.compose.foundation.text.input.TextFieldState); diff --git a/compose/foundation/foundation/api/restricted_current.txt b/compose/foundation/foundation/api/restricted_current.txt index f58c44117385c..710aed4572111 100644 --- a/compose/foundation/foundation/api/restricted_current.txt +++ b/compose/foundation/foundation/api/restricted_current.txt @@ -1767,7 +1767,7 @@ package androidx.compose.foundation.text.input { public final class TextFieldStateKt { method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static void clearText(androidx.compose.foundation.text.input.TextFieldState); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static suspend Object? forEachTextValue(androidx.compose.foundation.text.input.TextFieldState, kotlin.jvm.functions.Function2,?> block, kotlin.coroutines.Continuation); - method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Composable public static androidx.compose.foundation.text.input.TextFieldState rememberTextFieldState(optional String initialText, optional long initialSelection); + method @androidx.compose.runtime.Composable public static androidx.compose.foundation.text.input.TextFieldState rememberTextFieldState(optional String initialText, optional long initialSelection); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static void setTextAndPlaceCursorAtEnd(androidx.compose.foundation.text.input.TextFieldState, String text); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static void setTextAndSelectAll(androidx.compose.foundation.text.input.TextFieldState, String text); method @SuppressCompatibility @androidx.compose.foundation.ExperimentalFoundationApi public static kotlinx.coroutines.flow.Flow textAsFlow(androidx.compose.foundation.text.input.TextFieldState); diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/TextFieldState.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/TextFieldState.kt index f63d0e7b1e93d..796809265576a 100644 --- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/TextFieldState.kt +++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/TextFieldState.kt @@ -500,7 +500,6 @@ fun TextFieldState.textAsFlow(): Flow = snapshotFlow { te * If you need to store a [TextFieldState] in another object, use the [TextFieldState.Saver] object * to manually save and restore the state. */ -@ExperimentalFoundationApi @Composable fun rememberTextFieldState( initialText: String = "",