-
Notifications
You must be signed in to change notification settings - Fork 0
fix: EdgeToEdge 대응 #755
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
fix: EdgeToEdge 대응 #755
Conversation
Walkthrough액티비티와 컴포저블의 엣지투엣지·시스템바 처리 통합: BaseActivity에서 윈도우 인셋을 소비하도록 변경하고, 시스템바 아이콘 색 설정 유틸을 파라미터화(흰/어두움)로 교체했으며 여러 액티비티·컴포저블에서 WindowInsets.systemBars 기반 패딩/초기화로 전환하고 일부 액티비티 상속/레이아웃을 조정했습니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant A as Activity.onCreate
participant H as setupSystemBarIconColor
participant W as Window/InsetsController
participant B as BaseActivity InsetsListener
participant C as Compose UI
A->>H: setupSystemBarIconColor(isLightMode)
H->>W: WindowCompat.getInsetsController(window, view)
W-->>H: apply isAppearanceLightStatusBars/NavigationBars
A->>C: setContent { Composables }
C->>W: request WindowInsets.systemBars (windowInsetsPadding)
W->>B: dispatch insets
B->>B: apply padding to root view
B-->>W: return WindowInsetsCompat.CONSUMED
note right of B: Insets are consumed after padding applied
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (1 passed, 3 warnings, 1 inconclusive)❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. ✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
m6z1
left a comment
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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
app/src/main/java/com/into/websoso/core/common/ui/base/BaseActivity.kt (1)
21-32: 기존 패딩이 덮어써질 수 있음 — 초기 패딩을 보존해 합산하세요현재
updatePadding이 XML/코드에 정의된 기존 패딩을 모두 덮어씁니다. 인셋 적용 시 초기 패딩을 보존하지 않으면 UI가 의도보다 좁아지거나 어긋날 수 있습니다. 초기 패딩을 캡처해 인셋과 합산하는 형태로 바꾸는 것을 권장합니다.아래와 같이 초기 패딩을 캡처해 합산하는 형태로 수정 제안:
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() _binding = DataBindingUtil.setContentView(this, layoutResId) + val initialLeft = binding.root.paddingLeft + val initialTop = binding.root.paddingTop + val initialRight = binding.root.paddingRight + val initialBottom = binding.root.paddingBottom ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets -> val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) val bottom = kotlin.math.max(bars.bottom, ime.bottom) v.updatePadding( - top = bars.top, - bottom = bottom, - left = bars.left, - right = bars.right, + top = initialTop + bars.top, + bottom = initialBottom + bottom, + left = initialLeft + bars.left, + right = initialRight + bars.right, ) WindowInsetsCompat.CONSUMED } }app/src/main/java/com/into/websoso/ui/expandedFeedImage/ExpandedFeedImageScreen.kt (1)
82-85: 접근성: Icon에 의미 있는 contentDescription을 제공하세요
contentDescription = null은 스크린리더 사용자가 닫기 기능을 인지하지 못하게 합니다. 간단히 “닫기” 등의 설명을 넣어 주세요.- Icon( + Icon( painter = painterResource(id = ic_expanded_feed_image_close), - contentDescription = null, + contentDescription = "닫기", tint = White,리소스 체계를 쓰신다면
stringResource(R.string.cd_close)로 교체를 권장합니다.
🧹 Nitpick comments (4)
app/src/main/java/com/into/websoso/ui/expandedFeedImage/ExpandedFeedImageActivity.kt (1)
20-22: 필수 인텐트 데이터 부재 시 빈 화면 가능성 — 액티비티 종료로 처리 권장
return@WebsosoTheme로 컴포지션만 빠져나오면 Activity는 유지되어 빈 화면이 될 수 있습니다. 인텐트 검증을setContent이전에 수행하고 실패 시finish()로 종료하는 흐름이 더 안전합니다.override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() - setContent { + val imageUrls = intent.getStringArrayListExtra(FEED_IMAGE_URLS) + ?: run { + finish() + return + } + setContent { WebsosoTheme { ExpandedFeedImageScreen( index = intent.getIntExtra(FEED_IMAGE_INDEX, 0), - imageUrls = intent.getStringArrayListExtra(FEED_IMAGE_URLS) - ?: return@WebsosoTheme, + imageUrls = imageUrls, onBackButtonClick = { setResult(ResultFrom.Notification.RESULT_OK) finish() }, ) }app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt (2)
166-176: InsetsController 재사용 및 네비게이션 바 색상 설정 제안
getInsetsController를 두 번 호출하지 말고 컨트롤러를 재사용하세요. 또한 “White 시스템 바” 의도라면 3-버튼 내비 모드에서 배경 대비를 보장하기 위해navigationBarColor도 흰색으로 설정하는 편이 일관됩니다. (제스처 내비에서는 콘텐츠 배경과의 대비를 별도 검토 필요)fun Activity.setupWhiteSystemBar() { - this.window.statusBarColor = White.toArgb() - - WindowCompat.getInsetsController(this.window, this.window.decorView).apply { - isAppearanceLightStatusBars = true - } - - WindowCompat.getInsetsController(this.window, this.window.decorView).apply { - isAppearanceLightNavigationBars = true - } + window.statusBarColor = White.toArgb() + window.navigationBarColor = White.toArgb() + val controller = WindowCompat.getInsetsController(window, window.decorView) + controller.isAppearanceLightStatusBars = true + controller.isAppearanceLightNavigationBars = true }주의:
- 화면 배경이 어두운 화면(예: 전체화면 이미지)에서는 이 함수를 호출하지 않아야 내비 아이콘 대비 문제가 없습니다. 호출 위치별 배경 톤을 재점검해 주세요.
1-1: 파일명 오탈자
ExtentionFuction.kt→ExtensionFunction.kt(또는ExtensionFunctions.kt)로 정정 권장. 검색성 및 일관성 측면에서 이득이 있습니다.app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (1)
41-46: Scaffold의 기본 인셋 + 수동windowInsetsPadding중복 가능성
Scaffold는 기본적으로 콘텐츠 인셋을 적용합니다. 여기에 추가로windowInsetsPadding(WindowInsets.systemBars)까지 주면 상·하단 여백이 이중 적용될 수 있습니다. 하나로 통일해 주세요.두 가지 중 택1:
- 상위 Modifier에서만 인셋 처리:
Scaffold( modifier = Modifier .fillMaxSize() - .background(color = White) - .windowInsetsPadding(WindowInsets.systemBars), + .background(color = White), ) { inner -> Box(modifier = Modifier.padding(inner)) {
- 혹은
Scaffold의 인셋을 0으로 두고 상위 Modifier에서 처리 유지:Scaffold( modifier = Modifier .fillMaxSize() .background(color = White) .windowInsetsPadding(WindowInsets.systemBars), + contentWindowInsets = WindowInsets(0), ) { inner ->
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
app/src/main/java/com/into/websoso/core/common/ui/base/BaseActivity.kt(1 hunks)app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt(1 hunks)app/src/main/java/com/into/websoso/ui/expandedFeedImage/ExpandedFeedImageActivity.kt(1 hunks)app/src/main/java/com/into/websoso/ui/expandedFeedImage/ExpandedFeedImageScreen.kt(2 hunks)app/src/main/java/com/into/websoso/ui/login/LoginActivity.kt(2 hunks)app/src/main/java/com/into/websoso/ui/main/MainActivity.kt(0 hunks)app/src/main/java/com/into/websoso/ui/notification/NotificationActivity.kt(2 hunks)app/src/main/java/com/into/websoso/ui/notificationDetail/NotificationDetailActivity.kt(2 hunks)app/src/main/java/com/into/websoso/ui/splash/SplashActivity.kt(2 hunks)app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt(3 hunks)app/src/main/res/layout/activity_login.xml(0 hunks)app/src/main/res/layout/activity_splash.xml(1 hunks)feature/signin/src/main/java/com/into/websoso/feature/signin/SignInScreen.kt(2 hunks)
💤 Files with no reviewable changes (2)
- app/src/main/java/com/into/websoso/ui/main/MainActivity.kt
- app/src/main/res/layout/activity_login.xml
🧰 Additional context used
🧬 Code graph analysis (5)
app/src/main/java/com/into/websoso/ui/notificationDetail/NotificationDetailActivity.kt (1)
app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt (1)
setupWhiteSystemBar(166-176)
app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (1)
app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt (1)
setupWhiteSystemBar(166-176)
app/src/main/java/com/into/websoso/ui/login/LoginActivity.kt (1)
app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt (1)
setupWhiteSystemBar(166-176)
app/src/main/java/com/into/websoso/ui/notification/NotificationActivity.kt (1)
app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt (1)
setupWhiteSystemBar(166-176)
app/src/main/java/com/into/websoso/ui/expandedFeedImage/ExpandedFeedImageActivity.kt (1)
app/src/main/java/com/into/websoso/ui/expandedFeedImage/ExpandedFeedImageScreen.kt (1)
ExpandedFeedImageScreen(31-74)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (16)
app/src/main/java/com/into/websoso/core/common/ui/base/BaseActivity.kt (1)
33-33: WindowInsets를 CONSUMED로 반환하면 자식 뷰/프래그먼트가 인셋을 못 받을 수 있어요루트에서 인셋을 소비하면 하위 뷰(특히 추가로
windowInsetsPadding을 쓰는 Compose/뷰)가 인셋을 못 받아 중복/부재 문제가 교차로 발생할 수 있습니다. 상위에서만 인셋을 처리할지, 자식에게 위임할지 정책을 확정해 주세요. 자식에서도 인셋을 활용한다면 반환값을 그대로 유지하는 편이 안전합니다.정책을 자식 위임으로 할 경우:
- WindowInsetsCompat.CONSUMED + insetsapp/src/main/java/com/into/websoso/ui/expandedFeedImage/ExpandedFeedImageScreen.kt (1)
46-48:windowInsetsPadding(WindowInsets.systemBars)적용 방향 좋습니다배경을 먼저 깔고(system 뒤 포함) 그 다음 인셋 패딩을 적용하는 순서가 적절합니다. 이미지 및 상단 컨트롤이 시스템 바에 가리지 않습니다.
feature/signin/src/main/java/com/into/websoso/feature/signin/SignInScreen.kt (1)
84-85: systemBars 전부에 패딩을 주는 변경의 파급범위 확인 필요이전엔 주로 하단 네비게이션 영역만 고려했는데, 이제 상단 상태바까지 포함됩니다. 상단 여백 증가가 의도된 UI인지, 외부에서 추가로 인셋을 적용하는 레이어(예: Scaffold, Activity 루트)와 중복되지 않는지 확인해 주세요.
app/src/main/java/com/into/websoso/ui/notificationDetail/NotificationDetailActivity.kt (1)
22-23: LGTM — 시스템 바 설정 일관화
enableEdgeToEdge()이후setupWhiteSystemBar()호출로 다른 화면과 정책이 맞춰졌습니다.app/src/main/java/com/into/websoso/ui/notification/NotificationActivity.kt (1)
25-26: LGTM — 시스템 바 정책 일관화기존
setupWhiteStatusBar()→setupWhiteSystemBar()전환이 잘 반영되었습니다.app/src/main/java/com/into/websoso/ui/login/LoginActivity.kt (4)
8-8: LGTM!
AppCompatActivity에서ComponentActivity로의 변경은 Compose 기반 UI에 적합한 선택입니다.
24-24: 클래스 상속 변경이 올바르게 적용되었습니다
AppCompatActivity에서ComponentActivity로의 변경으로 Compose 기반 UI에 더 적합한 구조가 되었습니다.
36-37: 시스템 바 설정 순서 — 문제 없음enableEdgeToEdge() 호출 후 setupWhiteSystemBar()로 시스템 바 색상·외관을 설정하는 순서는 Android 권장 순서와 일치합니다. 이후 WindowInsets 처리가 적절히 적용되는지 확인하세요.
17-17: 함수명 변경 확인: setupWhiteStatusBar → setupWhiteSystemBar (문제 없음)기존 setupWhiteStatusBar 호출은 코드베이스에서 발견되지 않았습니다. 새 정의는 app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt의 fun Activity.setupWhiteSystemBar()이며, LoginActivity/NotificationActivity/NotificationDetailActivity/UserStorageActivity 등에서 setupWhiteSystemBar()로 호출되고 있습니다.
app/src/main/res/layout/activity_splash.xml (3)
2-4: 데이터 바인딩 구조로 올바르게 변경되었습니다레이아웃이 데이터 바인딩을 지원하도록
<layout>태그로 래핑되었고, 필요한 네임스페이스도 적절히 선언되었습니다.
6-8: 빈 데이터 블록현재는 빈
<data>블록이지만, 향후 바인딩 변수가 필요할 때를 대비한 구조입니다.
10-37: 기존 UI 구조가 그대로 유지되었습니다데이터 바인딩 구조로 변경되었지만 실제 UI 요소들과 제약사항은 모두 동일하게 유지되어 기존 기능에 영향을 주지 않습니다.
app/src/main/java/com/into/websoso/ui/splash/SplashActivity.kt (4)
10-10: BaseActivity 사용으로 일관성 있는 구조
BaseActivity로 변경하여 앱 전반의 Activity 구조가 일관성을 갖게 되었습니다.
12-12: 데이터 바인딩 import 추가
ActivitySplashBindingimport가 추가되어 데이터 바인딩을 사용할 준비가 완료되었습니다.
21-21: BaseActivity와 데이터 바인딩 구조가 올바르게 적용되었습니다
BaseActivity<ActivitySplashBinding>를 사용하여 타입 안전한 바인딩과 일관된 Activity 구조를 확보했습니다.
27-32: 기존 로직이 그대로 유지되었습니다Activity 생명주기와 관련된 핵심 로직이 변경되지 않아 기능상 문제가 없을 것으로 보입니다.
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt (2)
164-169: 대안 제안: enableEdgeToEdge(SystemBarStyle)로 테마 연동 및 제스처 내비 대응 강화activity-ktx(1.8+)를 사용 중이면, SystemBarStyle을 이용해 테마에 따라 아이콘 명암과 스크림을 일관되게 적용할 수 있습니다. 추후 확장성과 API 차등처리를 줄이는 데 유리합니다.
예시:
import androidx.activity.SystemBarStyle import androidx.activity.enableEdgeToEdge import android.graphics.Color fun Activity.setSystemBars(darkIcons: Boolean) { val light = SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT) val dark = SystemBarStyle.dark(Color.TRANSPARENT) enableEdgeToEdge( statusBarStyle = if (darkIcons) light else dark, navigationBarStyle = if (darkIcons) light else dark, ) }참고: 제스처 내비 환경에서는 내비 아이콘이 거의 보이지 않으므로 상태바/내비를 분리 제어할 필요가 있으면 오버로드로 분화해도 좋습니다.
1-1: 파일명 오타 니트픽: ExtentionFuction → ExtensionFunction유틸 파일명 오타가 누적되면 검색/탐색성이 떨어집니다. 리네임을 권장합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
app/src/main/java/com/into/websoso/core/common/ui/base/BaseActivity.kt(2 hunks)app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt(1 hunks)app/src/main/java/com/into/websoso/ui/login/LoginActivity.kt(2 hunks)app/src/main/java/com/into/websoso/ui/notification/NotificationActivity.kt(2 hunks)app/src/main/java/com/into/websoso/ui/notificationDetail/NotificationDetailActivity.kt(2 hunks)app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt
- app/src/main/java/com/into/websoso/ui/login/LoginActivity.kt
- app/src/main/java/com/into/websoso/ui/notification/NotificationActivity.kt
- app/src/main/java/com/into/websoso/ui/notificationDetail/NotificationDetailActivity.kt
- app/src/main/java/com/into/websoso/core/common/ui/base/BaseActivity.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
app/src/main/java/com/into/websoso/core/common/util/ExtentionFuction.kt (2)
164-169: LGTM: 시스템바 아이콘 토글 유틸 일관화WindowInsetsControllerCompat를 통해 상태바/내비게이션바 아이콘 색을 한곳에서 토글하도록 정리된 점 좋습니다.
164-169: 네이밍 혼동: isLightMode → darkIcons 계열로 변경 권장isAppearanceLightStatusBars = true는 '밝은 배경에서 어두운 아이콘'을 의미하므로 isLightMode는 오해 소지 있음. darkIcons 계열 네이밍으로 변경 권장.
-fun Activity.setupSystemBarIconColor(isLightMode: Boolean) { - WindowCompat.getInsetsController(this.window, this.window.decorView).apply { - isAppearanceLightStatusBars = isLightMode - isAppearanceLightNavigationBars = isLightMode - } -} +fun Activity.setSystemBarDarkIcons(darkIcons: Boolean) { + WindowCompat.getInsetsController(window, window.decorView).apply { + isAppearanceLightStatusBars = darkIcons + isAppearanceLightNavigationBars = darkIcons + } +}호출부 검색 결과: 리포지토리에서 setupSystemBarIconColor 호출을 찾지 못했습니다(검색 제한 가능). 변경 시 호출부 전부 점검·수정 필요.
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
Summary by CodeRabbit
신기능
스타일
리팩터링
버그 수정