Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Toast when offline in Download #2990

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

anandwana001
Copy link
Collaborator

@anandwana001 anandwana001 commented Jan 8, 2025

Towards #662

This is a part 1 PR where we are showing a popup if device is not connected while trying to download the offline imagery.

  • When offline, show message "You are offline. Connect to download offline map imagery".

Part 2 will be

  • If download fails, show error ("Connection lost") or similar.
    The part 2 will close other tickets as well where we need to build download cancel feature,

@shobhitagarwal1612 PTAL?

@auto-assign auto-assign bot requested a review from sufyanAbbasi January 8, 2025 11:30
@anandwana001 anandwana001 force-pushed the anandwana001/662/connectivity-check-download branch from 0867b76 to 4390a14 Compare January 8, 2025 11:36
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.

Project coverage is 63.49%. Comparing base (e093874) to head (c609e51).

Files with missing lines Patch % Lines
...flineareas/selector/OfflineAreaSelectorFragment.kt 16.66% 4 Missing and 1 partial ⚠️
...lineareas/selector/OfflineAreaSelectorViewModel.kt 42.85% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2990      +/-   ##
============================================
- Coverage     63.55%   63.49%   -0.07%     
- Complexity     1242     1243       +1     
============================================
  Files           267      267              
  Lines          6506     6519      +13     
  Branches        911      915       +4     
============================================
+ Hits           4135     4139       +4     
- Misses         1785     1793       +8     
- Partials        586      587       +1     
Files with missing lines Coverage Δ
...lineareas/selector/OfflineAreaSelectorViewModel.kt 29.11% <42.85%> (+1.33%) ⬆️
...flineareas/selector/OfflineAreaSelectorFragment.kt 38.33% <16.66%> (-2.41%) ⬇️

Copy link
Member

@shobhitagarwal1612 shobhitagarwal1612 left a comment

Choose a reason for hiding this comment

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

Are you planning to add some unit tests for this?

@anandwana001
Copy link
Collaborator Author

Are you planning to add some unit tests for this?

in second pr, for complete testing.

Comment on lines +84 to +85
private val _showPopupEvent = MutableSharedFlow<Boolean>()
val showPopupEvent = _showPopupEvent.asSharedFlow()
Copy link
Member

Choose a reason for hiding this comment

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

Can we rename this to networkUnavailableEvent? Also, we aren't using the value of the emitted value. So the type can be changed to Nil.

Comment on lines +88 to +89
val isConnected = networkManager.isNetworkConnected()
if (!isConnected) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's inline this

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