Skip to content

[1795] Add status view about internet connection#1839

Open
WentuM wants to merge 2 commits into
dedis:masterfrom
WentuM:work-fe2-android-internet_connection
Open

[1795] Add status view about internet connection#1839
WentuM wants to merge 2 commits into
dedis:masterfrom
WentuM:work-fe2-android-internet_connection

Conversation

@WentuM

@WentuM WentuM commented May 1, 2024

Copy link
Copy Markdown

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

CLAassistant commented May 1, 2024

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@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

Kaz-ookid commented May 2, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

matteosz commented Jun 1, 2024

Copy link
Copy Markdown
Contributor

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

@matteosz matteosz left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

/** 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
Copy Markdown
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
Copy Markdown
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