yschimke
11/13/2023, 12:57 AMvar shouldShowWarningOverlay by remember { mutableStateOf(false) }
Box {
HierarchicalFocusCoordinator(requiresFocus = {
!shouldShowWarningOverlay
}) {
val state1 = rememberScalingLazyListState()
ScalingLazyColumn(
modifier = Modifier
.fillMaxSize()
.rotaryWithScroll(state1),
state = state1
) {
...
}
}
HierarchicalFocusCoordinator(requiresFocus = { shouldShowWarningOverlay }) {
AnimatedVisibility(visible = shouldShowWarningOverlay) {
val state2 = rememberScalingLazyListState()
ScalingLazyColumn(
modifier = Modifier
.fillMaxSize()
.rotaryWithScroll(state2),
state = state2
) {
...
}
}
}
}
louiscad
11/13/2023, 12:10 PMJonathan
11/13/2023, 3:05 PMHierarchicalFocusCoordinator(…)
. For example. I have a custom timer picker composable, made up a hour, minute, and second composable, that all can receive focus in order to received rotary scroll events. I would imagine the 3 child composable should be wrapped in a `HierarchicalFocusCoordinator`(…). But I ran into trouble with the requiresFocus
lambda. In order to determine which composable should be focused it seems like I’d need to implement a focus tracking system and defeating the purpose of the focus coordinator. Am I overthinking the component and it would work ideally for a custom time picker (Made up of 3 identical composable)?yschimke
11/13/2023, 9:41 PMJonathan
11/13/2023, 9:46 PMyschimke
11/13/2023, 9:46 PMJonathan
11/13/2023, 9:55 PM2023-11-13 165324.756 26118-26118 Choreographer com.android.vending I Skipped 59 frames! The application may be doing too much work on its main thread.
2023-11-13 165324.756 4312-4312 Choreographer com.example.oskitwear I Skipped 59 frames! The application may be doing too much work on its main thread.
2023-11-13 165324.756 485-572 system_server system_process W Long monitor contention with owner InputDispatcher (578) at void com.android.server.power.PowerManagerService.scheduleUserInactivityPreTimeout(long, long)(PowerManagerService.java:2957) waiters=0 in void com.android.server.power.PowerManagerService.releaseWakeLockInternal(android.os.IBinder, int) for 886ms
2023-11-13 165324.760 485-504 Looper system_process W Slow dispatch took 871ms android.fg h=android.os.Handler c=com.android.server.Watchdog$HandlerChecker@668b6a6 m=0
2023-11-13 165324.802 4312-4356 EGL_emulation com.example.oskitwear D app_time_stats: avg=1113.25ms min=1113.25ms max=1113.25ms count=1
yschimke
11/13/2023, 11:38 PM