Skip to content

Commit

Permalink
添加启动页优化启动白屏,图标来自iconfont
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoRanLiu3119 committed Jan 2, 2024
1 parent f104c13 commit 2442f0b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 7 deletions.
18 changes: 11 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity
android:name=".ui.activity.SplashActivity"
android:exported="true"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.activity.SubscriptionActivity"
android:configChanges="orientation|screenSize"
Expand All @@ -55,13 +65,7 @@
<activity
android:name=".ui.activity.MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden|uiMode"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
android:exported="true"/>
<activity
android:name=".ui.activity.LiveActivity"
android:launchMode="singleTop"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.tvbox.osc.ui.activity

import android.content.Intent
import android.os.Handler
import com.github.tvbox.osc.base.BaseVbActivity
import com.github.tvbox.osc.databinding.ActivitySplashBinding

class SplashActivity : BaseVbActivity<ActivitySplashBinding>() {
override fun init() {
mBinding.root.postDelayed({
startActivity(Intent(this@SplashActivity, MainActivity::class.java))
finish()
},500)
}
}
Binary file added app/src/main/res/drawable-xxhdpi/iv_splash.webp
Binary file not shown.
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/bg_splash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/white" />
</shape>
</item>
<item >
<bitmap
android:gravity="center"
android:src="@drawable/iv_splash" />
</item>
</layer-list>
8 changes: 8 additions & 0 deletions app/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

</RelativeLayout>
5 changes: 5 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<item name="android:windowBackground">@color/windowBackground</item>
</style>

<style name="SplashTheme" parent="AppTheme">
<item name="android:windowBackground">@drawable/bg_splash</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
</style>

<style name="AppTheme.NoActionBar">
<item name="android:windowActionBar">false</item>
Expand Down

0 comments on commit 2442f0b

Please sign in to comment.