Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a dynamic app theme and launcher icon switching system using Firebase Remote Config and DataStore. It introduces themed activity aliases in the Android manifest and logic in the intro screen to synchronize and apply these themes. Review feedback identifies significant performance risks: the use of runBlocking in the DataStore access may cause ANR issues during app startup, and the launcher icon synchronization involves heavy IPC operations that should be moved to a background thread and optimized to avoid redundant updates.
app/src/main/java/com/eatssu/android/data/local/AppThemeDataStore.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/eatssu/android/presentation/intro/IntroActivity.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Firebase Remote Config의 app_theme 값을 기반으로 인트로 스플래시(배경/로고)와(릴리즈 한정) 런처 아이콘까지 시즌 테마로 전환할 수 있게 하고, 마지막 테마를 로컬에 저장해 다음 실행 시 즉시 반영되도록 확장한 PR입니다.
Changes:
- Remote Config 기본값에
app_theme추가 및AppTheme(도메인) 도입 AppThemeDataStore로 마지막 테마 로컬 저장/복원, Intro에서 테마 적용 및 아이콘 alias 토글- Spring 런처 아이콘 리소스/Adaptive icon 추가 및 Manifest에 launcher alias 구성
Reviewed changes
Copilot reviewed 11 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/xml/firebase_remote_config.xml | Remote Config 기본값에 app_theme 키 추가 |
| app/src/main/res/mipmap-xxxhdpi/ic_launcher_spring.webp | Spring 런처 아이콘(고해상도) 추가 |
| app/src/main/res/mipmap-xxxhdpi/ic_launcher_spring_round.webp | Spring 라운드 런처 아이콘(고해상도) 추가 |
| app/src/main/res/mipmap-xxxhdpi/ic_launcher_spring_foreground.webp | Spring adaptive icon foreground(고해상도) 추가 |
| app/src/main/res/mipmap-xxhdpi/ic_launcher_spring.webp | Spring 런처 아이콘(xxhdpi) 추가 |
| app/src/main/res/mipmap-xxhdpi/ic_launcher_spring_round.webp | Spring 라운드 런처 아이콘(xxhdpi) 추가 |
| app/src/main/res/mipmap-xxhdpi/ic_launcher_spring_foreground.webp | Spring adaptive icon foreground(xxhdpi) 추가 |
| app/src/main/res/mipmap-xhdpi/ic_launcher_spring.webp | Spring 런처 아이콘(xhdpi) 추가 |
| app/src/main/res/mipmap-xhdpi/ic_launcher_spring_round.webp | Spring 라운드 런처 아이콘(xhdpi) 추가 |
| app/src/main/res/mipmap-xhdpi/ic_launcher_spring_foreground.webp | Spring adaptive icon foreground(xhdpi) 추가 |
| app/src/main/res/mipmap-mdpi/ic_launcher_spring.webp | Spring 런처 아이콘(mdpi) 추가 |
| app/src/main/res/mipmap-mdpi/ic_launcher_spring_round.webp | Spring 라운드 런처 아이콘(mdpi) 추가 |
| app/src/main/res/mipmap-mdpi/ic_launcher_spring_foreground.webp | Spring adaptive icon foreground(mdpi) 추가 |
| app/src/main/res/mipmap-hdpi/ic_launcher_spring.webp | Spring 런처 아이콘(hdpi) 추가 |
| app/src/main/res/mipmap-hdpi/ic_launcher_spring_round.webp | Spring 라운드 런처 아이콘(hdpi) 추가 |
| app/src/main/res/mipmap-hdpi/ic_launcher_spring_foreground.webp | Spring adaptive icon foreground(hdpi) 추가 |
| app/src/main/res/mipmap-anydpi-v26/ic_launcher_spring.xml | Spring adaptive icon 정의(v26+) 추가 |
| app/src/main/res/mipmap-anydpi-v26/ic_launcher_spring_round.xml | Spring 라운드 adaptive icon 정의(v26+) 추가 |
| app/src/main/res/layout/activity_intro.xml | Intro 로고 ImageView에 id 추가(테마별 로고 변경용) |
| app/src/main/java/com/eatssu/android/presentation/intro/IntroViewModel.kt | 앱 초기화 시 테마 동기화 및 테마 StateFlow 노출 추가 |
| app/src/main/java/com/eatssu/android/presentation/intro/IntroActivity.kt | 스플래시 테마 적용 및 릴리즈에서 런처 아이콘 alias 토글 추가 |
| app/src/main/java/com/eatssu/android/domain/repository/FirebaseRemoteConfigRepository.kt | Remote Config에서 AppTheme 조회 API 추가 |
| app/src/main/java/com/eatssu/android/domain/model/AppTheme.kt | 테마(remoteValue/스플래시 리소스/alias suffix) 모델 추가 |
| app/src/main/java/com/eatssu/android/data/remote/repository/FirebaseRemoteConfigRepositoryImpl.kt | getAppTheme() 구현 및 fetch 호출 공통화 |
| app/src/main/java/com/eatssu/android/data/local/AppThemeDataStore.kt | 마지막 테마를 DataStore에 저장/조회하는 컴포넌트 추가 |
| app/src/main/AndroidManifest.xml | 런처 진입점을 activity-alias로 전환하고 시즌 아이콘 alias 추가 |
Comments suppressed due to low confidence (1)
app/src/main/java/com/eatssu/android/presentation/intro/IntroViewModel.kt:67
initializeApp()에서syncAppTheme()를checkVersionUpdate()/autoLogin()보다 먼저 순차 실행하고 있어, Remote Config fetch가 느릴 경우 인트로 초기화 전체가 지연될 수 있습니다. 테마 동기화는 스플래시 UI 갱신 용도라면 다른 초기화 작업을 막지 않도록 별도 코루틴으로 병렬 실행(또는 fetch는 한 번만 수행 후 값만 읽기)하는 구성이 더 안전합니다.
private fun initializeApp() {
viewModelScope.launch {
_uiState.value = UiState.Loading
try {
syncAppTheme()
// 1. 버전 체크 (Firebase Remote Config는 자동으로 초기화됨)
checkVersionUpdate()
// 2. 자동 로그인 체크
autoLogin()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/src/main/java/com/eatssu/android/data/local/AppThemeDataStore.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/eatssu/android/presentation/intro/IntroViewModel.kt
Outdated
Show resolved
Hide resolved
| override suspend fun getMinimumVersionCode(): Long { | ||
| // 값을 가져오기 전에 fetchAndActivate 호출 | ||
| // min fetch interval이 지나지 않았으면 로컬 캐시를 사용하고, 지났으면 서버에서 가져옵니다. | ||
| try { | ||
| instance.fetchAndActivate().await() | ||
| } catch (e: Exception) { | ||
| Timber.e(e, "RemoteConfig fetchAndActivate 실패") | ||
| } | ||
| fetchAndActivateSafely() | ||
| return instance.getLong("android_version_code") | ||
| } | ||
|
|
||
| override suspend fun getAppTheme(): AppTheme { | ||
| fetchAndActivateSafely() | ||
| return AppTheme.fromStringOrDefault(instance.getString("app_theme")) | ||
| } | ||
|
|
||
| override suspend fun getRestaurantInfo(restaurant: Restaurant): RestaurantInfo? { | ||
| // 값을 가져오기 전에 fetchAndActivate 호출 | ||
| fetchAndActivateSafely() | ||
| return getCafeteriaInfo().find { it.enum == restaurant } |
There was a problem hiding this comment.
getMinimumVersionCode()/getAppTheme()/getRestaurantInfo()가 모두 fetchAndActivateSafely()를 호출하고 있어, 앱 시작 시 여러 값을 연속으로 읽는 경우 fetchAndActivate()가 중복 호출됩니다. Remote Config가 내부적으로 캐시를 쓰더라도 불필요한 작업/지연이 발생할 수 있으니, fetch를 1회만 수행하도록 (예: fetch 작업을 memoize하거나, 외부에서 한 번 fetch 후 여러 getter가 값을 읽도록) 구조를 조정하는 게 좋습니다.
chlwhdtn03
left a comment
There was a problem hiding this comment.
앱 테마랑 아이콘을 Firebase에서 한번에 제어하는거네요
와 너무 깔끔한데요 테스트코드까지
What changed
app_theme값을 기반으로 인트로 스플래시 테마를 전환하도록 추가했습니다.AppTheme와AppThemePreference를 도입해 마지막으로 불러온 테마를 저장하고, 다음 실행 시 초기 스플래시에 반영되도록 했습니다.spring으로 통일하고 관련 리소스와 참조를 정리했습니다.Why
Impact