Remove resources from OfflineAreaSelectorViewModel#3540
Remove resources from OfflineAreaSelectorViewModel#3540andreia-ferreira merged 4 commits intomasterfrom
Conversation
Summary of ChangesHello @andreia-ferreira, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the offline area selection feature by removing the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively refactors the OfflineAreaSelectorViewModel to remove its dependency on Android Resources, which is a great step towards better separation of concerns and improved testability. The introduction of the BottomTextState sealed class to model UI states is a commendable application of modern Android development patterns. The removal of data binding in favor of programmatic view updates is handled cleanly within the fragment. The accompanying test modifications and additions are thorough and validate the new implementation. I have a couple of minor suggestions to further enhance code clarity and user experience.
...main/java/org/groundplatform/android/ui/offlineareas/selector/OfflineAreaSelectorFragment.kt
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3540 +/- ##
============================================
+ Coverage 70.57% 70.62% +0.04%
- Complexity 1615 1621 +6
============================================
Files 326 327 +1
Lines 8861 8889 +28
Branches 976 982 +6
============================================
+ Hits 6254 6278 +24
+ Misses 2024 2023 -1
- Partials 583 588 +5
🚀 New features to boost your workflow:
|
OfflineAreaSelectorViewModeldepended onResourcesto resolve string resources directly, creating a tight coupling with the Android frameworkThis PR removes that dependency by introducing a new sealed class
BottomTextStateso that the VM emits semantic UI state and the Fragment handles string resolution. During this, the databinding was also removed from the xml.This should help decouple the VM from the Android framework and improve testability.
@shobhitagarwal1612 PTAL?