Adrian Landborn
05/23/2025, 8:37 AMAndroidView
and AccessibilityEvent
but that code is not too nice, Any ideas?Christiano
05/23/2025, 8:56 AMAlex Styl
05/23/2025, 10:06 AMAdrian Landborn
05/23/2025, 10:14 AMval focused = interactionSource.collectIsFocusedAsState()
Christiano
05/23/2025, 10:19 AMonFocusChanged
, focusProperties
, focusRequest
, focusRestorer
,...
Talkback focus does not follow this, and just does whatever the hell it wants... 😅
As far as I can tell, it just let's the user go to any location that contains text or has proper semantics. Not giving any callback as to what is focused, so there is no way to know what is getting focused and when. And also no way to manipulate the views or data if needed.Alex Styl
05/23/2025, 11:56 AM@Composable
private fun Modifier.debugFocusRing(): Modifier {
if (isDevelopment.not()) return this
var wasFocused by remember { mutableStateOf(false) }
return this.onFocusChanged { wasFocused = wasFocused.not() }
.border(thickness = 1.dp, Color.Red)
}
you would need to apply this to all items that can be focuseddorche
05/23/2025, 11:06 PM