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

[1795] Add status view about internet connection #1839

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

Conversation

WentuM
Copy link

@WentuM WentuM commented May 1, 2024

Added a status view to the android version of the app with a subscription to the current internet connection

@WentuM WentuM requested a review from a team as a code owner May 1, 2024 11:17
@CLAassistant
Copy link

CLAassistant commented May 1, 2024

CLA assistant check
All committers have signed the CLA.

@WentuM WentuM changed the title [#1795] Add status view about internet connection [1795] Add status view about internet connection May 1, 2024
@WentuM WentuM changed the title [1795] Add status view about internet connection #1795 Add status view about internet connection May 1, 2024
@WentuM WentuM changed the title #1795 Add status view about internet connection [1795] Add status view about internet connection May 1, 2024
@Kaz-ookid
Copy link
Contributor

Kaz-ookid commented May 2, 2024

Hey! I can’t review this any soon, but I noticed you did not sign the CLA, which you should do ! 👍🏻 (the comment from CLA Assistant)

image

@matteosz matteosz linked an issue May 2, 2024 that may be closed by this pull request
@Kaz-ookid
Copy link
Contributor

Hi! Please make sure to sign the CLA, add some testing and use ./gradlew ktfmtFormat to format your code. Otherwise we won't be able to go further on this PR. I will make sure to review it thoroughly when ready!

@matteosz
Copy link
Contributor

matteosz commented Jun 1, 2024

Please @WentuM sign the CLA if you want your PR to be reviewed and merged

@WentuM WentuM force-pushed the work-fe2-android-internet_connection branch from d741d90 to 9b0ac6f Compare June 2, 2024 14:25
Copy link
Contributor

@matteosz matteosz left a comment

Choose a reason for hiding this comment

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

I'd also like not only to test with unity tests the connectivity flag, it would be nice to also test the correct UI behaviour with an integration test (i.e. when connection is down the banner pops up correctly).

Also, please include in the PR description screenshot of this 'no connection' alert.

import javax.inject.Singleton

@Singleton
class ConnectivityRepository @Inject constructor(application: Application) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there's the need for a connectivity repository, as repositories have a different purpose than this. I'd suggest putting this in an utility class as in the end it's just a static method to which you can pass the application context

@@ -56,6 +60,8 @@ constructor(
/** This LiveData boolean is used to indicate whether the HomeFragment is displayed */
val isHome = MutableLiveData(java.lang.Boolean.TRUE)

val isInternetConnected = MutableLiveData(java.lang.Boolean.TRUE)
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps I'd refactor this to isConnectedToInternet

Comment on lines +54 to +59
viewModel.observeInternetConnection()

handleTopAppBar()

observeInternetConnection()

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd avoid to have 2 function calls semantically so close, so you can call that viewModel.observeInternetConnection in the observeInternetConnection method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Internet Connection Warning
5 participants