-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT/#122] 스토리 몰입모드 구현 및 배경 변경 #223
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생많으셨어요!
좀 더 시각적으로 개선되었어요
backgroundColor: Color = Color.Gray, | ||
backgroundColor: Color = Color.White, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
흰색이 회색보다 시각적으로 보기가 편해요
DisposableEffect(Unit) { | ||
// 몰입 모드 활성화 | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { | ||
val windowInsetsController = window?.insetsController | ||
windowInsetsController?.systemBarsBehavior = | ||
WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE | ||
windowInsetsController?.hide(WindowInsets.Type.systemBars()) | ||
} else { | ||
@Suppress("DEPRECATION") | ||
window?.decorView?.systemUiVisibility = ( | ||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | ||
or View.SYSTEM_UI_FLAG_FULLSCREEN | ||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | ||
) | ||
} | ||
|
||
onDispose { | ||
// 몰입 모드 비활성화 | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { | ||
val windowInsetsController = window?.insetsController | ||
windowInsetsController?.show(WindowInsets.Type.systemBars()) | ||
} else { | ||
@Suppress("DEPRECATION") | ||
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DisposableEffect 는 LaunchedEffect 랑 다르게 coroutineScope을 사용하지 않네요.
컴포지션 끝나면 onDispose 호출해서 비활성화 되는 부분 좋은 사용의 예시라고 생각드네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DisposableEffect 라는 게 있군요! Composable 함수가 종료될 때 사용할 수 있는 함수로 라이프사이클에 따르면 onStop 과 onDestroy 사이에 onDispose가 호출된다고 하네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이즈 굳~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다!
DisposableEffect(Unit) { | ||
// 몰입 모드 활성화 | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { | ||
val windowInsetsController = window?.insetsController | ||
windowInsetsController?.systemBarsBehavior = | ||
WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE | ||
windowInsetsController?.hide(WindowInsets.Type.systemBars()) | ||
} else { | ||
@Suppress("DEPRECATION") | ||
window?.decorView?.systemUiVisibility = ( | ||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | ||
or View.SYSTEM_UI_FLAG_FULLSCREEN | ||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | ||
) | ||
} | ||
|
||
onDispose { | ||
// 몰입 모드 비활성화 | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { | ||
val windowInsetsController = window?.insetsController | ||
windowInsetsController?.show(WindowInsets.Type.systemBars()) | ||
} else { | ||
@Suppress("DEPRECATION") | ||
window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DisposableEffect 라는 게 있군요! Composable 함수가 종료될 때 사용할 수 있는 함수로 라이프사이클에 따르면 onStop 과 onDestroy 사이에 onDispose가 호출된다고 하네요!
📍 Work Description
📸 Screenshot
default.mp4
📢 To Reviewers
⏲️Time