Created
August 29, 2024 23:49
-
-
Save alexvanyo/5ed675f77fac4b69b7ba778aaed1a110 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2024 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
composeTestRule.setContent { | |
DeviceConfigurationOverride( | |
DeviceConfigurationOverride.WindowInsets( | |
WindowInsetsCompat.Builder() | |
.setInsets( | |
WindowInsetsCompat.Type.statusBars(), | |
DpRect( | |
left = 0.dp, | |
top = 64.dp, | |
right = 0.dp, | |
bottom = 0.dp, | |
).toAndroidXInsets(), | |
) | |
.setInsets( | |
WindowInsetsCompat.Type.navigationBars(), | |
DpRect( | |
left = 64.dp, | |
top = 0.dp, | |
right = 64.dp, | |
bottom = 64.dp, | |
).toInsets(), | |
) | |
.build(), | |
), | |
) | |
) { | |
Box { | |
content() // Your content under test | |
DebugVisibleWindowInsets(Modifier.fillMaxSize()) // Debug overlay (optional) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment