Browse Source

1.替换UI

王鹏鹏 2 years ago
parent
commit
bc6084eb4a

+ 3 - 3
baselib/src/main/java/com/yingyangfly/baselib/dialog/LoadingDialog.kt

@@ -29,12 +29,12 @@ class LoadingDialog constructor(context: Context) : AlertDialog(context, R.style
     }
 
     fun initViews() {
+        setDialogLayout(window!!)
         mView = ViewTool.inflateLayoutPixelsById(context, R.layout.dialog_loading, 1194, 834)
         setContentView(mView!!)
         fishImage = findViewById(R.id.fishImage)
         ovlImage = findViewById(R.id.ovlImage)
         setCanceledOnTouchOutside(false)
-        setDialogLayout(window!!)
         init()
     }
 
@@ -47,8 +47,8 @@ class LoadingDialog constructor(context: Context) : AlertDialog(context, R.style
 
     private fun setDialogLayout(dialogWindow: Window) {
         dialogWindow.setLayout(
-            ViewGroup.LayoutParams.MATCH_PARENT,
-            ViewGroup.LayoutParams.MATCH_PARENT
+            ViewGroup.LayoutParams.WRAP_CONTENT,
+            ViewGroup.LayoutParams.WRAP_CONTENT
         )
         dialogWindow.setBackgroundDrawableResource(R.color.transparent)
     }