• Home
  • About
    • Zzu-h photo

      Zzu-h

      주니어 Android 개발자입니다.

    • Learn More
    • Email
    • Instagram
    • Tistory
    • Github
  • Posts
    • All Posts
    • All Tags
    • All Categories
  • Projects

Android: Splash

06 Apr 2022

Reading time ~1 minute

🎯 Splash

  • Splash Screen은 이미지나 로고, 현재 버전의 소프트웨어를 포함한 그래픽 요소를 보여주는 화면
  • Splash screens은 프로그램이 로딩되고 있다는걸 알려주기 위해서 사용
  • Splash 화면은 크게 두 가지 방법으로 나뉜다.
    • Splash Activity
      • 일반적인 Activity를 구현하여 Main Activity로 Launcing한다.
    • Splash Theme
      • Theme을 구현하여 Manifest파일에 등록하여 사용한다.

스플래시 화면 작동 방식

  • 사용자가 앱을 실행할 때 크게 세 가지 상태로 앱이 구동된다.
    • cold-start
      • 앱 프로세스가 실행되지 않은 상태
    • warm-start
      • 활동이 만들어지지 않은 상태
    • hot-start
      • 이미 활동까지 만들어지고, 모든 리소스가 로드된 상태
  • 스플래시 화면은 앞서 프로그램이 로딩되고 있음을 알릴 때 이용되므로
    • 기본적으로 hot-start 상태에서 등장하게 된다.

Splash Theme 구현

img

  • Android 공식문서에서 권장하고 있으며, Android 12부터 전용 라이브러리를 제공하며 적극 권장하고 있다.
    • implementation("androidx.core:core-splashscreen:${Versions.Ui.Splash}")
  • Splash 화면은 크게 위 4가지 + 1가지 5가지로 구분지어서 설정할 수 있다.
    1. App Icon
      • 메인으로 보여줄 Icon
    2. Icon Background color
    3. Mask 처리된 Adativt Icon
    4. Splash Scree Background color
    5. Branding Image
      • 위 이미지에는 나오지 않았으나 이를 설정해두면 아래 이미지의 Google 마크를 보여줄 수 있다. youtube

App Icon

  • Application에 등록된 Icon을 보여준다.
  • 설정
    • <item name="android:windowSplashScreenAnimatedIcon">@drawable/...</item>
  • 이는 위와 같이 설정할 수 있지만, Manifest 설정 파일에 등록된 Icon으로도 보여줄 수 있다.
      <application
          android:allowBackup="true"
          android:icon="@mipmap/ic_flo_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_flo_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/Theme.FLO">
          ...
      </application>
    
  • 또한 이와 관련한 Icon Size도 규정되어 있는데, 이는 공식 문서를 참고하길 바란다.

    Icon Background Color

  • Icon 배경 색상을 설정
  • Color 값만 넣을 수 있다.
  • 설정
    • <item name="android:windowSplashScreenIconBackgroundColor">@color/...</item>

Splash Screen Background color

  • 배경 색상을 설정
  • Color 값만 넣을 수 있다.
  • 설정
    • <item name="android:windowSplashScreenBackground">@color/...</item>

Branding Image

  • 하단 이미지를 삽입할 수 있다.
  • 설정
    • <item name="android:windowSplashScreenBrandingImage">@drawable/...</item>


UMCSplashAndroid Share Tweet +1