Skip to content

Commit fde8566

Browse files
Treehugger RobotGerrit Code Review
authored andcommitted
Merge "Remove ComposeUiFlags.isIgnoreInvalidPrevFocusRectEnabled" into androidx-main
2 parents 80b162f + 9302492 commit fde8566

5 files changed

Lines changed: 6 additions & 22 deletions

File tree

‎compose/ui/ui/api/current.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ package androidx.compose.ui {
154154
property public boolean isAccessibilityShowOnScreenNestedScrollingEnabled;
155155
property public boolean isBypassUnfocusableComposeViewEnabled;
156156
property public boolean isGraphicsLayerShapeSemanticsEnabled;
157-
property public boolean isIgnoreInvalidPrevFocusRectEnabled;
158157
property public boolean isIndirectPointerNavigationGestureDetectorEnabled;
159158
property public boolean isInitialFocusOnFocusableAvailable;
160159
property public boolean isOptimizedFocusEventDispatchEnabled;
@@ -168,7 +167,6 @@ package androidx.compose.ui {
168167
field public static boolean isAccessibilityShowOnScreenNestedScrollingEnabled;
169168
field public static boolean isBypassUnfocusableComposeViewEnabled;
170169
field public static boolean isGraphicsLayerShapeSemanticsEnabled;
171-
field public static boolean isIgnoreInvalidPrevFocusRectEnabled;
172170
field public static boolean isIndirectPointerNavigationGestureDetectorEnabled;
173171
field public static boolean isInitialFocusOnFocusableAvailable;
174172
field public static boolean isOptimizedFocusEventDispatchEnabled;

‎compose/ui/ui/api/restricted_current.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ package androidx.compose.ui {
154154
property public boolean isAccessibilityShowOnScreenNestedScrollingEnabled;
155155
property public boolean isBypassUnfocusableComposeViewEnabled;
156156
property public boolean isGraphicsLayerShapeSemanticsEnabled;
157-
property public boolean isIgnoreInvalidPrevFocusRectEnabled;
158157
property public boolean isIndirectPointerNavigationGestureDetectorEnabled;
159158
property public boolean isInitialFocusOnFocusableAvailable;
160159
property public boolean isOptimizedFocusEventDispatchEnabled;
@@ -168,7 +167,6 @@ package androidx.compose.ui {
168167
field public static boolean isAccessibilityShowOnScreenNestedScrollingEnabled;
169168
field public static boolean isBypassUnfocusableComposeViewEnabled;
170169
field public static boolean isGraphicsLayerShapeSemanticsEnabled;
171-
field public static boolean isIgnoreInvalidPrevFocusRectEnabled;
172170
field public static boolean isIndirectPointerNavigationGestureDetectorEnabled;
173171
field public static boolean isInitialFocusOnFocusableAvailable;
174172
field public static boolean isOptimizedFocusEventDispatchEnabled;

‎compose/ui/ui/src/androidDeviceTest/kotlin/androidx/compose/ui/focus/RequestFocusTest.kt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,7 @@ class RequestFocusTest {
859859
assertThat(success).isTrue()
860860
rule.onNodeWithTag(tag1).assertIsFocused()
861861
}
862-
ComposeUiFlags.isBypassUnfocusableComposeViewEnabled &&
863-
ComposeUiFlags.isIgnoreInvalidPrevFocusRectEnabled -> {
862+
ComposeUiFlags.isBypassUnfocusableComposeViewEnabled -> {
864863
assertThat(success).isTrue()
865864
rule.onNodeWithTag(tag2).assertIsFocused()
866865
}

‎compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,14 +1301,11 @@ internal class AndroidComposeView(context: Context, composeViewContext: ComposeV
13011301
}
13021302
if (requestFocusWithPrevRect == true) return true
13031303

1304-
@OptIn(ExperimentalComposeUiApi::class)
1305-
if (ComposeUiFlags.isIgnoreInvalidPrevFocusRectEnabled) {
1306-
val requestFocusWithoutPrevRect =
1307-
focusOwner.focusSearch(focusDirection = focusDirection, focusedRect = null) {
1308-
it.requestFocus(focusDirection)
1309-
}
1310-
if (requestFocusWithoutPrevRect == true) return true
1311-
}
1304+
val requestFocusWithoutPrevRect =
1305+
focusOwner.focusSearch(focusDirection = focusDirection, focusedRect = null) {
1306+
it.requestFocus(focusDirection)
1307+
}
1308+
if (requestFocusWithoutPrevRect == true) return true
13121309

13131310
// If we landed on this view and a sub-view already has focus, it means that FocusFinder
13141311
// could not find something else to focus on, and rolled over and returned back to this

‎compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/ComposeUiFlags.kt‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ object ComposeUiFlags {
6969
@JvmField
7070
var isBypassUnfocusableComposeViewEnabled: Boolean = true
7171

72-
/**
73-
* This flag enables a fix for b/388590015. The view system ignores an invalid prevFocusRect
74-
* when requestFocus is called, so we support this behavior in Compose too.
75-
*/
76-
@field:Suppress("MutableBareField")
77-
@JvmField
78-
var isIgnoreInvalidPrevFocusRectEnabled: Boolean = true
79-
8072
/**
8173
* Enable WindowInsets rulers:
8274
* * `SystemBarsRulers`

0 commit comments

Comments
 (0)