1
0
Эх сурвалжийг харах

0.0.50.beta19
- 修复使用 MaterialYouStyle 主题时按钮背景颜色不随对话框背景颜色改变的问题
- 修复 BottomDialog 可能在特定情况下存在的空指针问题

Kongzue 6 сар өмнө
parent
commit
846578254b

+ 5 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -519,7 +519,7 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
             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 class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
             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();

+ 4 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java

@@ -663,7 +663,10 @@ public class MessageDialog extends BaseDialog {
             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();

+ 1 - 1
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