Jetpack Compose TV is not scrollable and not clickable

500 Views Asked by At

I'm very new to Jetpack Compose for Android TV and don't understand how scrolling and clicking works. For example:

 TvLazyColumn(
                        modifier = Modifier
                            .padding(24.dp)
                            .fillMaxSize(),
                        verticalArrangement = Arrangement.spacedBy(16.dp)
                    ) {
                        item {
                            Text(
                                modifier = Modifier,
                                text = "very long text here which is need to scroll..."
                            )
                        }
                        item {
                            Button(
                                modifier = Modifier,
                                onClick = {
                                    // handle click event here
                                }) {
                                Text(text = "CLICK ME")
                            }
                        }
                    }

I'm using Jetpack Compose tv-foundation and tv-material version 1.0.0-alpha07 and having these issues:

  • Clicking a Button with a mouse connected to the Android TV device never triggers the onClick handler, it only works when clicked with the remote control.

  • Scrolling long text in an item of TvLazyColumn doesn't work with either a mouse or remote control. But changing to LazyColumn allows scroll with mouse but not remote control.

How can I get reliable scrolling and clicking behavior with both input methods in Jetpack Compose for Android TV? What I missed here?

1

There are 1 best solutions below

0
On

Currently, pointer and touch input methods are not supported in TvLazyColumn as the component is specifically designed for TV. We are tracking this issue.

Thanks for this feedback!