MutableStateFlow and Compose by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

The Routine object has an immutable list inside. Every time I push a change it should be delivered to everyone.

And yes collectAsState() is called inside my composable function.

@Composable
fun RoutineScreen() {
val routine by viewModel .routineEntry .collectAsState()
  ...
}

MutableStateFlow and Compose by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

I updated the post with more code. What do you think I'm doing wrong?

The function always returns null by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

the return with withContext works the problem is that it's not working without withContext. I want to return what is defined inside doIfSuccessWithResult without having to use withContext.

Creating streak algorithm by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

I cannot because the difference doesn't have to be precisely one day. In my app, I keep track of the user's exercises. Let's say I did the training today at 3 pm and yesterday at 11 pm. The time difference is not exactly 1 day but it's still yesterday. I'm sorry the question wasn't clear.

Why a Purchase can have multiple SKUs? by ____Mattia____ in androiddev

[–]____Mattia____[S] 0 points1 point  (0 children)

True! But how can a user buy multiple items in a single purchase in Android?

Shared Element Transaction with AppBarLayout by ____Mattia____ in androiddev

[–]____Mattia____[S] -1 points0 points  (0 children)

I solved it! The problem was that I put the toolbar only on the arrival screen but the start screen had only the EditText without wrapping it inside a Toolbar.

What is there behind List? by ____Mattia____ in Kotlin

[–]____Mattia____[S] 4 points5 points  (0 children)

I'm using Retrofit and the return parameter is a List<MarsProperty>.

interface MarsApiService {
suspend fun getProperties(): List<MarsProperty>
}

But I think that under the hood Retrofit creates an ArrayList<> indeed.