2

Consider a LazyColumn inside a SelectionContainer that contains some composables like this:

SelectionContainer {
  LazyColumn {
    repeat(50) { n ->
      item {
        Row {
          Text("Some item:")
          Button(onClick = { println(n) }) { Text("the item is $n") }
        }
      }
    }
  }
}

The selection works well, but only in visible area of the scrollable LazyColumn. Then, how to select the entire considering the hidden part in scrollable area, such like doing a "Ctlr + A" (desktop) or "long click" (mobile)?

I saw that the SelectionContainer is a wrap to another constructor of the same function, which have another params to set, such as Selection state, but that function is internal to the jetpack compose package. Then, there's a way to immplement "custom"/"programmatically" selection with the standard composable or should we create an custom selectable composable to work like we need?

By the end, if this composable is not useful in this case, how a good way to implement that behaviour?

Lucas Sousa
  • 192
  • 3
  • 14

0 Answers0