No Internet Dialog
A beautiful Dialog which appears when you have lost your Internet connection.
Setup
Gradle:
Add following line of code to your module(app) level gradle file
implementation 'am.appwise.components:NoInternetDialog:1.1.3'
Maven:
<dependency>
<groupId>am.appwise.components</groupId>
<artifactId>NoInternetDialog</artifactId>
<version>1.1.3</version>
<type>pom</type>
</dependency>
Usage
Use simple builder to initiate the dialog. It will automatically appear if you'll lose your Internet connection, and dissapear, once it came back
NoInternetDialog noInternetDialog = new NoInternetDialog.Builder(context).build();
or
NoInternetDialog noInternetDialog = new NoInternetDialog.Builder(fragment).build();
and at the end
@Override
protected void onDestroy() {
super.onDestroy();
noInternetDialog.onDestroy();
}
Customize the dialog with ease
builder.setBgGradientStart() // Start color for background gradient
builder.setBgGradientCenter() // Center color for background gradient
builder.setBgGradientEnd() // End color for background gradient
builder.setBgGradientOrientation() // Background gradient orientation (possible values see below)
builder.setBgGradientType() // Type of background gradient (possible values see below)
builder.setDialogRadius() // Set custom radius for background gradient
builder.setTitleTypeface() // Set custom typeface for title text
builder.setMessageTypeface() // Set custom typeface for message text
builder.setButtonColor() // Set custom color for dialog buttons
builder.setButtonTextColor() // Set custom text color for dialog buttons
builder.setButtonIconsColor() // Set custom color for icons of dialog buttons
builder.setWifiLoaderColor() // Set custom color for wifi loader
builder.setConnectionCallback() // Set a Callback for network status
builder.setCancelable(false) // Set cancelable status for dialog