와챠의 우당탕탕 개발 기록장
[안드로이드] 스플래시 만들기 본문
반응형
1) drawbale에 splash.xml 추가
splash.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!--배경--> | |
<item android:drawable="@android:color/background_dark" /> | |
<!--서비스 로고--> | |
<item> | |
<bitmap | |
android:src="@drawable/clude" | |
android:gravity="center"/> | |
</item> | |
</layer-list> |
2) theme에 style 추가
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> | |
<item name="android:windowBackground">@drawable/splash</item> | |
</style> | |
</resources> |
3) SplashActivity.kt 추가
SplashActivity.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.min1 | |
import android.content.Intent | |
import android.os.Bundle | |
import androidx.appcompat.app.AppCompatActivity | |
// 스플래시 화면 | |
class SplashActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
// 로그인 액티비티로 이동 | |
val intent = Intent(this@SplashActivity, LoginActivity::class.java) | |
startActivity(intent) | |
finish() | |
} | |
} |
4) AndroidManifest 설정
<activity android:name=".SplashActivity"
android:theme="@style/SplashTheme">
AndroidManifest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.min1"> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application | |
android:name=".GlobalApplication" | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="true" | |
android:theme="@style/Theme.Min1"> | |
<activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<!-- Redirect URI: "kakao{NATIVE_APP_KEY}://oauth" --> | |
<data android:host="oauth" | |
android:scheme="kakao" /> | |
</intent-filter> | |
</activity> | |
<activity android:name=".SplashActivity" | |
android:theme="@style/SplashTheme"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> | |
<activity android:name=".MainActivity" /> | |
<activity android:name=".LoginActivity" /> | |
</application> | |
</manifest> |
아오 진짜...진짜....
하.... 파이팅!!!!!!!!!!!!!!
반응형
'코딩 일기장 > Android(Kotlin)' 카테고리의 다른 글
[안드로이드] 구글맵 api (1) (0) | 2021.05.21 |
---|---|
[안드로이드] 파이어베이스에 데이터 저장, 검색 (0) | 2021.05.15 |
[안드로이드] 하단 메뉴(BottomNavigationView) (0) | 2021.05.14 |
[안드로이드] 웹 크롤링(이미지) (2) | 2021.05.14 |
[안드로이드] 웹 크롤링 (0) | 2021.05.14 |