i have to build a new Android app. Since Jetpack Compose is now stable i want to build the entire UI with that. Further i need also a Preference/Settings screen where the user can specify his preferences. According the doc it is still recommended doing this via Fragments. https://developer.android.com/guide/topics/ui/settings
I found also an external library witch would provide this functionality in the compose way. https://github.com/alorma/Compose-Settings
Has anybody done this before? Whats the "cleanest" way for doing that?
Thank you
I have implemented an app in compose and I created the settings screen using the tools available in Jetpack Compose, without fragments.
The way I did this is create a composable for each settings option, that contains a title, and optional subtitle, and a checkbox, which indicates if the option is enabled or not.
These options are then added to a column (or a grid, if you have a tablet, it's easy to support both in compose); you just have to hook the clicks on the checkbox to your viewmodel to change the setting and then refresh the UI.
If you have other kinds of settings entries you can define your own composables for those as well. In my case I have other settings options that open a dialog where the user can configure some parameters, I have another composable function for this kind of settings row as well.
This is personal opinion, but I prefer to stay away from 3rd party libraries unless a) they provide significant value and b) they're from a source that offers some kind of maintenance and bug fixes guarantees. I don't know about that library you mentioned, but if you include 3rd party libraries, you need to be aware you are relinquishing control over parts of your app so you need to balance the cost/benefit ratio.