An Android library that lets you create a sweet interface dialog layout in a simple and easy way ,with different types which you can use easily without any boilerbate code and with a great flexibilty to fit your desired user interface.
dependencies {
implementation 'com.dialog:plus:2+'
}
<dependency>
<groupId>com.dialog</groupId>
<artifactId>plus</artifactId>
<version>2+</version>
<type>pom</type>
</dependency>
new DialogPlus("Message Dialog", "message dialog sample\n Welcome Back")
.setMessageDialog(new DialogPlus.OnDialogActionClicked() {// implement methods})
.show(this.getSupportFragmentManager(), "dialog");
new DialogPlus("Confirmation Dialog", "confirmation dialog message content ...")
.setOnDialogActionClicked(new DialogPlus.OnDialogActionClicked() {// implement methods})
.show(this.getSupportFragmentManager(), "dialog");
new DialogPlus("Success message content..")
.setSuccessDialog(new DialogPlus.OnDialogActionClicked() {// implement methods})
.show(this.getSupportFragmentManager(), "dialog");
new DialogPlus("error dialog content message")
.setErrorDialog(new DialogPlus.OnDialogActionClicked() {// implement methods})
.show(this.getSupportFragmentManager(), "dialog");
new DialogPlus("Code Dialog", "code dialog sample with send enabled, resend enabled and counter 10 seconds")
/**(String correct_code, boolean withSend, boolean withResend, int counterSeconds
, @ColorInt int codeTextColor,CodeTypeListener codeTypeListener)**/
.setConfirmCodeDialog("12345", true, true, 10, Color.BLACK, new DialogPlus.CodeTypeListener() {})
.show(this.getSupportFragmentManager(), "dialog");
new DialogPlus("Dialog Title", "dialog content ...")
//(@ColorRes int positiveBackground, @ColorRes int negativeColorRes, @ColorRes int headerBgColor)
.setBackgroundColors(R.color.colorPrimary, R.color.colorAccent, R.color.colorPrimary)
//(@DrawableRes int positiveBackground, @DrawableRes int negativeBackground, @DrawableRes int headerBackground)
.setBackgrounds(R.drawable.cross, R.drawable.bg_header, R.drawable.checked)
//(@ColorRes int positiveTextColor, @ColorRes int negativeTextColor, @ColorRes int headerTextColor)
.setTextColors(R.color.colorPrimary, R.color.colorAccent, R.color.colorPrimary)
//(@ColorRes int primaryColor)--> sets the positiveBgColor and the headerBgColor
.setPrimaryBgColor(R.color.colorPrimary)
//(@ColorRes int primaryColor)--> sets the negativeBgColor
.setSecondaryBgColor(R.color.colorAccent)
//(@ColorRes int primaryColor)--> sets the positiveTextColor
.setPrimaryTextColor(R.color.colorPrimary)
//(@ColorRes int secondaryColor)--> sets the negativeTextColor
.setSecondaryBgColor(R.color.colorAccent)
//(@ColorRes int primaryColor)--> sets the positiveBgDrawable and the headerBgDrawable
.setPrimaryDrawable(R.drawable.bg_header)
//(@ColorRes int secondaryDrawable)--> sets the negativeTextDrawable
.setSecondaryBgDrawable(R.drawable.bg_header)
//(@ColorRes int headerBgColor)
.setHeaderBgColor(R.color.colorAccent)
//(@DrawableRes int headerBgDrawable)
.setHeaderBgDrawable(R.drawable.bg_header)
// @ColorInt int colorInt
.setCodeTextColor(Color.BLACK)
setDialogActionListener(DialogPlus.DialogActionListener)
.setDialogActionListener(new DialogPlus.DialogActionListener() {
@Override
public void onPositive(DialogPlus dialogPlus) {
}
})
});
setDialogActionListener(new DialogPlus.DialogActionListener() {
@Override
public void onPositive(DialogPlus dialogPlus) {
}
@Override
public void onNegative(DialogPlus dialogPlus) {
super.onNegative(dialogPlus);
}
@Override
public void onWrongCode(DialogPlus dialogPlus) {
super.onWrongCode(dialogPlus);
}
})
});
setCodeTypeListener(new DialogPlus.CodeTypeListener() {
@Override
public void onSuccess(DialogPlus dialogPlus) {
}
@Override
public void onResend(DialogPlus dialogPlus) {
}
@Override
public void onWrongCode(DialogPlus dialogPlus) {
}
/**you may override timeUp if there's a specific scenario you want to handle*/
@Override
public void onTimeUp(DialogPlus dialogPlus) {
super.onTimeUp(dialogPlus);
}
});
This project is licensed under the MIT License - see the LICENSE.md file for details