compose-recomposition Questions

1

Solved

Here is the code that causes the infinite recomposition problem MainActivity class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(saved...

1

Solved

I'm creating an app that, among other things, enables the user to add a Consumer, and then remove him later. The consumers are shown in cards with a remove button in the end. Adding a consumer wor...

1

Solved

I am trying to implement Navigation using single activity and multiple Composable Screens. This is my NavHost: @Composable @ExperimentalFoundationApi fun MyNavHost( modifier: Modifier = Modifier, ...

1

Solved

I'm getting data from the server and displaying it in the list, each item can be selected with one click to display the button, but I cannot close it, I can only open it. This is item of list class...

1

Solved

I followed this document from the developer site. I want to display the text in an OutlinedTextField from a user input, and have it survive configuration changes. With the code below, when the user...

1

Solved

I'm trying to create an overlay and attach the view to the WindowManager, I've managed to do this by creating a class which implements Lifecycle/ViewModelStore/SavedStateRegistry Owner. But for som...

4

Solved

Checking out codelab's basic tutorial there is a snippet to increase counter on button when clicked @Composable fun MyScreenContent(names: List<String> = listOf("Android", "the...
Armoured asked 19/12, 2020 at 8:32

2

Solved

I'm trying to create a sky view in my Android app using Jetpack Compose. I want to display it inside a Card with a fixed height. During nigth time, the card background turns dark blue and I'd like ...

1

I was told "You need to create scopes if you need to have scoped recompositions" by Thracian in the question. It seems that I can't find the policy from official documnet. The Code A is b...
Interinsurance asked 21/6, 2022 at 6:23

1

Solved

I know the Column(){...} will be recomposition when either b1 or b2 is changed. If I hope that Column(){...} can be re-composed only when b2 is changed and Column(){...} doesn't be recomposed when ...
Yardman asked 19/6, 2022 at 2:21

2

During navigation from Navhost, I found out that the composable screens are getting recomposition multiple times. Because of it, my ViewModel is calling API data source multiple times too. @Composa...

1

The Jetpack compose documentation says it can skip recomposition if all the inputs are stable and haven't changed. The definition of a type being stable goes like this... A stable type must comply...
Uziel asked 20/6, 2021 at 10:26

1

Solved

I'm doing experiments to comprehend recomposition and smart recomposition and made a sample Sorry for the colors, they are generated with Random.nextIn() to observe recomposition visually, setting...
Gunslinger asked 7/12, 2021 at 9:12

1

Solved

Imagine the following object data class CourseState( val key:Int=0, val name:String="", val courses:Courses=Courses()) Implementing the following pattern private val _courseState = mutab...

© 2022 - 2025 — McMap. All rights reserved.