Search code examples
androidandroid-layoutandroid-jetpackandroid-jetpack-compose-text

How to know if Text is visible on Jetpack Compose?


I have a scrollable screen and I would like to do action when a specific text appears/disappears in that screen. Is there any way to do that? Thanks


Solution

  • val isVisible = remember {
      mutableStateOf(false)
    }
    

    In compose as of 2022, you should do something like this for state of views.

    remember() can hold state with any value type that you want.