ritwikshanker / GoCoronaGo

An android coronavirus Tracker
MIT License
24 stars 21 forks source link

Create User Preference/Settings Page #65

Closed ritwikshanker closed 3 years ago

ritwikshanker commented 3 years ago

As of now, only changing theme's is the customization available to the user. We can also add his preferred country so that they don't have to always select their country from the dropdown. For that, we will need a separate screen so in future, if we want we can increase more customization options. In layman terms, we sort of have to build a settings page.

ritwikshanker commented 3 years ago

Also, we already have strings in 4 languages so we can add an app language option for wider reach. But this will be in the second phase once our settings page is ready.

hardiksachan commented 3 years ago

Hey! I would like to work on this, can you please assign this to me. Also, I'm thinking of using Jetpack Datastore to save user preferences, is that okay?

ritwikshanker commented 3 years ago

Hey! I would like to work on this, can you please assign this to me. Also, I'm thinking of using Jetpack Datastore to save user preferences, is that okay?

Sure @hardiksachan, Feel free to use the datastore.

hardiksachan commented 3 years ago

Okay @ritwikshanker, This is what I'll be working on.

Also, I have a question - I'll be creating enums to represent available countries and languages, right?

ritwikshanker commented 3 years ago

@hardiksachan

hardiksachan commented 3 years ago

Alright, I'll save countries as a string. I'll raise a PR as soon as I'm done.

hardiksachan commented 3 years ago

Hey @ritwikshanker, I have implemented datastore and a settings page from where the language, country, and theme can be updated.

But, I have not wired up the logic to actually observe the settings and update the app theme because currently there are two sources of truth for the theme - XML views, and compose theme.

Since, the complete app is being ported to Compose, can we do it after the migration is done? And should I raise a PR?

EDIT:

Current Progress -

PS: these values are saved in datastore.

ritwikshanker commented 3 years ago

Hey @ritwikshanker, I have implemented datastore and a settings page from where the language, country, and theme can be updated.

But, I have not wired up the logic to actually observe the settings and update the app theme because currently there are two sources of truth for the theme - XML views, and compose theme.

Since, the complete app is being ported to Compose, can we do it after the migration is done? And should I raise a PR?

EDIT:

Current Progress -

PS: these values are saved in datastore.

Yeah raise a PR. I have already done the theme thing in another app so i'll pick it up from here. Nothing to worry! ✌️

hardiksachan commented 3 years ago

Okay @ritwikshanker, I have raised a PR, please take a look.