스플래시 화면 기능 추가 및 개선
This commit is contained in:
@@ -10,6 +10,7 @@ android {
|
|||||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':capacitor-keyboard')
|
implementation project(':capacitor-keyboard')
|
||||||
|
implementation project(':capacitor-splash-screen')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.lovable.zellyfinance;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import com.getcapacitor.BridgeActivity;
|
import com.getcapacitor.BridgeActivity;
|
||||||
import com.getcapacitor.Plugin;
|
import com.getcapacitor.Plugin;
|
||||||
|
import com.capacitorjs.plugins.splashscreen.SplashScreenPlugin;
|
||||||
|
|
||||||
public class MainActivity extends BridgeActivity {
|
public class MainActivity extends BridgeActivity {
|
||||||
@Override
|
@Override
|
||||||
@@ -11,6 +12,6 @@ public class MainActivity extends BridgeActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
// 스플래시 화면 처리를 위한 추가 초기화 코드
|
// 스플래시 화면 처리를 위한 추가 초기화 코드
|
||||||
registerPlugin(com.capacitorjs.plugins.splashscreen.SplashScreenPlugin.class);
|
registerPlugin(SplashScreenPlugin.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
@@ -17,8 +16,9 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
|
||||||
<item name="android:background">@drawable/splash</item>
|
<item name="android:background">@drawable/splash</item>
|
||||||
<item name="android:statusBarColor">@color/ic_launcher_background</item>
|
<item name="android:statusBarColor">@color/ic_launcher_background</item>
|
||||||
|
<item name="android:windowFullscreen">true</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -4,3 +4,6 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
|
|||||||
|
|
||||||
include ':capacitor-keyboard'
|
include ':capacitor-keyboard'
|
||||||
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
|
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
|
||||||
|
|
||||||
|
include ':capacitor-splash-screen'
|
||||||
|
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')
|
||||||
|
|||||||
11
src/App.tsx
11
src/App.tsx
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
|
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import Login from './pages/Login';
|
import Login from './pages/Login';
|
||||||
@@ -20,6 +20,7 @@ import PaymentMethods from './pages/PaymentMethods';
|
|||||||
import Settings from './pages/Settings';
|
import Settings from './pages/Settings';
|
||||||
import { BudgetProvider } from './contexts/BudgetContext';
|
import { BudgetProvider } from './contexts/BudgetContext';
|
||||||
import PrivateRoute from './components/auth/PrivateRoute';
|
import PrivateRoute from './components/auth/PrivateRoute';
|
||||||
|
import { SplashScreen } from '@capacitor/splash-screen';
|
||||||
|
|
||||||
// 전역 오류 핸들러
|
// 전역 오류 핸들러
|
||||||
const handleError = (error: any) => {
|
const handleError = (error: any) => {
|
||||||
@@ -72,6 +73,14 @@ class ErrorBoundary extends React.Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
// 앱 시작 시 스플래시 화면 초기화
|
||||||
|
useEffect(() => {
|
||||||
|
// 스플래시 화면 표시 시간 설정 (3초)
|
||||||
|
setTimeout(() => {
|
||||||
|
SplashScreen.hide();
|
||||||
|
}, 3000);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<AuthContextWrapper>
|
<AuthContextWrapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user