Status Update
Comments
el...@gmail.com <el...@gmail.com> #2
Branch: androidx-master-dev
commit b2ae0a8c9429e6def582fda75e85f76540a31192
Author: Ralston Da Silva <ralu@google.com>
Date: Thu Jul 09 18:55:04 2020
New Focus Modifier Implementation
This is the first CL in a series of CLs which implement the new focus API. The new implementation consists of multiple modifiers each implementing a specific use case.
This CL adds FocusModifier2 and ModifiedFocusNode2 (Which will be renamed to FocusModifier and ModifiedFocusNode after the existing classes are deleted).
Bug: 160924778
Relnote: Added Modifier.focus which replaces FocusModifier.
Test: Built and launched the demo app
Change-Id: Ib852a056a0f3c76757f0fdef07e75e82bf178b8d
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/InnerPlaceable.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusModifier2.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusNodeUtils.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/ModifiedFocusNode2.kt
to...@gmail.com <to...@gmail.com> #3
Branch: androidx-master-dev
commit 79b361fcb1a863005e834f70a88cae274f6ca3ce
Author: Ralston Da Silva <ralu@google.com>
Date: Mon Jul 13 18:34:14 2020
Instantiate a ModifiedFocusNode2 corresponding to a Modifier.focus() modifier
Bug: 160924778
Test: Built and launched the demo app
Change-Id: Ib5e045621e36a72327acf148bb1698632ffe182f
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #4
Branch: androidx-master-dev
commit a52a858283c3ee5af05036e1e3665784a3051f4f
Author: Ralston Da Silva <ralu@google.com>
Date: Mon Jul 13 18:19:31 2020
Add a modifier to request focus changes
Bug: 161182057, 160924778
Relnote: Added a modifier to request focus changes
Test: Built and launched the demo App.
Change-Id: I8dd73cf3ce77e112a9f97f203b8ec7a0f07bc706
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusRequester.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusRequesterModifier.kt
A ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/ModifiedFocusRequesterNode.kt
ra...@google.com <ra...@google.com>
da...@gmail.com <da...@gmail.com> #5
Branch: androidx-master-dev
commit c8c1ab4e79928727f722e5c946c7342dd9fa30f8
Author: Ralston Da Silva <ralu@google.com>
Date: Wed Jul 15 01:20:27 2020
Instantiate a ModifiedFocusNode2 corresponding to a Modifier.focus() modifier
Bug: 160924778
Test: Built and launched the demo app
Change-Id: Ide2b07ec55b65627d1a8cfedef55848807537bac
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
ra...@google.com <ra...@google.com> #6
This will be cherry picked onto 1.4 and will be available in the next bi-weekly release.
na...@google.com <na...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.4.3
he...@gmail.com <he...@gmail.com> #8
This bug still exists with androidx.compose.ui:ui:1.4.3
:
java.lang.IllegalStateException: Check failed.
at androidx.compose.ui.focus.FocusTargetModifierNode.fetchFocusProperties$ui_release(FocusTargetModifierNode.kt:197)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:189)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:192)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.findChildCorrespondingToFocusEnter--OM-vw8(TwoDimensionalFocusSearch.kt:103)
at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.twoDimensionalFocusSearch--OM-vw8(TwoDimensionalFocusSearch.kt:84)
at androidx.compose.ui.focus.FocusTraversalKt.focusSearch-sMXa3k8(FocusTraversal.kt:106)
at androidx.compose.ui.focus.FocusOwnerImpl.moveFocus-3ESFkO8(FocusOwnerImpl.kt:162)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1.invoke-ZmokQxo(AndroidComposeView.android.kt:206)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1.invoke(AndroidComposeView.android.kt:201)
at androidx.compose.ui.input.key.KeyInputModifierNodeImpl.onKeyEvent-ZmokQxo(KeyInputModifier.kt:80)
at androidx.compose.ui.focus.FocusOwnerImpl.dispatchKeyEvent-ZmokQxo(FocusOwnerImpl.kt:193)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:646)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1965)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:486)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1889)
at android.app.Activity.dispatchKeyEvent(Activity.java:4222)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:85)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:400)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6500)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6366)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5826)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5883)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5849)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6014)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5857)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6071)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5830)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5883)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5849)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5857)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5830)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5883)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5849)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6047)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6227)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3741)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:3261)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:3252)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3718)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:154)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7898)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
na...@google.com <na...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.5.0-alpha04
he...@gmail.com <he...@gmail.com> #10
Issue is fixed with 1.5.0-alpha04
pa...@geocaching.com <pa...@geocaching.com> #11
mr...@gmail.com <mr...@gmail.com> #12
pl...@google.com <pl...@google.com> #13
To the authors of
mr...@gmail.com <mr...@gmail.com> #14
FATAL EXCEPTION: main Process: sampleapp.tv.debug, PID: 10202 java.lang.IllegalStateException: Check failed. at androidx.compose.ui.focus.FocusTargetModifierNode.fetchFocusProperties$ui_release(FocusTargetModifierNode.kt:197) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:189) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.collectAccessibleChildren(TwoDimensionalFocusSearch.kt:192) at androidx.compose.ui.focus.TwoDimensionalFocusSearchKt.findChildCorrespondingToFocusEnter--OM-vw8(TwoDimensionalFocusSearch.kt:103) at androidx.compose.ui.focus.FocusRequester.focus$ui_release(FocusRequester.kt:74) at androidx.compose.ui.focus.FocusRequester.requestFocus(FocusRequester.kt:63) at androidx.tv.material3.NavigationDrawerKt$DrawerSheet$2$1.invokeSuspend(NavigationDrawer.kt:249) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7898) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@fc1e6d, androidx.compose.runtime.BroadcastFrameClock@1ec5aa2, StandaloneCoroutine{Cancelling}@8c2333, AndroidUiDispatcher@ad6b6f0]
mr...@gmail.com <mr...@gmail.com> #15
In my case its happening when using a NavigationDrawer from androidx.tv.material3. reproduction steps are easy, let the Navigation drawer gain focus and then move the focus to something else, try go back to Navigation drawer and boom!
pa...@geocaching.com <pa...@geocaching.com> #16
Good news - The crash is now resolved for us. We had been declaring each Compose dependency individually in our build.gradle. I updated all of our Compose dependencies to the latest available versions, including androidx.compose.ui:ui:1.5.0-alpha04. This did not resolve the issue for us. Finally, I switched over to using the Compose BoM (2023.04.01), and that fixed it! Interestingly, that version of the BoM is using version 1.4.2 of Compose UI. I hope this may help others who are still experiencing the crash.
pr...@google.com <pr...@google.com> #17
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-foundation:1.0.0-alpha07
ir...@gmail.com <ir...@gmail.com> #18
```kotlin
Box(
modifier = Modifier
.clickable(false) {}
) {
SelectionContainer {
Text(
text = value,
fontSize = 18.sp,
color = MaterialTheme.colors.normalTextColor,
overflow = TextOverflow.Ellipsis,
maxLines = 2
)
}
}
```
bb...@jeniusbank.com <bb...@jeniusbank.com> #19
To add to .clickable(enabled = true)
then the user long presses to highlight text, and the state is changed to false
, or if you change the text in some way (ex. from another button) an exception is thrown. This is the same exception that is thrown when long pressing and the .clickable
is set to false
java.lang.IllegalStateException: Cannot read CompositionLocal because the Modifier node is not currently attached.
Using a combinedClickable
in the same manner crashes with the same exceptions.
Description
1.4.0
1.8.10
Unfortunately I have not managed to create a reproducible example or certain steps to recreate this. I will update more details in response if I can find out more details.
Stack trace 1
In this case
moveFocus
was called by the framework in response to a key press.Stack trace 2
In this case
LocalFocusManager.current.moveFocus(FocusDirection.Enter)
was manually called from application code.Both traces seem to have
twoDimensionalFocusSearch
in the stack only once, which to my understanding would indicate the focus search is beginning from the root of the hierarchy. I am not yet familiar with the Modifier Node architecture, but this would seem to indicate that the root node is for some reason detached from the layout?