veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

230
active users

#JetpackCompose

3 posts3 participants0 posts today

Although I've been coding #JetpackCompose for several years now, sometimes I still make basic errors 😅

I had the following code

```
var someValue = rememberSaveable { 100 }
```

and was wondering why the value was not restored on orientation change. It always had the initial value of 100. Well of course Compose doesn't magically keep track of all variables. It must be a `MutableState` so that Compose tracks value changes and is able to restore the state via rememberSaveable. Duh!

Quiza lo mas complicado de crear vistas con Jetpack Compose en Android sea entender bien el concepto de recomposicion. Diría que todavía estoy en ello...

Cada vez que envies un dato a la vista, toda tu UI se va a repintar, no solo aquello que este relacionado con el dato.

Aprender a mantener un estado de vista eficiente y a recordar ciertos valores con remember{ }, es clave para evitar llamadas recursivas, inconsistencia y perdida de datos.

#android
#AndroidDev
#Androiddevelopment
#androiddevelopers
#JetpackCompose

Llevo varias semanas intentando montar una arquitectura MVVM multi-feature y multi-activity con Compose en Android, porque uno esta encajado en su rinconcito laboral y se va quedando desactualizado.

De repente me encuentro con varios problemas de navegación que me llevan a ver que Google recomienda una arquitectura Single Activity 😑. Parece ser que para ese viaje no hacían falta tantas alforjas.
Tras sumirme en la depresión y el desespero al día siguiente me planteo usar un sólo Activity y de repente todo encaja a las mil maravillas.

➡️Elimino tropecientas lineas de codigo
➡️Elimino varias clases que ya no son necesarias
➡️ simplifico la inyeccion de dependencias
➡️ la navegacion parece ser mas fluida(no tengo pruebas pero tampoco dudas)
➡️puedo meter genéricos en las firmas del viewmodel base y el navigator para:
➡️ librarme de mucho boilerplate
➡️ estandarizar la arquitectura
➡️ asegurarme más de que quien la use lo haga siempre de la misma forma

Me queda muchisimo curro todavía pero creo tener una solucion viable para la arquitectura basica de futuras apps.

#AndroidDev
#Androiddevelopment
#JetpackCompose
#android_dev
#android

I have a list of things to show to users ("components" of a bike), some of which are hierarchical (e.g. "brake pads" belonging to "rear brake"). I usually use `LazyColumn` to list items, but in this case, I'm not sure.
So, I'm working on another aspect of the app, and hoping that some inspiration will strike when I least expect it.
#BuildInPublic #Android #JetpackCompose #FOSS

Continued thread

It turns out that my issues with Advertise/Discover with Nearby Connections were actually a problem of my understanding of MVVM, or rather my implementation of it. State really _should_ be in a ViewModel, and I relied on `remember` way too much.
Also, `MutableLiveData<List<T>>` works when `MutableList<T>` does not. D'oh!
#BuildInPublic #Android #JetpackCompose

Check out the Stanford Spezi project planning board to see what we are working on and how you can contribute to Spezi: github.com/StanfordSpezi

You can learn more about our work at Stanford @StanfordBDHG at bdh.stanford.edu and about Spezi at spezi.stanford.edu.

GitHubStanford SpeziFree and open-source ecosystem of modules enabling digital health systems - Stanford Spezi

At this years company #hackathon our project team created a proof of concept #KotlinMultiplatform and #ComposeMultiplatform app for #Android, #iOS & desktop with a single code base for data layer, business logic and UI, well, for everything!

Within three days we were able to create a simple but functional application from scratch that accesses a #Firebase backend.

Still some rough edges on iOS but the future is bright for Kotlin Multiplatform!