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

[#102] [Integrate] As a user, I can see dialog when there is no internet connection #105

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

kaungkhantsoe
Copy link
Contributor

@kaungkhantsoe kaungkhantsoe commented Aug 2, 2023

What happened 👀

When there is no internet connection, it shows no internet connection dialog.

Insight 📝

There is an issue in using ConnectivityManager.NetworkCallback. It doesn't recognize there is no internet at the start of an application in the following scenario

  • Turn off the internet
  • Open the app for the first time
  • The app will not show the dialog

There is a possible workaround but it is out of the scope for this initiative.

Proof Of Work 📹

Screen.Recording.2023-08-25.at.2.33.47.PM.mp4

@github-actions
Copy link

github-actions bot commented Aug 2, 2023

8 Warnings
⚠️ /home/runner/.gradle/caches/transforms-3/fc63d10724654858d2ee5b467b86b5a7/transformed/jetified-dagger-lint-aar-2.43.2/jars/lint.jar#L0 - Lint found an issue registry (dagger.lint.DaggerIssueRegistry) which requires a newer API level. That means that the custom lint checks are intended for a newer lint version; please upgrade.
⚠️ app/src/main/AndroidManifest.xml#L11 - On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute android:fullBackupContent to specify an @xml resource which configures which files to backup, or just set android:fullBackupOnly=true. More info: https://developer.android.com/guide/topics/data/autobackup
⚠️ app/src/main/AndroidManifest.xml#L14 - Attribute networkSecurityConfig is only used in API level 24 and higher (current min is 23)
⚠️ app/src/main/java/co/nimblehq/compose/crypto/ui/common/Toaster.kt#L16 - Toast created but not shown: did you forget to call show() ?
⚠️ app/src/main/res/drawable/ic_back.xml#L8 - Attribute fillType is only used in API level 24 and higher (current min is 23)
⚠️ app/src/main/res/drawable/ic_fire_opal_arrow_down.xml#L8 - Attribute fillType is only used in API level 24 and higher (current min is 23)
⚠️ app/src/main/res/drawable/ic_guppie_green_arrow_up.xml#L8 - Attribute fillType is only used in API level 24 and higher (current min is 23)
⚠️ app/src/main/res/navigation/nav_graph_main.xml#L2 - The resource R.navigation.nav_graph_main appears to be unused

CoroutineTemplate Jacoco report:

Generated by 🚫 Danger

@Wadeewee
Copy link
Contributor

Wadeewee commented Aug 3, 2023

@kaungkhantsoe Did you face this issue on your side?

When clicking on the ok button and then when the dialog is gone then the pull to refresh indicator is appear you can notice since 0.03 sec from the record👇

Screen.Recording.2566-08-03.at.10.02.43.mov

@kaungkhantsoe kaungkhantsoe force-pushed the feature/100-ui-implement-no-connection-dialog branch from e0e0e42 to 2dd9657 Compare August 3, 2023 04:25
@kaungkhantsoe kaungkhantsoe force-pushed the feature/102-integrate-no-connection-dialog branch from 61b6af5 to f031f35 Compare August 3, 2023 04:39
@kaungkhantsoe
Copy link
Contributor Author

@kaungkhantsoe Did you face this issue on your side?

When clicking on the ok button and then when the dialog is gone then the pull to refresh indicator is appear you can notice since 0.03 sec from the record👇

Screen.Recording.2566-08-03.at.10.02.43.mov

@Wadeewee Ahh yes, I was trying out a callback function. I will remove it from the HomeScreen and add the callback only to the DetailScreen as an example. 🙏

Base automatically changed from feature/100-ui-implement-no-connection-dialog to develop August 6, 2023 10:29
Copy link

@AVI5HEK AVI5HEK left a comment

Choose a reason for hiding this comment

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

Some small naming issues. The rest LGTM.

Copy link
Contributor

@hoangnguyen92dn hoangnguyen92dn left a comment

Choose a reason for hiding this comment

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

Just minor issues, the rest LGTM now 👌

@kaungkhantsoe kaungkhantsoe force-pushed the feature/102-integrate-no-connection-dialog branch from d68a173 to f961999 Compare August 25, 2023 07:41
@kaungkhantsoe
Copy link
Contributor Author

@hoangnguyen92dn I have updated the method of showing global dialog with different actions. Please help me review it and let me know if you have any concerns with it. 🙏

Copy link
Contributor

@hoangnguyen92dn hoangnguyen92dn left a comment

Choose a reason for hiding this comment

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

Please check the CI failed

title: String,
message: String,
actionText: String,
actions: List<DialogActionModel>,
Copy link
Contributor

Choose a reason for hiding this comment

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

In our case, I think we only need a dialog with 2 buttons 🤔 So it could be positiveButton, negativeButton, passing the list of model quite confused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO, sometimes we might need only Ok button, sometimes we might want one negative and one positive buttons, and sometimes we might need other buttons. By passing actions, we can customize the action buttons to whatever we want. What do you think?

@kaungkhantsoe kaungkhantsoe force-pushed the feature/102-integrate-no-connection-dialog branch from f961999 to a3f5d4b Compare August 29, 2023 05:07
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.

[Integrate] As a user, I can see dialog when there is no internet connection
4 participants