Skip to content

Commit 2442f0b

Browse files
添加启动页优化启动白屏,图标来自iconfont
1 parent f104c13 commit 2442f0b

File tree

6 files changed

+52
-7
lines changed

6 files changed

+52
-7
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
android:requestLegacyExternalStorage="true"
3737
android:theme="@style/AppTheme"
3838
android:usesCleartextTraffic="true">
39+
<activity
40+
android:name=".ui.activity.SplashActivity"
41+
android:exported="true"
42+
android:theme="@style/SplashTheme">
43+
<intent-filter>
44+
<action android:name="android.intent.action.MAIN" />
45+
<action android:name="android.intent.action.VIEW" />
46+
<category android:name="android.intent.category.LAUNCHER" />
47+
</intent-filter>
48+
</activity>
3949
<activity
4050
android:name=".ui.activity.SubscriptionActivity"
4151
android:configChanges="orientation|screenSize"
@@ -55,13 +65,7 @@
5565
<activity
5666
android:name=".ui.activity.MainActivity"
5767
android:configChanges="orientation|screenSize|keyboardHidden|uiMode"
58-
android:exported="true">
59-
<intent-filter>
60-
<action android:name="android.intent.action.MAIN" />
61-
62-
<category android:name="android.intent.category.LAUNCHER" />
63-
</intent-filter>
64-
</activity>
68+
android:exported="true"/>
6569
<activity
6670
android:name=".ui.activity.LiveActivity"
6771
android:launchMode="singleTop"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.github.tvbox.osc.ui.activity
2+
3+
import android.content.Intent
4+
import android.os.Handler
5+
import com.github.tvbox.osc.base.BaseVbActivity
6+
import com.github.tvbox.osc.databinding.ActivitySplashBinding
7+
8+
class SplashActivity : BaseVbActivity<ActivitySplashBinding>() {
9+
override fun init() {
10+
mBinding.root.postDelayed({
11+
startActivity(Intent(this@SplashActivity, MainActivity::class.java))
12+
finish()
13+
},500)
14+
}
15+
}
9.24 KB
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item>
4+
<shape>
5+
<solid android:color="@color/white" />
6+
</shape>
7+
</item>
8+
<item >
9+
<bitmap
10+
android:gravity="center"
11+
android:src="@drawable/iv_splash" />
12+
</item>
13+
</layer-list>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent">
7+
8+
</RelativeLayout>

app/src/main/res/values/styles.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<item name="android:windowBackground">@color/windowBackground</item>
1111
</style>
1212

13+
<style name="SplashTheme" parent="AppTheme">
14+
<item name="android:windowBackground">@drawable/bg_splash</item>
15+
<item name="android:windowFullscreen">true</item>
16+
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
17+
</style>
1318

1419
<style name="AppTheme.NoActionBar">
1520
<item name="android:windowActionBar">false</item>

0 commit comments

Comments
 (0)