Skip to content

Commit a5b81f7

Browse files
committed
fix: Splash 관련 수정
- runBlocking 으로 스레드가 잠기던 문제가 수정됩니다 - SDK 31 미만에서는 SplashScreen 이 더 오래 노출되도록 합니다. (OS 에서 제공하는 SplashScreen 을 사용하지 않기때문)
1 parent 813d605 commit a5b81f7

26 files changed

Lines changed: 76 additions & 36 deletions

File tree

.idea/deploymentTargetSelector.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ android {
2828
}
2929

3030
dependencies {
31+
implementation(libs.androidx.core.splashscreen)
3132
implementation(libs.androidx.browser)
3233
implementation(libs.androidx.appcompat)
3334
implementation(libs.material)

app/src/main/ic_logo-playstore.png

-16 KB
Binary file not shown.

app/src/main/java/com/lanpet/app/MainActivity.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
package com.lanpet.app
22

3+
import android.animation.Animator
4+
import android.animation.AnimatorListenerAdapter
5+
import android.animation.ObjectAnimator
6+
import android.annotation.SuppressLint
7+
import android.graphics.Color
38
import android.os.Bundle
49
import androidx.activity.ComponentActivity
510
import androidx.activity.compose.setContent
611
import androidx.activity.enableEdgeToEdge
712
import androidx.compose.runtime.CompositionLocalProvider
13+
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
814
import com.lanpet.core.auth.AuthManager
915
import com.lanpet.core.auth.LocalAuthManager
1016
import com.lanpet.core.designsystem.theme.LanPetAppTheme
@@ -22,7 +28,11 @@ class MainActivity : ComponentActivity() {
2228
@Inject
2329
lateinit var coilManager: CoilManager
2430

31+
@SuppressLint("ObjectAnimatorBinding")
2532
override fun onCreate(savedInstanceState: Bundle?) {
33+
// 사용자가 설정한 SplashScreen 스타일을 기본으로 사용
34+
val splashScreen = installSplashScreen()
35+
2636
super.onCreate(savedInstanceState)
2737

2838
enableEdgeToEdge()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
33
<background android:drawable="@color/ic_logo_background"/>
4-
<foreground android:drawable="@drawable/ic_logo_foreground"/>
4+
<foreground android:drawable="@drawable/ic_logo"/>
55
</adaptive-icon>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
33
<background android:drawable="@color/ic_logo_background"/>
4-
<foreground android:drawable="@drawable/ic_logo_foreground"/>
4+
<foreground android:drawable="@drawable/ic_logo"/>
55
</adaptive-icon>

app/src/main/res/values-v31/themes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- Splash 화면의 백그라운드 컬러 지정 -->
66
<item name="android:windowSplashScreenBackground">@color/violet_600</item>
77
<!-- Splash 화면의 중앙에 위치할 아이콘 Drawable 지정 -->
8-
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_logo_foreground</item>
8+
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_logo</item>
99
<!-- Splash 화면 중앙의 아이콘 주변 Background Color 지정 -->
1010
<item name="android:windowSplashScreenIconBackgroundColor">@color/violet_600</item>
1111
<!-- &lt;!&ndash; Splash 화면이 나타나는 시간 지정 &ndash;&gt;-->

app/src/main/res/values/themes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33

4-
<style name="Theme.LanPetApp" parent="android:Theme.Material.Light.NoActionBar"></style>
4+
<style name="Theme.LanPetApp" parent="android:Theme.Material.Light.NoActionBar" />
55
</resources>
15.4 KB
Loading

app/src/main/res/drawable/ic_logo_foreground.xml renamed to core/common/src/main/res/drawable/ic_logo.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
android:height="108dp"
44
android:viewportWidth="68"
55
android:viewportHeight="33">
6-
<group android:scaleX="0.5304673"
7-
android:scaleY="0.25743267"
8-
android:translateX="16.131111"
9-
android:translateY="12.171317">
6+
<group android:scaleX="0.51813084"
7+
android:scaleY="0.25144586"
8+
android:translateX="16.546667"
9+
android:translateY="12.271985">
1010
<path
1111
android:pathData="M24.762,22.58V15.134H22.858V22.104C22.858,23.77 21.566,25.028 19.9,25.028C18.302,25.028 16.976,23.77 16.976,22.104V3.812C16.976,2.18 18.302,0.888 19.9,0.888C21.566,0.888 22.858,2.18 22.858,3.812V10.442H24.762V3.676C24.762,2.01 26.088,0.718 27.72,0.718C29.386,0.718 30.712,2.01 30.712,3.676V22.58C30.712,24.28 29.386,25.538 27.72,25.538C26.088,25.538 24.762,24.28 24.762,22.58ZM4.566,20.744H2.798C1.506,20.744 0.52,19.826 0.52,18.534V11.088C0.52,9.796 1.506,8.912 2.798,8.912H8.68V6.124H2.628C1.336,6.124 0.35,5.138 0.35,3.846C0.35,2.554 1.336,1.568 2.628,1.568H12.318C13.61,1.568 14.596,2.554 14.596,3.846V11.054C14.596,12.38 13.61,13.264 12.284,13.264H6.436V16.222C8.442,16.222 10.958,16.052 13.1,15.44C13.338,15.372 13.61,15.338 13.848,15.338C15.14,15.338 16.126,16.29 16.126,17.582C16.126,18.704 15.378,19.52 14.358,19.792C11.298,20.608 7.898,20.744 4.566,20.744ZM1.948,29.754V25.028C1.948,23.328 3.308,22.308 5.008,22.308C6.708,22.308 8.068,23.328 8.068,25.028V27.884H29.012C30.338,27.884 31.392,28.938 31.392,30.264C31.392,31.59 30.338,32.644 29.012,32.644H4.838C3.342,32.644 1.948,31.522 1.948,29.754Z"
1212
android:fillColor="#ffffff"/>

0 commit comments

Comments
 (0)