It is a useful tool for dialogue.
- Add repository
android{
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
}
- Add dependencies
dependencies{
compile 'com.github.jvmartinez:utilsDialog:0.1.3'
}
- Dialog Simple Display only message to user
alert.alert("Title","Message",Context);
- Dialog Simple with button
alert.alert("Title","Message","onClickListenerOk","onClickListenerCancel",Context);
- Dialog Custom
alertCustom custom = new alertCustom(Context,"Title","Message","onClickListenerOk","onClickListenerCancel","typeIco");
custom.openDialogo();
- typeIco
1.1) The value 1 is for affirmative message
1.2) The value 2 is for warning message
1.3) The value 3 is for info message
1.4) The value 4 is for error message
- Dialog Custom Personalized
Style style = new Style();
style.setBackgroundBody(R.color.colorBodyBackground);
style.setBackgroundContents(R.color.colorContentsBackground);
style.setBackgroundTitle(R.color.black);
style.setTextTitle(R.color.txt_title);
style.setTextBody(R.color.black);
style.setBtnOkColor(R.color.alert_btn_ok);
style.setBtnCancelColor(R.color.alert_btn_cancel);
style.setTextColorButton(R.color.colorButtonTextBackground);
style.setLayoutWindows(0);
alertCustom custom =
new alertCustom(
MainActivity.this,
"Custom dialog test",
"Hello world, dialog with custom,",
onClickListenerOk(),
onClickListenerCancel(),
TypeIco.ICON_INFO,
style);
custom.openDialogo();
- style.setLayoutWindows
1.1) The value 0 custom traditional
1.2) The value 1 custom style windows
Your contribution will help us to improve this project.