Compose Desktop drop in upgrade functionality?

I’m working on a Compose Desktop side project. Is there a library to support searching for, and installing updates, from within the app?

Ideally it would be similar to how Discord works: On startup, the app checks for updates, installs them, and restarts itself.

Although other approaches would work also, like when the user manually searches for updates in the file menu.

submitted by /u/LockShitDown
[link] [comments]

Continue ReadingCompose Desktop drop in upgrade functionality?

Passing Arguments Best Practices

I’m working with Jetpack Compose, but the same goes for XML. I need to pass a list of objects from one screen to another. Let me explain. I’m building a custom section where the user can create her own workout. But she needs to do different steps. The first is selecting the exercises she wants in the custom workout. The second is to choose how many repetitions she wants to do. And the last choosing the name of the workout and the cover picture. All of these steps are made on different screens.

Now, I know google says that has never been a recommended pattern to pass Parcelables. They suggest instead of saving stuff on the database and fetching it in the other screens where you need to use it. But in my case it doesn’t make much sense. Should I use a shared ViewModel? What’s the best practice to do so?

submitted by /u/____Mattia____
[link] [comments]

Continue ReadingPassing Arguments Best Practices

Does Kotlin memoize repeated constructor calls?

Suppose I have some code like this:

val x = 5 items.forEach { SomeObject(x).someMethod() } 

Does Kotlin construct a new SomeObject on every pass of forEach ?

EDIT: really I’m not asking about memoization, but about whether the compiler can optimize the object construction away altogether. I understand that mutable data dependencies would often make that impossible. But are there any circumstances where it can be done?

submitted by /u/sacheie
[link] [comments]

Continue ReadingDoes Kotlin memoize repeated constructor calls?

End of content

No more pages to load