From 4c95b62989d4447b10c4cea8decac444e7b98c37 Mon Sep 17 00:00:00 2001 From: Alexander Maryanovsky Date: Mon, 28 Oct 2024 15:27:29 +0200 Subject: [PATCH] Change Modifier.textFieldScroll to an expect function. Needed to allow a different implementation for uikit in Compose Multiplatform. Test: None needed. Change-Id: I0807d50c8f2c50232f74ba2141af879b3992950e --- .../foundation/text/TextFieldScroll.android.kt | 15 ++++++++------- .../compose/foundation/text/TextFieldScroll.kt | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.android.kt b/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.android.kt index fadeee5536351..e1bf5ed2b0730 100644 --- a/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.android.kt +++ b/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.android.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2024 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. @@ -32,9 +32,10 @@ internal actual fun Modifier.textFieldScroll( textFieldValue: TextFieldValue, visualTransformation: VisualTransformation, textLayoutResultProvider: () -> TextLayoutResultProxy? -): Modifier = defaultTextFieldScroll( - scrollerPosition, - textFieldValue, - visualTransformation, - textLayoutResultProvider, -) +): Modifier = + defaultTextFieldScroll( + scrollerPosition, + textFieldValue, + visualTransformation, + textLayoutResultProvider, + ) diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.kt index f60b408f0e078..df7bc7e1a1d5f 100644 --- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.kt +++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.kt @@ -115,6 +115,7 @@ internal fun Modifier.textFieldScrollable( } // Layout +// Expect/actual is needed due to a different implementation in uikit internal expect fun Modifier.textFieldScroll( scrollerPosition: TextFieldScrollerPosition, textFieldValue: TextFieldValue,