Oops! No Internet!
A simple no Internet dialog and snackbar, which will automatically appear and disappear based on Internet connectivity status.
Previews
![]() |
![]() |
---|---|
![]() |
![]() |
Usage
Dependency
Step 1. Add the JitPack repository to your build file
Add it to your root build.gradle at the end of repositories:
Step 2. Add the dependency
Note 0. Minimum SDK for this library is API 21 (Android 5.0 Lollipop).
Note 1. Your application have to use AndroidX to use this library.
Note 2. Your have to use *.MaterialComponents.* in you styles.
Finally
To use the NoInternetDialog
and/or NoInternetSnackbar
, use the builder and initialize it in onResume()
and finally
destroy it in onPause()
.
The NoInternetDialog
and/or NoInternetSnackbar
will then automatically appear when no active Internet connection found and disappear otherwise.
Customizable attributes with their default values are given in the following example.