diff --git a/android/app/src/main/java/com/lovable/zellyfinance/MainActivity.java b/android/app/src/main/java/com/lovable/zellyfinance/MainActivity.java
index 05e0ffc..1d0c0bb 100644
--- a/android/app/src/main/java/com/lovable/zellyfinance/MainActivity.java
+++ b/android/app/src/main/java/com/lovable/zellyfinance/MainActivity.java
@@ -11,7 +11,7 @@ public class MainActivity extends BridgeActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // 스플래시 화면 처리를 위한 추가 초기화 코드
+ // Capacitor 스플래시 화면 플러그인 등록
registerPlugin(SplashScreenPlugin.class);
}
}
diff --git a/android/app/src/main/res/drawable-land-hdpi/splash.png b/android/app/src/main/res/drawable-land-hdpi/splash.png
index e31573b..fd45726 100644
Binary files a/android/app/src/main/res/drawable-land-hdpi/splash.png and b/android/app/src/main/res/drawable-land-hdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-land-mdpi/splash.png b/android/app/src/main/res/drawable-land-mdpi/splash.png
index f7a6492..fd45726 100644
Binary files a/android/app/src/main/res/drawable-land-mdpi/splash.png and b/android/app/src/main/res/drawable-land-mdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-land-xhdpi/splash.png b/android/app/src/main/res/drawable-land-xhdpi/splash.png
index 8077255..fd45726 100644
Binary files a/android/app/src/main/res/drawable-land-xhdpi/splash.png and b/android/app/src/main/res/drawable-land-xhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxhdpi/splash.png
index 14c6c8f..fd45726 100644
Binary files a/android/app/src/main/res/drawable-land-xxhdpi/splash.png and b/android/app/src/main/res/drawable-land-xxhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png
index 244ca25..fd45726 100644
Binary files a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-port-hdpi/splash.png b/android/app/src/main/res/drawable-port-hdpi/splash.png
index 74faaa5..fd45726 100644
Binary files a/android/app/src/main/res/drawable-port-hdpi/splash.png and b/android/app/src/main/res/drawable-port-hdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-port-mdpi/splash.png b/android/app/src/main/res/drawable-port-mdpi/splash.png
index e944f4a..fd45726 100644
Binary files a/android/app/src/main/res/drawable-port-mdpi/splash.png and b/android/app/src/main/res/drawable-port-mdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-port-xhdpi/splash.png b/android/app/src/main/res/drawable-port-xhdpi/splash.png
index 564a82f..fd45726 100644
Binary files a/android/app/src/main/res/drawable-port-xhdpi/splash.png and b/android/app/src/main/res/drawable-port-xhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxhdpi/splash.png
index bfabe68..fd45726 100644
Binary files a/android/app/src/main/res/drawable-port-xxhdpi/splash.png and b/android/app/src/main/res/drawable-port-xxhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png
index 6929071..fd45726 100644
Binary files a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png and b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png differ
diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png
index f7a6492..fd45726 100644
Binary files a/android/app/src/main/res/drawable/splash.png and b/android/app/src/main/res/drawable/splash.png differ
diff --git a/android/app/src/main/res/drawable/splash_screen.xml b/android/app/src/main/res/drawable/splash_screen.xml
new file mode 100644
index 0000000..6bf87a2
--- /dev/null
+++ b/android/app/src/main/res/drawable/splash_screen.xml
@@ -0,0 +1,7 @@
+
+
+
+ -
+
+
+
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
index 596e912..8414d24 100644
--- a/android/app/src/main/res/values/styles.xml
+++ b/android/app/src/main/res/values/styles.xml
@@ -17,8 +17,10 @@
diff --git a/capacitor.config.ts b/capacitor.config.ts
index b6ea95f..342cdce 100644
--- a/capacitor.config.ts
+++ b/capacitor.config.ts
@@ -11,10 +11,14 @@ const config: CapacitorConfig = {
},
plugins: {
SplashScreen: {
- launchShowDuration: 2000,
- backgroundColor: "#f2f2f2",
- androidScaleType: "CENTER_CROP",
- showSpinner: false
+ launchShowDuration: 1000,
+ launchAutoHide: true,
+ androidSplashResourceName: "splash",
+ splashFullScreen: true,
+ splashImmersive: true,
+ showSpinner: false,
+ androidScaleType: "CENTER_INSIDE",
+ backgroundColor: "#FFFFFF"
},
Keyboard: {
resize: "body",
diff --git a/splash.png b/splash.png
new file mode 100644
index 0000000..fd45726
Binary files /dev/null and b/splash.png differ
diff --git a/src/App.tsx b/src/App.tsx
index 37b43ff..9c60889 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,6 +1,7 @@
import React, { useEffect } from 'react';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
+import { SplashScreen } from '@capacitor/splash-screen';
import './App.css';
import Login from './pages/Login';
import Register from './pages/Register';
@@ -20,8 +21,6 @@ import PaymentMethods from './pages/PaymentMethods';
import Settings from './pages/Settings';
import { BudgetProvider } from './contexts/BudgetContext';
import PrivateRoute from './components/auth/PrivateRoute';
-import { SplashScreen } from '@capacitor/splash-screen';
-
// 전역 오류 핸들러
const handleError = (error: any) => {
console.error('앱 오류 발생:', error);
@@ -73,12 +72,40 @@ class ErrorBoundary extends React.Component<
}
function App() {
- // 앱 시작 시 스플래시 화면 초기화
+ // 앱 로딩이 완료되었을 때 스플래시 화면을 숨김
useEffect(() => {
- // 스플래시 화면 표시 시간 설정 (3초)
- setTimeout(() => {
- SplashScreen.hide();
- }, 3000);
+ // 웹뷰 콘텐츠가 완전히 로드되었을 때만 스플래시 화면을 숨김
+ const onAppReady = async () => {
+ try {
+ // 1초 후에 스플래시 화면을 숨김 (콘텐츠가 완전히 로드될 시간 확보)
+ setTimeout(async () => {
+ try {
+ await SplashScreen.hide();
+ console.log('스플래시 화면 숨김 성공');
+ } catch (err) {
+ console.error('스플래시 화면 숨김 오류:', err);
+ }
+ }, 1000);
+ } catch (err) {
+ console.error('앱 준비 오류:', err);
+ }
+ };
+
+ // 앱 준비 함수 실행
+ onAppReady();
+
+ // 추가 보호장치: 페이지 로드 시 다시 실행
+ const handleLoad = () => {
+ setTimeout(() => {
+ SplashScreen.hide().catch(() => {});
+ }, 1000);
+ };
+
+ window.addEventListener('load', handleLoad);
+
+ return () => {
+ window.removeEventListener('load', handleLoad);
+ };
}, []);
return (