Ver Fonte

0.0.40.beta3

kongzue há 4 anos atrás
pai
commit
b0fe84aa3a

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

@@ -286,7 +286,8 @@ public class BottomDialog extends BaseDialog {
             if (btnCancel != null) btnCancel.getPaint().setFakeBoldText(true);
             if (btnSelectPositive != null) btnSelectPositive.getPaint().setFakeBoldText(true);
             if (btnSelectOther != null) btnSelectOther.getPaint().setFakeBoldText(true);
-            
+    
+            bkg.setMaxWidth(DialogX.dialogMaxWidth);
             boxRoot.setParentDialog(me);
             boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
                 @Override

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

@@ -1,6 +1,5 @@
 package com.kongzue.dialogx.dialogs;
 
-import android.animation.Animator;
 import android.app.Activity;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -443,6 +442,7 @@ public class MessageDialog extends BaseDialog {
         }
         
         public void refreshView() {
+            log("#refreshView");
             if (backgroundColor != -1) {
                 tintColor(bkg, backgroundColor);
                 if (style instanceof MaterialStyle) {
@@ -451,7 +451,7 @@ public class MessageDialog extends BaseDialog {
                     tintColor(btnSelectPositive, backgroundColor);
                 }
             }
-            
+    
             bkg.setMaxWidth(DialogX.dialogMaxWidth);
             if (me instanceof InputDialog) {
                 txtInput.setVisibility(View.VISIBLE);

+ 17 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java

@@ -62,7 +62,7 @@ public class WaitDialog extends BaseDialog {
     protected CharSequence message;
     protected long tipShowDuration = 1500;
     protected float waitProgress = -1;
-    protected int showType = -1;        //-1:Waitdialog 状态标示符,其余为 TipDialog 状态标示
+    protected int showType = -1;        //-1:WaitDialog 状态标示符,其余为 TipDialog 状态标示
     protected TextInfo messageTextInfo;
     protected int maskColor = -1;
     protected BOOLEAN privateCancelable;
@@ -749,4 +749,20 @@ public class WaitDialog extends BaseDialog {
     public static WaitDialog getInstance() {
         return me();
     }
+    
+    /**
+     * 获取当前 WaitDialog 显示状态
+     *
+     * 值的含义:
+     * -1:  WaitDialog 等待状态
+     * 0:   TipDialog 无状态(与 WaitDialog 等待状态相同)
+     * 1:   TipDialog 完成状态
+     * 2:   TipDialog 警告状态
+     * 3:   TipDialog 错误状态
+     *
+     * @return showType
+     */
+    public static int getType() {
+        return me().showType;
+    }
 }

+ 6 - 1
DialogX/src/main/java/com/kongzue/dialogx/impl/ActivityLifecycleImpl.java

@@ -40,7 +40,12 @@ public class ActivityLifecycleImpl implements Application.ActivityLifecycleCallb
     }
     
     public static void init(Context context, ActivityLifecycleImpl.onActivityResumeCallBack onActivityResumeCallBack) {
-        (getApplicationContext(context)).registerActivityLifecycleCallbacks(new ActivityLifecycleImpl(onActivityResumeCallBack));
+        Application application = getApplicationContext(context);
+        if (application == null) {
+            error("DialogX 未初始化。\n请检查是否在启动对话框前进行初始化操作,使用以下代码进行初始化:\nDialogX.init(context);\n\n另外建议您前往查看 DialogX 的文档进行使用:https://github.com/kongzue/DialogX");
+            return;
+        }
+        application.registerActivityLifecycleCallbacks(new ActivityLifecycleImpl(onActivityResumeCallBack));
     }
     
     public static Application getApplicationContext(Context context) {

+ 4 - 4
DialogX/src/main/java/com/kongzue/dialogx/util/views/MaxRelativeLayout.java

@@ -84,7 +84,7 @@ public class MaxRelativeLayout extends RelativeLayout {
     }
     
     public MaxRelativeLayout setMaxWidth(int maxWidth) {
-        if (maxWidth > 0 && this.maxWidth != 0) this.maxWidth = maxWidth;
+        if (maxWidth > 0) this.maxWidth = maxWidth;
         return this;
     }
     
@@ -102,7 +102,7 @@ public class MaxRelativeLayout extends RelativeLayout {
             preWidth = widthSize;
         }
         if (lockWidth) {
-            maxWidth = Math.min(widthSize, preWidth);
+            maxWidth = Math.min(maxWidth, Math.min(widthSize, preWidth));
         }
         if (maxHeight > 0) {
             heightSize = Math.min(heightSize, maxHeight);
@@ -118,10 +118,10 @@ public class MaxRelativeLayout extends RelativeLayout {
             if (widthTemp < minWidth) widthTemp = minWidth;
             if (heightTemp < minHeight) heightTemp = minHeight;
             if (blurView != null) {
-                if (heightMode == EXACTLY){
+                if (heightMode == EXACTLY) {
                     heightTemp = heightSize;
                 }
-                if (widthMode == EXACTLY){
+                if (widthMode == EXACTLY) {
                     widthTemp = widthSize;
                 }
                 LayoutParams lp = (LayoutParams) blurView.getLayoutParams();

+ 1 - 0
DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml

@@ -17,6 +17,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@drawable/rect_dialogx_material_bottom_bkg_light"
             android:clickable="true"
             android:focusableInTouchMode="true">

+ 1 - 0
DialogX/src/main/res/layout/layout_dialogx_bottom_material_dark.xml

@@ -16,6 +16,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@drawable/rect_dialogx_material_bottom_bkg_night"
             android:clickable="true"
             android:focusableInTouchMode="true">

+ 1 - 0
DialogXIOSStyle/src/main/res/layout/layout_dialogx_bottom_ios.xml

@@ -18,6 +18,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:layout_marginLeft="10dp"
             android:layout_marginRight="10dp"
             android:focusableInTouchMode="true"

+ 1 - 0
DialogXIOSStyle/src/main/res/layout/layout_dialogx_bottom_ios_dark.xml

@@ -18,6 +18,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:layout_marginLeft="10dp"
             android:layout_marginRight="10dp"
             android:focusableInTouchMode="true"

+ 1 - 0
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue.xml

@@ -16,6 +16,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@color/white"
             android:focusableInTouchMode="true">
 

+ 1 - 0
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue_dark.xml

@@ -16,6 +16,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@color/dialogxKongzueDarkDialogBkgColor"
             android:focusableInTouchMode="true">
 

+ 1 - 0
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_bottom_miui.xml

@@ -16,6 +16,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@drawable/rect_dialogx_miui_bkg_light"
             android:focusableInTouchMode="true">
 

+ 1 - 0
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_bottom_miui_dark.xml

@@ -16,6 +16,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@drawable/rect_dialogx_miui_bkg_night"
             android:focusableInTouchMode="true">
 

+ 1 - 0
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_miui.xml

@@ -15,6 +15,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@drawable/rect_dialogx_miui_bkg_light">
 
             <LinearLayout

+ 1 - 0
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_miui_dark.xml

@@ -15,6 +15,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
             android:background="@drawable/rect_dialogx_miui_bkg_night">
 
             <LinearLayout

+ 8 - 5
app/build.gradle

@@ -31,11 +31,14 @@ dependencies {
     implementation 'androidx.appcompat:appcompat:1.2.0'
     implementation 'com.github.kongzue:BaseFramework:6.7.9.5'
 
-    implementation 'com.github.kongzue.DialogX:DialogXIOSStyle:0.0.39.debug4'
-    implementation 'com.github.kongzue.DialogX:DialogXKongzueStyle:0.0.39.debug4'
-    implementation 'com.github.kongzue.DialogX:DialogXMIUIStyle:0.0.39.debug4'
+//    implementation 'com.github.kongzue.DialogX:DialogXIOSStyle:0.0.39.debug4'
+//    implementation 'com.github.kongzue.DialogX:DialogXKongzueStyle:0.0.39.debug4'
+//    implementation 'com.github.kongzue.DialogX:DialogXMIUIStyle:0.0.39.debug4'
 
-    implementation 'com.github.kongzue:DialogXStyle-Snackbar:1.0.6'
-    //implementation 'com.github.kongzue.dialogx:DialogX:0.0.37'
     implementation project(path: ':DialogX')
+    implementation project(path: ':DialogXIOSStyle')
+    implementation project(path: ':DialogXKongzueStyle')
+    implementation project(path: ':DialogXMIUIStyle')
+
+    implementation 'com.github.kongzue:DialogXStyle-Snackbar:1.0.6'
 }

+ 1 - 1
gradle.properties

@@ -18,5 +18,5 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.40.beta2
+BUILD_VERSION=0.0.40.beta3
 BUILD_VERSION_INT=39