android-templates icon indicating copy to clipboard operation
android-templates copied to clipboard

[#159] Add DataStore preference to template-xml and template-compose

Open lydiasama opened this issue 2 years ago • 1 comments

  • Closes #159

What happened 👀

  • Add DataStore Preference to Template-xml and Template-compose

Insight 📝

  • We still keep the EncryptedSharePreferences for the sake of security preferences.
  • In terms of storing the data object, I think we should use Room database instead of using DataStore Proto because Room supports partial updates. So, I think we should focus on simple key-value preferences like DataStore Preference.

Proof Of Work 📹

The application runs successfully.

lydiasama avatar Dec 14 '22 13:12 lydiasama

5 Warnings
:warning: Uh oh! UserPreferences.kt is under 95% coverage!
:warning: Uh oh! UserPreferencesRepositoryImpl.kt is under 95% coverage!
:warning: Uh oh! Your project is under 80% coverage!
:warning: Uh oh! Preferences.kt is under 95% coverage!
:warning: Uh oh! PreferencesRepositoryImpl.kt is under 95% coverage!

Kover report for template-xml:

🧛 Template - XML Unit Tests Code Coverage: 27.62%

Coverage of Modified Files:

File Coverage
UserPreferences.kt 0.00%
UserPreferencesRepositoryImpl.kt 0.00%

Modified Files Not Found In Coverage Report:

DataStoreModule.kt Preferences.kt PreferencesRepository.kt PreferencesRepositoryImpl.kt PreferencesRepositoryModule.kt StorageModule.kt StorageModule.kt UserPreferencesRepository.kt UserPreferencesRepositoryModule.kt Versions.kt Versions.kt build.gradle.kts build.gradle.kts build.gradle.kts build.gradle.kts

Codebase cunningly covered by count Shroud 🧛

Kover report for template-compose:

🧛 Template - Compose Unit Tests Code Coverage: 13.84%

Coverage of Modified Files:

File Coverage
Preferences.kt 0.00%
PreferencesRepositoryImpl.kt 0.00%

Modified Files Not Found In Coverage Report:

DataStoreModule.kt PreferencesRepository.kt PreferencesRepositoryModule.kt StorageModule.kt StorageModule.kt UserPreferences.kt UserPreferencesRepository.kt UserPreferencesRepositoryImpl.kt UserPreferencesRepositoryModule.kt Versions.kt Versions.kt build.gradle.kts build.gradle.kts build.gradle.kts build.gradle.kts

Codebase cunningly covered by count Shroud 🧛

Generated by :no_entry_sign: Danger

github-actions[bot] avatar Dec 14 '22 13:12 github-actions[bot]

Question 🙋‍♀️ @Tuubz @lydiasama In this PR we just provide the classes of DataStore for template-xml and template-compose right? Do we have the plan to add a sample usecase(Integrate part in :app) in another issue 🙏

Wadeewee avatar Dec 28 '22 05:12 Wadeewee

Question 🙋‍♀️ @Tuubz @lydiasama In this PR we just provide the classes of DataStore for template-xml and template-compose right? Do we have the plan to add a sample usecase(Integrate part in :app) in another issue 🙏

@Wadeewee Please check out the PR description. 🙏🏻

lydiasama avatar Jan 03 '23 04:01 lydiasama

Question 🙋‍♀️ @Tuubz @lydiasama In this PR we just provide the classes of DataStore for template-xml and template-compose right? Do we have the plan to add a sample usecase(Integrate part in :app) in another issue 🙏

@Wadeewee Please check out the PR description. 🙏🏻

Sorry @lydiasama 😢 I didn't get which part of the description you refer about this 👇

Do we have the plan to add a sample usecase(Integrate part in :app)

Could you please guide me a bit 🙏 Maybe It's because I didn't similar with this much 🙈 cc @Tuubz

Wadeewee avatar Jan 03 '23 08:01 Wadeewee

Question 🙋‍♀️ @Tuubz @lydiasama In this PR we just provide the classes of DataStore for template-xml and template-compose right? Do we have the plan to add a sample usecase(Integrate part in :app) in another issue 🙏

@Wadeewee Please check out the PR description. 🙏🏻

Sorry @lydiasama 😢 I didn't get which part of the description you refer about this 👇

Do we have the plan to add a sample usecase(Integrate part in :app)

Could you please guide me a bit 🙏 Maybe It's because I didn't similar with this much 🙈 cc @Tuubz

@Wadeewee The sample code and use case should be inside of the Sample repos. Although we implement the use case here in Template repo, we don't use it anywhere, right? So I think it makes more sense to implement it at Sample.

@Tuubz Next time, please include this info in the issue. 🙏🏻

lydiasama avatar Jan 03 '23 09:01 lydiasama

Question 🙋‍♀️ @Tuubz @lydiasama In this PR we just provide the classes of DataStore for template-xml and template-compose right? Do we have the plan to add a sample usecase(Integrate part in :app) in another issue 🙏

@Wadeewee Please check out the PR description. 🙏🏻

Sorry @lydiasama 😢 I didn't get which part of the description you refer about this 👇

Do we have the plan to add a sample usecase(Integrate part in :app)

Could you please guide me a bit 🙏 Maybe It's because I didn't similar with this much 🙈 cc @Tuubz

@Wadeewee The sample code and use case should be inside of the Sample repos. Although we implement the use case here in Template repo, we don't use it anywhere, right? So I think it makes more sense to implement it at Sample.

@Tuubz Next time, please include this info in the issue. 🙏🏻

@lydiasama, I totally agree with you that the sample code and use case should be inside the sample 👍 but, back to this PR, Should we draft this PR or not? Because we don't have a validate/verify that the code we implemented works as we don't have an integrated part yet? What do you think? cc @Tuubz

Wadeewee avatar Jan 03 '23 10:01 Wadeewee

Question 🙋‍♀️ @Tuubz @lydiasama In this PR we just provide the classes of DataStore for template-xml and template-compose right? Do we have the plan to add a sample usecase(Integrate part in :app) in another issue 🙏

@Wadeewee Please check out the PR description. 🙏🏻

Sorry @lydiasama 😢 I didn't get which part of the description you refer about this 👇

Do we have the plan to add a sample usecase(Integrate part in :app)

Could you please guide me a bit 🙏 Maybe It's because I didn't similar with this much 🙈 cc @Tuubz

@Wadeewee The sample code and use case should be inside of the Sample repos. Although we implement the use case here in Template repo, we don't use it anywhere, right? So I think it makes more sense to implement it at Sample. @Tuubz Next time, please include this info in the issue. 🙏🏻

@lydiasama, I totally agree with you that the sample code and use case should be inside the sample 👍 but, back to this PR, Should we draft this PR or not? Because we don't have a validate/verify that the code we implemented works as we don't have an integrated part yet? What do you think? cc @Tuubz

Hmmm, it's true.

@lydiasama Would we somehow be able to provide a PoW that proves the current implementation works? 🙏

toby-thanathip avatar Jan 03 '23 10:01 toby-thanathip

@lydiasama

  • Do we have part 2 or only 2 parts of this task?
  • Should we rebase this on https://github.com/nimblehq/android-templates/pull/389? 🤔

luongvo avatar Feb 09 '23 10:02 luongvo

Let me clean it up. Will create a new PR. 🙏🏻

lydiasama avatar Feb 16 '23 04:02 lydiasama