@@ -334,7 +334,8 @@ class ActionListFragment : androidx.fragment.app.Fragment(), PageLayoutRender.On
334334 return krScriptActionHandler?.openFileChooser(callback) ? : false
335335 }
336336 })
337- progressBarDialog.hideDialog()
337+ // Không hideDialog() ở đây nữa — sẽ tắt sau khi dialog tham số
338+ // mới (đã có nền mờ) hiện lên, xem bên dưới.
338339
339340 val customRunner = krScriptActionHandler?.openParamsPage(action, linearLayout) {
340341 try {
@@ -355,13 +356,19 @@ class ActionListFragment : androidx.fragment.app.Fragment(), PageLayoutRender.On
355356 val dialog = if (isLongList) {
356357 AlertDialog .Builder (requireContext(), if (darkMode) R .style.kr_full_screen_dialog_dark else R .style.kr_full_screen_dialog_light)
357358 .setView(dialogView).create().apply {
358- show()
359+ // Set nền blur TRƯỚC show() để tránh nháy (frame đầu không mờ )
359360 window?.let { DialogHelper .setWindowBlurBg(it, requireActivity()) }
361+ show()
360362 }
361363 } else {
362364 DialogHelper .customDialog(requireActivity(), dialogView).dialog
363365 }
364366
367+ // Chỉ tắt dialog "loading" SAU KHI dialog tham số (đã có nền mờ) hiện lên,
368+ // để lúc nào màn hình cũng có một dialog mờ che phủ, không có khoảng
369+ // trống bị "tắt mờ" giữa 2 dialog.
370+ progressBarDialog.hideDialog()
371+
365372 dialogView.findViewById<TextView >(R .id.title).text = action.title
366373 dialogView.findViewById<TextView >(R .id.desc).apply { if (action.desc.isEmpty()) visibility = View .GONE else text = action.desc }
367374 dialogView.findViewById<TextView >(R .id.warn).apply { if (action.warning.isEmpty()) visibility = View .GONE else text = action.warning }
@@ -375,6 +382,9 @@ class ActionListFragment : androidx.fragment.app.Fragment(), PageLayoutRender.On
375382 Toast .makeText(requireContext(), " " + ex.message, Toast .LENGTH_LONG ).show()
376383 }
377384 }
385+ } else {
386+ // openParamsPage tự xử lý UI riêng (không phải dialog blur ở trên) -> tắt loading ngay
387+ progressBarDialog.hideDialog()
378388 }
379389 }
380390 }
0 commit comments