Skip to content

Commit

Permalink
[nunu/#18] feat: Splash Activity 구현
Browse files Browse the repository at this point in the history
- Splash Activity 추가
- AndroidManifest.xml 수정
- themes.xml 수정
  • Loading branch information
Ssamssamukja committed May 7, 2024
1 parent 918e3be commit f6276d8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
8 changes: 5 additions & 3 deletions UMC_6th/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
android:supportsRtl="true"
android:theme="@style/Theme.UMC_6th"
tools:targetApi="31">
<activity
android:name=".MainActivity"
<activity android:name=".SplashActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true">
</activity>
<activity
android:name=".SongActivity"
android:exported="true"
Expand Down
22 changes: 22 additions & 0 deletions UMC_6th/app/src/main/java/com/example/umc_6th/SplashActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.example.umc_6th

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.umc_6th.databinding.ActivitySplashBinding

class SplashActivity :AppCompatActivity() {
private lateinit var binding : ActivitySplashBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivitySplashBinding.inflate(layoutInflater)
setContentView(binding.root)

android.os.Handler().postDelayed({
startActivity(Intent(this, MainActivity::class.java))
finish()
overridePendingTransition(0, 0)
}, 2000)
}
}
14 changes: 14 additions & 0 deletions UMC_6th/app/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:background="@color/white">

<ImageView
android:id="@+id/imageView"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ic_flo_logo" />
</RelativeLayout>
7 changes: 6 additions & 1 deletion UMC_6th/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<style name="Base.Theme.UMC_6th" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->

</style>

<style name="Theme.UMC_6th" parent="Base.Theme.UMC_6th" />
<style name="Theme.UMC_6th" parent="Base.Theme.UMC_6th">
<item name="android:windowDisablePreview">true</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>

0 comments on commit f6276d8

Please sign in to comment.