-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
I've made a fork here https://github.com/MFlisar/ModernAndroidPreferences and implemented an arbitrary storage layer here
What I did:
- created an interface
Storage - created a default storage implementation
SharedPreferencesStoragewhich works just as your current solution - replaced the
SharedPreferencesinside your library with theStorageinstance (builder, dsl, ...)
Why?
In my case I need multi process support and therefore I have written a room based preference library and I want to plug in this library into yours. Additionally, preferences are not the most modern solution for preferences, datastore is the new way - with my solution you can easily provide a storage implementation that uses the DataStore instead of the SharedPreferences in the future and still let your users choose. And of course, any user can replace the storage implementation with their own
Question
Do you think such a change (it's small and does not add any complexity to your library) does make sense and should be merged into your library? I did not adjust any tests yet but if you like the idea, I'll make those adjustments and create a pull request.