Fixed
Status Update
Comments
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 4b76bcb828006b3324f9296ba9e4b21d2cb15374
Author: Ralston Da Silva <ralu@google.com>
Date: Wed Feb 03 14:55:03 2021
Add API to set the same KeyboardAction lambda for all ImeActions
Currently, if we want to specify the same action lambda for
all actions, we have to write something like this:
val anyAction: KeyboardActionScope.() -> Unit = { ... }
val keyboardActions = KeyboardActions(
onDone = anyAction,
onGo = anyAction,
onNext = anyAction,
onPrevious = anyAction,
onSearch = anyAction,
onSend = anyAction,
)
This CL adds a helper function to enable us to write code like this:
val keyboardActions = KeyboardActions(anyAction = {...} )
Bug: 179226323
Test: ./gradlew compose:ui:ui-test:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.test.TextActionsTest
Relnote: """Added a helper function that is helpful to
set the same action for all ImeAction callbacks"""
Change-Id: I63447afe1302a01b9c8a8480482d27920858bc4b
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/CapitalizationAutoCorrectDemo.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeInputField.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/KeyboardSingleLineDemo.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyboardActions.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TextActionsTest.kt
https://android-review.googlesource.com/1572848
Branch: androidx-main
commit 4b76bcb828006b3324f9296ba9e4b21d2cb15374
Author: Ralston Da Silva <ralu@google.com>
Date: Wed Feb 03 14:55:03 2021
Add API to set the same KeyboardAction lambda for all ImeActions
Currently, if we want to specify the same action lambda for
all actions, we have to write something like this:
val anyAction: KeyboardActionScope.() -> Unit = { ... }
val keyboardActions = KeyboardActions(
onDone = anyAction,
onGo = anyAction,
onNext = anyAction,
onPrevious = anyAction,
onSearch = anyAction,
onSend = anyAction,
)
This CL adds a helper function to enable us to write code like this:
val keyboardActions = KeyboardActions(anyAction = {...} )
Bug: 179226323
Test: ./gradlew compose:ui:ui-test:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.test.TextActionsTest
Relnote: """Added a helper function that is helpful to
set the same action for all ImeAction callbacks"""
Change-Id: I63447afe1302a01b9c8a8480482d27920858bc4b
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/CapitalizationAutoCorrectDemo.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeInputField.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/KeyboardSingleLineDemo.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyboardActions.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TextActionsTest.kt
Description
val anyAction: KeyboardActionScope.() -> Unit = { ... }
val keyboardActions = KeyboardActions(
onDone = anyAction,
onGo = anyAction,
onNext = anyAction,
onPrevious = anyAction,
onSearch = anyAction,
onSend = anyAction,
)
Add some helper function that changes the above code to something more simpler like:
val keyboardActions = KeyboardActions(anyAction = {...} )