diff --git a/DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java b/DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java index c8d2663b..832dd902 100644 --- a/DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java +++ b/DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java @@ -519,7 +519,7 @@ public void refreshView() { boxRoot.setRootPadding(screenPaddings[0], screenPaddings[1], screenPaddings[2], screenPaddings[3]); if (backgroundColor != null) { tintColor(bkg, backgroundColor); - if (style.tintButtonBackground()){ + if (style.tintButtonBackground()) { tintColor(btnSelectOther, backgroundColor); tintColor(btnSelectNegative, backgroundColor); tintColor(btnSelectPositive, backgroundColor); @@ -542,7 +542,10 @@ public void refreshView() { useTextInfo(btnSelectPositive, okTextInfo); if (boxButton != null) { - boxButton.setVisibility(btnSelectNegative.getVisibility() == View.VISIBLE || btnSelectOther.getVisibility() == View.VISIBLE || btnSelectPositive.getVisibility() == View.VISIBLE ? View.VISIBLE : View.GONE); + boxButton.setVisibility((btnSelectNegative != null && btnSelectNegative.getVisibility() == View.VISIBLE) || + (btnSelectOther != null && btnSelectOther.getVisibility() == View.VISIBLE) || + (btnSelectPositive != null && btnSelectPositive.getVisibility() == View.VISIBLE) ? + View.VISIBLE : View.GONE); } if (titleIcon != null) { int size = (int) txtDialogTitle.getTextSize(); diff --git a/DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java b/DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java index f76da9d5..05eebae8 100644 --- a/DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java +++ b/DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java @@ -663,7 +663,10 @@ public void getOutline(View view, Outline outline) { useTextInfo(btnSelectOther, otherTextInfo); if (boxButton != null) { - boxButton.setVisibility(btnSelectNegative.getVisibility() == View.VISIBLE || btnSelectOther.getVisibility() == View.VISIBLE || btnSelectPositive.getVisibility() == View.VISIBLE ? View.VISIBLE : View.GONE); + boxButton.setVisibility((btnSelectNegative != null && btnSelectNegative.getVisibility() == View.VISIBLE) || + (btnSelectOther != null && btnSelectOther.getVisibility() == View.VISIBLE) || + (btnSelectPositive != null && btnSelectPositive.getVisibility() == View.VISIBLE) ? + View.VISIBLE : View.GONE); } if (titleIcon != null) { int size = (int) txtDialogTitle.getTextSize(); diff --git a/gradle.properties b/gradle.properties index 1a74cb14..d00d496f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true -BUILD_VERSION=0.0.50.beta18 +BUILD_VERSION=0.0.50.beta19 BUILD_VERSION_INT=49 DIALOGX_STYLE_VERSION=5 android.nonTransitiveRClass=true