解决 奖励奖励dialog 横屏后不居中问题

This commit is contained in:
renhaoting 2025-12-18 16:49:53 +08:00
parent d8b43d1082
commit c90b15a7a2
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ open class BindingDialog<VB : ViewBinding>(protected val mActivity: Activity,
} }
setCanceledOnTouchOutside(true) setCanceledOnTouchOutside(true)
window?.setBackgroundDrawableResource(R.color.transparent) window?.setBackgroundDrawableResource(R.color.transparent)
width = (ScreenUtils.getScreenWidth() * 0.8).toInt() width = (Math.min(ScreenUtils.getScreenWidth(), ScreenUtils.getScreenHeight()) * 0.8).toInt()
height = WindowManager.LayoutParams.WRAP_CONTENT height = WindowManager.LayoutParams.WRAP_CONTENT
setWidthHeight() setWidthHeight()
window?.setWindowAnimations(R.style.dialog_alpha) window?.setWindowAnimations(R.style.dialog_alpha)