Skip to content

Migrate Offline Area Screens to Compose - #3915

Open
shobhitagarwal1612 wants to merge 5 commits into
masterfrom
offline-selector
Open

Migrate Offline Area Screens to Compose#3915
shobhitagarwal1612 wants to merge 5 commits into
masterfrom
offline-selector

Conversation

@shobhitagarwal1612

@shobhitagarwal1612 shobhitagarwal1612 commented Sep 1, 2026

Copy link
Copy Markdown
Member

Towards #1795

Migrates the offline area screens (selector screen, viewer screen & list offline areas screen) from XML to compose layout.

Before:

Screen_recording_20260901_144819.webm

After:

Screen_recording_20260901_144321.webm

@andreia-ferreira PTAL?

- Replace offline_area_selector_frag.xml with Compose OfflineAreaSelectorScreen
- Convert LiveData to StateFlow with OfflineAreaSelectorState and OfflineAreaSelectorEvent
- Inline and modernize DownloadProgressDialog inside OfflineAreaSelectorScreen
- Remove legacy viewport outline drawable
- Add comprehensive Compose UI and ViewModel unit tests
- Replace offline_area_viewer_frag.xml with Compose OfflineAreaViewerScreen
- Convert LiveData to StateFlow with OfflineAreaViewerState
- Modernize deletion flow and progress overlay in Compose
- Add comprehensive Compose UI and ViewModel unit tests
- Replace offline_areas_frag.xml with Compose OfflineAreasScreen
- Convert LiveData to StateFlow with OfflineAreasState
- Inline and modernize OfflineAreaListItem inside OfflineAreasScreen
- Clean up obsolete layouts, styles, and dimensions
- Add comprehensive Compose UI and ViewModel unit tests
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.32200% with 110 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.75%. Comparing base (870e27b) to head (2bcc0cc).

Files with missing lines Patch % Lines
...offlineareas/selector/OfflineAreaSelectorScreen.kt 78.20% 24 Missing and 10 partials ⚠️
...form/android/ui/offlineareas/OfflineAreasScreen.kt 79.66% 14 Missing and 10 partials ⚠️
.../ui/offlineareas/viewer/OfflineAreaViewerScreen.kt 75.82% 17 Missing and 5 partials ⚠️
...i/offlineareas/viewer/OfflineAreaViewerFragment.kt 52.17% 9 Missing and 2 partials ⚠️
.../offlineareas/viewer/OfflineAreaViewerViewModel.kt 78.57% 4 Missing and 2 partials ⚠️
...flineareas/selector/OfflineAreaSelectorFragment.kt 76.47% 2 Missing and 2 partials ⚠️
...rm/android/ui/offlineareas/OfflineAreasFragment.kt 86.36% 0 Missing and 3 partials ⚠️
...monMain/kotlin/org/groundplatform/ui/theme/Size.kt 0.00% 3 Missing ⚠️
...lineareas/selector/OfflineAreaSelectorViewModel.kt 95.74% 0 Missing and 2 partials ⚠️
...rg/groundplatform/android/ui/components/Toolbar.kt 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3915      +/-   ##
============================================
+ Coverage     69.46%   69.75%   +0.28%     
- Complexity     1965     1984      +19     
============================================
  Files           412      415       +3     
  Lines         11018    11361     +343     
  Branches       1453     1483      +30     
============================================
+ Hits           7654     7925     +271     
- Misses         2613     2670      +57     
- Partials        751      766      +15     
Files with missing lines Coverage Δ
...tform/android/ui/offlineareas/OfflineAreasState.kt 100.00% <100.00%> (ø)
...m/android/ui/offlineareas/OfflineAreasViewModel.kt 100.00% <100.00%> (+16.66%) ⬆️
.../offlineareas/selector/OfflineAreaSelectorEvent.kt 100.00% <ø> (ø)
.../offlineareas/selector/OfflineAreaSelectorState.kt 100.00% <100.00%> (ø)
...d/ui/offlineareas/viewer/OfflineAreaViewerState.kt 100.00% <100.00%> (ø)
...rg/groundplatform/android/ui/components/Toolbar.kt 94.73% <94.73%> (+7.23%) ⬆️
...lineareas/selector/OfflineAreaSelectorViewModel.kt 94.11% <95.74%> (+5.69%) ⬆️
...rm/android/ui/offlineareas/OfflineAreasFragment.kt 88.46% <86.36%> (+1.50%) ⬆️
...monMain/kotlin/org/groundplatform/ui/theme/Size.kt 0.00% <0.00%> (ø)
...flineareas/selector/OfflineAreaSelectorFragment.kt 71.79% <76.47%> (+0.36%) ⬆️
... and 5 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

@Composable
fun DownloadProgressDialog(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this also be annotated with @VisibleForTesting?

- Center toolbar titles using CenterAlignedTopAppBar in Toolbar composable
- Annotate DownloadProgressDialog with @VisibleForTesting
- Simplify coroutines CancellationException import in OfflineAreaViewerViewModel
- Surface error toast on offline area deletion failure via OfflineAreaViewerEvent.RemoveFailed
- Extract reusable offline area dimensions to Size.kt
- Add safeDrawing bottom window insets to OfflineAreaSelectorButtons and OfflineAreaDetailsCard
- Add unit tests in ToolbarTest and update OfflineAreaViewerViewModelTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants