Language:
Java
Owner:
Contributors:
License:
Apache License 2.0
Description:
SmartAlertDialog
With this library you can easily use alert dialog in Android.
Made changes for : - Remove default icon and add custom icon - Long Contents can be scrollable - Can change title and sub title color - Can change the Fort
Methods Used for:
- setTitle() //String
- setSubTitle() //String
- setCancalable() //boolean
- setCustomIcon() //drawable
- setTitleColor() //Color
- setSubTitleColor() //Color
- setTitleFont() //Typeface
- setSubTitleFont() //Typeface
- setNegativeButtonHide() //boolean
- useNeutralButton() //boolean
- setPositiveButton()
- setNeutralButton()
- setNeutralButton()
![]() With Two Buttons |
![]() With One Button |
To install the library just add this line to your gradle:
implementation 'com.github.TecOrb-Developers:SmartAlertDialog:v1.0'
new SmartDialogBuilder(context) .setTitle(getString(R.string.txt_smart_dialog)) .setSubTitle(getString(R.string.txt_alert)) .setCancalable(false) .setCustomIcon(R.drawable.icon) .setTitleColor(getResources().getColor(R.color.colorPrimaryDark)) .setSubTitleColor(getResources().getColor(R.color.colorPrimaryDark)) .setTitleFont(tfBold) .setSubTitleFont(tfRegular) .setNegativeButtonHide(false) .useNeutralButton(true) .setPositiveButton(getString(R.string.txt_ok), new SmartDialogClickListener() { @Override public void onClick(SmartDialog smartDialog) { smartDialog.dismiss(); } }) .setNegativeButton(getString(R.string.txt_cancel), new SmartDialogClickListener() { @Override public void onClick(SmartDialog smartDialog) { smartDialog.dismiss(); } }) .setNeutralButton(getString(R.string.txt_later), new SmartDialogClickListener() { @Override public void onClick(SmartDialog smartDialog) { smartDialog.dismiss(); } }) .build().show();