시스템이 충분한 대비를 보장해야 하는지를 설정합니다. * 이 값으로 설정하면, 시스템은 이 앱의 콘텐츠와 내비게이션 바 간에 충분한 대비가 필요한지를 판단하여, * 대비를 확보하기 위해 스크림이 필요한지 여부를 결정하고, 적절한 내비게이션 바 배경색을 설정합니다. * 내비게이션 바 색상이 불투명하거나 반투명이면, 이 속성의 값은 아무런 효과를 미치지 않습니다. */ fun setNavigationBarContrastEnforced(enforceContrast: Boolean) { }
시스템이 충분한 대비를 보장해야 하는지를 설정합니다. * 이 값으로 설정하면, 시스템은 이 앱의 콘텐츠와 내비게이션 바 간에 충분한 대비가 필요한지를 판단하여, * 대비를 확보하기 위해 스크림이 필요한지 여부를 결정하고, 적절한 내비게이션 바 배경색을 설정합니다. * 내비게이션 바 색상이 불투명하거나 반투명이면, 이 속성의 값은 아무런 효과를 미치지 않습니다. */ fun setNavigationBarContrastEnforced(enforceContrast: Boolean) { }
of the status bars * to light so that the items on the bar can be read clearly. * If false, reverts to the default appearance. */ fun setAppearanceLightStatusBars(isLight: Boolean) { mImpl.setAppearanceLightStatusBars(isLight) } StatusBar 아이콘 혹은 텍스트의 색상을 변경 - true -> 어두운 색상 - false -> 밝은 색상
= Modi fi er ) { Box( modi fi er = modi fi er . fi llMaxSize() .systemBarsPadding() .background(colorResource(R.color.gray)) ) { Child() } } @Composable private fun Child( modi fi er: Modi fi er = Modi fi er ) { Box( modi fi er = modi fi er .systemBarsPadding() . fi llMaxWidth() .height(40.dp) .background(colorResource(R.color.light_gray)) ) } Compose Window Inset
= Modi fi er ) { Box( modi fi er = modi fi er . fi llMaxSize() .systemBarsPadding() .background(colorResource(R.color.gray)) ) { Child() } } @Composable private fun Child( modi fi er: Modi fi er = Modi fi er ) { Box( modi fi er = modi fi er .systemBarsPadding() . fi llMaxWidth() .height(40.dp) .background(colorResource(R.color.light_gray)) ) } Compose Window Inset
= Modi fi er ) { Box( modi fi er = modi fi er . fi llMaxSize() .systemBarsPadding() .background(colorResource(R.color.gray)) ) { Child() } } @Composable private fun Child( modi fi er: Modi fi er = Modi fi er ) { Box( modi fi er = modi fi er .systemBarsPadding() . fi llMaxWidth() .height(40.dp) .background(colorResource(R.color.light_gray)) ) } Compose Window Inset
= Modi fi er ) { Box( modi fi er = modi fi er . fi llMaxSize() .systemBarsPadding() .background(colorResource(R.color.gray)) ) { Child() } } @Composable private fun Child( modi fi er: Modi fi er = Modi fi er ) { Box( modi fi er = modi fi er .systemBarsPadding() . fi llMaxWidth() .height(40.dp) .background(colorResource(R.color.light_gray)) ) } Compose Window Inset
= Modi fi er ) { Box( modi fi er = modi fi er . fi llMaxSize() .systemBarsPadding() .background(colorResource(R.color.gray)) ) { Child() } } @Composable private fun Child( modi fi er: Modi fi er = Modi fi er ) { Box( modi fi er = modi fi er .systemBarsPadding() . fi llMaxWidth() .height(40.dp) .background(colorResource(R.color.light_gray)) ) } Compose Window Inset
* * Any insets consumed by other insets padding modi fi ers or [consumeWindowInsets] on a parent layout * will be excluded from the padding. [WindowInsets.Companion.systemBars] will be * [consumed][consumeWindowInsets] for child layouts as well. * * For example, if a parent layout uses [statusBarsPadding], the * area that the parent layout pads for the status bars will not be padded again by this * [systemBarsPadding] modi fi er. * * When used, the [WindowInsets] will be consumed. * * @sample androidx.compose.foundation.layout.samples.systemBarsPaddingSample */ expect fun Modi fi er.systemBarsPadding(): Modi fi er
* * Any insets consumed by other insets padding modi fi ers or [consumeWindowInsets] on a parent layout * will be excluded from the padding. [WindowInsets.Companion.systemBars] will be * [consumed][consumeWindowInsets] for child layouts as well. * * For example, if a parent layout uses [statusBarsPadding], the * area that the parent layout pads for the status bars will not be padded again by this * [systemBarsPadding] modi fi er. * * When used, the [WindowInsets] will be consumed. * * @sample androidx.compose.foundation.layout.samples.systemBarsPaddingSample */ expect fun Modi fi er.systemBarsPadding(): Modi fi er
= Modi fi er ) { Box( modi fi er = modi fi er . fi llMaxSize() .padding(WindowInsets.systemBars.asPaddingValues()) .background(colorResource(R.color.gray)) ) { Child() } } @Composable private fun Child( modi fi er: Modi fi er = Modi fi er ) { Box( modi fi er = modi fi er .padding(WindowInsets.systemBars.asPaddingValues()) . fi llMaxWidth() .height(40.dp) .background(colorResource(R.color.light_gray)) ) }
insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) v.updateMargin( top = sysBars.top, bottom = sysBars.bottom, start = v.marginStart, end = v.marginEnd ) WindowInsetsCompat.CONSUMED } 1 .StatusBar랑 Cutout은 거의 겹쳐 있다. 2 . Cutout 은 hide/show 개념이 아니다.
insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) v.updateMargin( top = sysBars.top, bottom = sysBars.bottom, start = v.marginStart, end = v.marginEnd ) WindowInsetsCompat.CONSUMED } ViewCompat.setOnApplyWindowInsetsListener( binding.root ) { v, insets -> val sysBars = insets.getInsets( WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() ) v.updateMargin( top = sysBars.top, bottom = sysBars.bottom, start = v.marginStart, end = v.marginEnd ) WindowInsetsCompat.CONSUMED } 1 .StatusBar랑 Cutout은 거의 겹쳐 있다. 2 . Cutout 은 hide/show 개념이 아니다.