Skip to content

Conversation

@stopstone
Copy link
Contributor

작업 내용

  • Near 화이트 이미지 추가 (ic_near_logo_title_white)
  • 기존 ic_near_logo_title 네이밍 변경
    -> ic_near_logo_title_primary
  • DataStore에 저장된 값을 확인하여 로그인, 홈 화면 이동
  • 추후 튜토리얼 화면, 홈 화면으로 변경
  • 앱 아이콘 설정
  • png 이미지 dpi별 drawble 분리

확인 방법

실행 시: 앱 첫 화면
코드: feature/ splash

참고 사항

SplashViewModel에서 delayTime을 1000으로 설정해두었습니다.
나중에 논의 후 값을 변경해도 좋을 것 같습니다

- 스플랫쉬 화면에서 이전에 로그인이 되었는지 확인
- DataStore에 저장된 로그인 정보가 있다면 홈 화면
- 없다면 로그인 화면으로 이동한다.
- 상태를 불러오는데 실패하면 로그인 화면으로 이동한다.
- dpi별 mipmap 설정
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @stopstone, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 앱의 초기 사용자 경험을 개선하기 위해 스플래시 화면을 도입하고 자동 로그인 기능을 구현합니다. 앱이 시작될 때 스플래시 화면을 통해 로딩 시간을 제공하고, 저장된 사용자 인증 정보를 기반으로 로그인 화면 또는 홈 화면으로 자동으로 이동시켜 사용자 편의성을 높입니다. 또한, 앱의 시각적 일관성을 위해 앱 아이콘과 로고 이미지 리소스를 업데이트했습니다.

Highlights

  • 스플래시 화면 및 자동 로그인 기능 구현: 앱 시작 시 사용자 로그인 상태에 따라 적절한 화면으로 자동 이동하는 스플래시 화면과 자동 로그인 기능이 추가되었습니다.
  • 앱 아이콘 및 로고 이미지 리소스 업데이트: 앱 아이콘이 새로운 디자인으로 업데이트되었으며, 기존 로고 이미지 리소스의 이름이 변경되고 새로운 흰색 로고 이미지가 추가되었습니다.
  • Jetpack Compose Navigation 통합: Jetpack Compose Navigation을 활용하여 스플래시 화면을 앱의 시작 지점으로 설정하고, 로그인 및 홈 화면으로의 전환 로직을 통합했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 PR은 스플래시 화면을 추가하고 자동 로그인 기능을 구현한 것을 확인했습니다. 전반적으로 코드가 잘 작성되었지만, 사용자 경험에 영향을 줄 수 있는 스플래시 화면의 성능 문제를 발견했습니다. 또한, 코드 스타일을 개선할 수 있는 부분을 제안했습니다. 자세한 내용은 각 파일의 주석을 참고해주세요.

Comment on lines 22 to 32
runCatching {
delay(SPLASH_DELAY_MILLIS)
authRepository.isLoggedIn()
}.onSuccess { isLoggedIn ->
when(isLoggedIn) {
true -> { onNavigateToHome() }
false -> { onNavigateToLogin() }
}
}.onFailure { exception ->
onNavigateToLogin()
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

현재 checkLoginStatusAndNavigate 함수는 delay를 먼저 실행한 후 로그인 상태를 확인하고 있어, 앱 시작 시간이 불필요하게 길어질 수 있습니다. 예를 들어, 로그인 상태 확인에 200ms가 걸린다면, 총 스플래시 시간은 1000ms + 200ms = 1200ms가 됩니다.

로그인 상태 확인과 최소 스플래시 시간 보장을 병렬로 처리하여 사용자 경험을 개선하는 것이 좋습니다. 아래와 같이 수정하면 로그인 상태를 확인하는 동안 최소 스플래시 시간을 보장할 수 있어, 전체 대기 시간을 줄일 수 있습니다.

            val startTime = System.currentTimeMillis()
            val isLoggedInResult = runCatching { authRepository.isLoggedIn() }
            val elapsedTime = System.currentTimeMillis() - startTime

            val remainingDelay = SPLASH_DELAY_MILLIS - elapsedTime
            if (remainingDelay > 0) {
                delay(remainingDelay)
            }

            if (isLoggedInResult.getOrNull() == true) {
                onNavigateToHome()
            } else {
                onNavigateToLogin()
            }

Comment on lines 36 to 38
companion object {
const val SPLASH_DELAY_MILLIS = 1000L
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

companion object는 이 클래스에서 하나의 상수를 선언하기 위해 사용하기에는 다소 과합니다. Kotlin에서는 파일 최상단에 private const val로 선언하는 것이 더 일반적이고 간결한 방법입니다.

아래와 같이 companion object를 제거하고, 파일 상단(package 선언 아래)에 상수를 이동하는 것을 권장합니다.

// Near/app/src/main/java/com/alarmy/near/presentation/feature/splash/SplashViewModel.kt
package com.alarmy.near.presentation.feature.splash

import ...

private const val SPLASH_DELAY_MILLIS = 1000L

@HiltViewModel
class SplashViewModel ... {
    // ...
}

stopstone and others added 7 commits September 4, 2025 02:06
- navigation 함수를 viewModel에서 처리하던 기존 코드에서 Effect를 활용해 Screen에서 관리하는 코드로 변경

- 스플래시에서 uiState를 관리하지 않아 effect만 선언
- Android 12 이상 버전과의 호환성을 위해 `core-splashscreen` 라이브러리를 추가했습니다.
- SplashScreen API를 사용하여 스플래시 화면을 추가했습니다.
- MainActivity에 스플래시 테마를 적용했습니다.
- values/themes.xml에 스플래시 화면 스타일을 정의했습니다.
- 앱 시작 시 로그인 상태를 확인하고, 그 결과에 따라 초기 화면(로그인 또는 홈)으로 이동하도록 로직을 구현했습니다.
- `MainViewModel`을 추가하여 로그인 상태 확인 및 UI 상태를 관리합니다.
- `MainActivity`에서 `installSplashScreen`을 사용하여 API 스플래시를 적용하고, 로그인 상태 확인이 완료될 때까지 스플래시 화면이 유지되도록 수정했습니다.
@stopstone stopstone merged commit 6165bff into dev Sep 18, 2025
1 check passed
@stopstone stopstone deleted the feat/splash-auto-login branch September 19, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants