0

I want to do the following:

Column(modifier = modifier.verticalScroll().clickable(
   onClick = actionStartActivity(MainActivity::class.java)
)) {
    Text(text = "some really long text")
}

The problem is that there is no verticalScroll modifier, so the only way I can figure out how to get the content to scroll is by using a LazyColumn, however if I try to add a clickable modifier to the LazyColumn then the widget won't load. If I wrap the LazyColumn in a Column I can then add the clickable modifier to the Column, but then clicking anywhere on the text only briefly highlights the text, it doesn't perform the clickable action.

Is there a way to accomplish this currently in Glance?

jc12
  • 1,411
  • 1
  • 18
  • 24

1 Answers1

0

Looks like if I put a clickable modifier on every item inside of the LazyColumn then it pretty much accomplishes what I'm trying to do. It would be nice if I could just put a clickable modifier on the whole LazyColumn instead though or at least be able to put it on a wrapping Column. It would also be nice if I could just use a Column instead of needing to use a LazyColumn just to get it to be scrollable.

jc12
  • 1,411
  • 1
  • 18
  • 24
  • 1
    Scrollable TextViews are not supported by RemoteViews, thus Glance cannot implement them. As you said, you need to use a LazyColumn with an `item { text() }` and handle the click in the item itself. Feel free to open a feature request to make LazyColum clickable but it's a special use case, in general you will always use the item's click – Marcel Jul 18 '22 at 08:12