Skip to main content

All Questions

-1 votes
2 answers
52 views

mutableStatelistof doesn't trigger a recomposition when items are added to it

I have this in my HomeViewModel class HomeViewModel( private val preferenceRepository: PreferenceRepository, private val currencyApiService: CurrencyApiService, private val mongoRepository:...
ant2009's user avatar
  • 23.3k
0 votes
1 answer
64 views

What is the proper way of communicating between viewModel and UI composable to avoid concurrent change error?

In my project from time to time I have error "Unsupported concurrent change during composition" -> This is probably caused by updating a State object from different threads at the same ...
christianalready's user avatar
3 votes
2 answers
247 views

How to fix "Unsupported concurrent change during composition"?

Error: Recomposer.applyAndCheck java.lang.IllegalStateException - Unsupported concurrent change during composition. A state object was modified by composition as well as being modified outside ...
christianalready's user avatar
1 vote
1 answer
125 views

Compose function recomposes when it passes value of the state to another function

I don't seem to find an explanation for this simple case. Something simple as a viewmodel holding counter flow: class TestCounter : ViewModel() { private val _counter = MutableStateFlow(0) val ...
SirBzik's user avatar
  • 21
0 votes
2 answers
145 views

Optimizing LazyColumn Recomposition Jetpack Compose

I am developing an app using Jetpack Compose that organizes items into three lists ("List 1", "List 2", "List 3"), each represented by a sealed class. I am trying to ...
Royss's user avatar
  • 33
0 votes
1 answer
48 views

unexpected behaviour of flowrow in jetpackcompose

I have a screen in which users can see recommendations saved by them from different categories with filter buttons above implemented with the help of FlowRow: @OptIn(ExperimentalLayoutApi::class) @...
Tushar Singla's user avatar
0 votes
0 answers
29 views

Remove unnecessary recomposition

I have Scaffold with Column of fields and AndroidView with big text field. Then I write in AndroidView something - MainFields recomposing all times. I think its because of scaffoldPadding and ...
Slava's user avatar
  • 625
0 votes
0 answers
29 views

Prevent Row from unnecessary recomposition in Jetpack

I have three Rows in Column. Then I change focus all three rows try to recompose. Then I click on second Row, it try to set focus on the last. How to recompose only row, there focus is? @Composable ...
Slava's user avatar
  • 625
1 vote
0 answers
72 views

Jetpack Compose Button recomposed unnecessary

I have just a simple application having two class MainActivity and MainViewModel. I am sharing the code for the reference: class MainActivity : ComponentActivity() { @OptIn(...
Atul Sharma's user avatar
0 votes
0 answers
39 views

Scaffold with white theme applies over main layout in jetpack compose

Why I have invisible Scaffold over layouts? I have scaffold with floatingActionButton, snackbarHost and bottomBar. In the main layouts I have some fields with Column and element are AndroidView: ...
Slava's user avatar
  • 625
0 votes
0 answers
171 views

Lambda parameter causes recomposition

When passing lambda to button's onClick, it triggers recomposition every time parent is recomposed. I somewhat understand why that happens, because for lambda is just object of a class and if it ...
Madonabulia's user avatar
0 votes
0 answers
101 views

Loading Native Ads Inside LazyColumn

This is the composable holding Lazycolumn and after every 5th item native ad has been visible but due to lazycolumn recomposition when I'm scrolling ads got disappeared and after coming back ads again ...
Sparrow_decoded's user avatar
0 votes
0 answers
55 views

Managing complex state tree with Compose and LazyList

I want to rebuild a highly interactive RecyclerView based list with a Compose LazyList. The list is divided into categories, and these categories represent required options for a single selection. ...
user1743524's user avatar
0 votes
0 answers
52 views

Why is TextAlign.Center and TextAlign.Ellipsis in compose shifting the text to the right on each composition?

Column { var isNextVisible by remember {mutableStateOf(false) } Row( modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically ) { ...
Diken Mhrz's user avatar
0 votes
1 answer
248 views

Jetpack Compose: Surface makes state is persisting without remember

im currently experiencing with jetpack compose states. Check out this composable: @Composable fun CounterWithoutRemember(reset: MutableState<Boolean>) { val count = mutableStateOf(0) ...
Kakaranara's user avatar

15 30 50 per page
1
2 3 4 5
13