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 fc63345279e9fd99aed594708cd82bf2a7ff30b6
Author: Ralston Da Silva <ralu@google.com>
Date: Tue Feb 02 13:43:15 2021
Add Modifier.focusOrder() overload with no lambda
We currently specify focus order like this:
Column {
TextField(
Modifier.focusRequester(ref1)
)
TextField(
Modifier.focusOrder(ref2){
previous = ref1
}
)
}
Notice how we had to use a focusRequester to
specify ref1 but didn't need this for ref2.
This CL adds an overloaded focusOrder that
accepts a focusRequester without a lambda,
so the above code can be written as:
Column {
TextField(
Modifier.focusOrder(ref1)
)
TextField(
Modifier.focusOrder(ref2){
previous = ref1
}
)
}
Bug: 179180978
Test: ./gradlew compose:ui:ui:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.focus.CustomFocusTraversalTest
Relnote: """Added an Modifier.focusOrder() that
accepts a FocusRequester without specifying a
custom focus order a lambda. This is useful
when we only need to specify a reference
but not a custom focus order for a composable"""
Change-Id: I4f52aa4697d6c7d23b7aa4f49719e2eb55302920
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/focus/CustomFocusTraversalTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusOrderModifier.kt
https://android-review.googlesource.com/1571273
Branch: androidx-main
commit fc63345279e9fd99aed594708cd82bf2a7ff30b6
Author: Ralston Da Silva <ralu@google.com>
Date: Tue Feb 02 13:43:15 2021
Add Modifier.focusOrder() overload with no lambda
We currently specify focus order like this:
Column {
TextField(
Modifier.focusRequester(ref1)
)
TextField(
Modifier.focusOrder(ref2){
previous = ref1
}
)
}
Notice how we had to use a focusRequester to
specify ref1 but didn't need this for ref2.
This CL adds an overloaded focusOrder that
accepts a focusRequester without a lambda,
so the above code can be written as:
Column {
TextField(
Modifier.focusOrder(ref1)
)
TextField(
Modifier.focusOrder(ref2){
previous = ref1
}
)
}
Bug: 179180978
Test: ./gradlew compose:ui:ui:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.focus.CustomFocusTraversalTest
Relnote: """Added an Modifier.focusOrder() that
accepts a FocusRequester without specifying a
custom focus order a lambda. This is useful
when we only need to specify a reference
but not a custom focus order for a composable"""
Change-Id: I4f52aa4697d6c7d23b7aa4f49719e2eb55302920
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/focus/CustomFocusTraversalTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusOrderModifier.kt
Description
Column {
TextField(Modifier.focusRequester(ref1)
TextField(Modifier.focusOrder(ref2){ previous = ref1 })
}
Notice how we had to use a focusRequester to specify ref1 but didn't need this for ref2.
It would be nice if we had an overloaded focusOrder that only accepted a focusRequester without a lambda.