Fixed
Status Update
Comments
jn...@google.com <jn...@google.com>
mk...@google.com <mk...@google.com>
mk...@google.com <mk...@google.com>
ap...@google.com <ap...@google.com> #2
Hi - It's likely that the code is missing use of the HierarchicalFocusCoordinator to set the focus on the ScalingLazyColumn when switching pages. Please could you provide some cutdown sample code that demonstrates the issue (looks like the code in the video would be sufficient).
st...@google.com <st...@google.com>
ty...@gmail.com <ty...@gmail.com> #3
It seems like that HierarchicalFocusCoordinator is already implemented in Horologist PagerScreen (see the screenshots), or i don't understand the role of this Coordinator (focus implementation isn't really too clear to me). My PageScaffold is a subview of PagerScreen.
I tried to request focus in my scaling lazy column, without any changes.
fun ViewWithList(pageNumber: Int, columnState: ScalingLazyColumnState, context: Context,) {
ScalingLazyColumn(
modifier = Modifier
.fillMaxSize()
.composed {
val focusRequester = rememberActiveFocusRequester()
RequestFocusWhenActive(focusRequester = focusRequester)
this.focusRequester(focusRequester).focusable()
},
columnState = columnState,
)
Can you explain me better your idea please :)?
I tried to request focus in my scaling lazy column, without any changes.
fun ViewWithList(pageNumber: Int, columnState: ScalingLazyColumnState, context: Context,) {
ScalingLazyColumn(
modifier = Modifier
.fillMaxSize()
.composed {
val focusRequester = rememberActiveFocusRequester()
RequestFocusWhenActive(focusRequester = focusRequester)
this.focusRequester(focusRequester).focusable()
},
columnState = columnState,
)
Can you explain me better your idea please :)?
Description
Version used: Alpha20
`modifier.edgeSwipeToDismiss(state)` doesn't help as I don't have the state, it's internal in SwipeDismissableNavHost.
```
@Composable
fun WearApp() {
val navController = rememberSwipeDismissableNavController()
Scaffold(
modifier = Modifier.fillMaxSize(),
) {
SwipeDismissableNavHost(
navController = navController,
startDestination = "start",
) {
composable(route = "start") {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Button(onClick = { navController.navigate("second") }) {
Text("Pager")
}
}
}
composable(route = "second") {
val state = rememberPagerState()
val shape = if (LocalConfiguration.current.isScreenRound) CircleShape else null
Box(
modifier = Modifier.fillMaxSize()
) {
HorizontalPager(
modifier = Modifier.fillMaxSize(),
count = 10,
state = state
) { page ->
Box(
modifier = Modifier.fillMaxSize().run {
if (shape != null) {
clip(shape)
} else {
this
}
}
) {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Text(text = "Screen $page")
}
}
}
val pagerScreenState = remember { PageScreenIndicatorState(state = state) }
if (pagerScreenState.pageCount > 0) {
HorizontalPageIndicator(pageIndicatorState = pagerScreenState)
}
}
}
}
}
```