Explain
An application does not have a dialog box to confirm an event. This library is designed in a way that makes it easy for the developer to use a dialog box to confirm a specific event with a good and comfortable design, where you can modify what you want on the design to suit the shape of your application design.
Screenshots
Dependencies
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency :
implementation 'com.github.abuanzeh:CustomConfirmDialog:1.0.2'
Example
CustomConfirmDialog
.Builder()
.setContext(this)
//set Title
.setTitle("Delete Item")
//setSubTitle
.setSubTitle("Are Your sure you want\ndelete this item?")
//set Cancel Button Title
.setButtonCancelText("CANCEL")
//set Confirm Button Title
.setButtonConfirmText("CONFIRM")
//set if user can dismiss dilog true or false
.setEnableToDismiss(true)
//handle Clickes Buttons
.setDialogButtonsCallBack(object : ConfirmDialogCallBack {
override fun handleClickConfirmButton() {}
override fun handleClickCancelButton() {}
override fun handleWhenDialogDismiss() {}
})
//set Main Color
.setMainColor(R.color.delete_color)
//set Custom Color
.setIcon(R.drawable.ic_delete)
//set Corner Buttons Radius
.setCornerButtonsRadius(40)
//set Corner background Dialog
.setCornerRadius(20)
//setDialog Background
.setDialogColorBackground(R.color.your_color)
.build()
.showConfirmDialog()