PanelSwitchHelper icon indicating copy to clipboard operation
PanelSwitchHelper copied to clipboard

Fatal Exception: java.lang.IllegalStateException

Open Lok1n8 opened this issue 2 years ago • 1 comments

window.decorView.rootWindowInsets must not be null

by com.effective.android.panel.utils.DisplayUtil.getNavigationBarHeight` (DisplayUtil.kt:123)

@JvmStatic fun getNavigationBarHeight(context: Context, window: Window): Int { val deviceNavigationHeight = getInternalDimensionSize(context.resources, Constants.NAVIGATION_BAR_HEIGHT_RES_NAME) //三星android9 OneUI2.0一下打开全面屏手势,导航栏实际高度比 deviceHeight 小,需要做兼容 val manufacturer = if (Build.MANUFACTURER == null) "" else Build.MANUFACTURER.trim { it <= ' ' } if (manufacturer.toLowerCase().contains("samsung") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { val stableBottom = window.decorView.rootWindowInsets.stableInsetBottom if (stableBottom < deviceNavigationHeight) { return stableBottom; } } return deviceNavigationHeight; }

should be

@JvmStatic fun getNavigationBarHeight(context: Context, window: Window): Int { val deviceNavigationHeight = DisplayUtil.getInternalDimensionSize( context.resources, Constants.NAVIGATION_BAR_HEIGHT_RES_NAME ) //三星android9 OneUI2.0一下打开全面屏手势,导航栏实际高度比 deviceHeight 小,需要做兼容 val manufacturer = if (Build.MANUFACTURER == null) "" else Build.MANUFACTURER.trim { it <= ' ' } if (manufacturer.toLowerCase() .contains("samsung") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q ) { window.decorView.rootWindowInsets?.let { val stableBottom = it.stableInsetBottom if (stableBottom < deviceNavigationHeight) { return stableBottom; } } } return deviceNavigationHeight; }

Lok1n8 avatar Nov 30 '21 02:11 Lok1n8

grateful! It will be fixed in the next version

YummyLau avatar Jan 12 '22 07:01 YummyLau