Fix: 修复双启动页问题 - 系统启动窗口显示 appstore.png
Build Debug / Build Android Debug APK (push) Successful in 5m19s
Build iOS / Build iOS IPA (push) Successful in 12m21s
Build UUVPN / Build Android APK (push) Has been skipped
Build UUVPN / Build iOS IPA (push) Has been skipped
Build UUVPN / Create GitHub Release (push) Has been skipped
Build UUVPN / Send Notification (push) Successful in 0s
Build Debug / Build iOS Debug App (push) Has been cancelled

- 创建 SplashTheme,windowBackground 设为 appstore.png 居中白底

- 创建 values-v31/themes.xml 适配 Android 12+ Splash Screen API

- MainActivity 应用 SplashTheme,BaseActivity.onCreate 切换回 BootstrapTheme

- 移除 MainActivity 中 ActivitySplashBinding 第二启动页
This commit is contained in:
2026-07-07 13:22:15 +08:00
parent b3057a72bb
commit 307f3c454a
7 changed files with 32 additions and 14 deletions
@@ -49,7 +49,8 @@
android:configChanges="uiMode" android:configChanges="uiMode"
android:exported="true" android:exported="true"
android:label="@string/launch_name" android:label="@string/launch_name"
android:launchMode="singleTop" > android:launchMode="singleTop"
android:theme="@style/SplashTheme" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -84,6 +84,7 @@ abstract class BaseActivity<D : Design<*>> : AppCompatActivity(),
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.BootstrapTheme)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
applyDayNight() applyDayNight()
@@ -1,7 +1,5 @@
package com.github.kr328.clash package com.github.kr328.clash
import android.os.Handler
import android.os.Looper
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.PopupMenu
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
@@ -26,7 +24,6 @@ import com.github.kr328.clash.design.PreferenceLiveData
import com.github.kr328.clash.design.PreferenceManager import com.github.kr328.clash.design.PreferenceManager
import com.github.kr328.clash.design.R import com.github.kr328.clash.design.R
import com.github.kr328.clash.design.component.ProxyMenu import com.github.kr328.clash.design.component.ProxyMenu
import com.github.kr328.clash.design.databinding.ActivitySplashBinding
import com.github.kr328.clash.design.dialog.requestModelTextInput import com.github.kr328.clash.design.dialog.requestModelTextInput
import com.github.kr328.clash.design.dialog.withModelProgressBar import com.github.kr328.clash.design.dialog.withModelProgressBar
import com.github.kr328.clash.design.network.APIGlobalObject import com.github.kr328.clash.design.network.APIGlobalObject
@@ -280,15 +277,8 @@ class MainActivity : BaseActivity<MainDesign>() {
}else{ }else{
val binding = ActivitySplashBinding
.inflate(this.layoutInflater, this.root, false)
setContentView(binding.root)
Handler(Looper.getMainLooper()).postDelayed({
startActivity(LoginActivity::class.intent) startActivity(LoginActivity::class.intent)
finish()
}, 1000) // Simulating a network delay
} }
} }
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/white" />
<item>
<bitmap
android:src="@drawable/appstore"
android:gravity="center" />
</item>
</layer-list>
@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="BootstrapTheme" parent="AppThemeDark" /> <style name="BootstrapTheme" parent="AppThemeDark" />
<style name="SplashTheme" parent="BootstrapTheme">
<item name="android:windowBackground">@drawable/splash_background</item>
</style>
</resources> </resources>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="BootstrapTheme">
<item name="android:windowBackground">@drawable/splash_background</item>
<item name="android:windowSplashScreenBackground">@color/white</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/appstore</item>
<item name="android:windowSplashScreenIconBackgroundColor">@color/white</item>
</style>
</resources>
@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="BootstrapTheme" parent="AppThemeLight" /> <style name="BootstrapTheme" parent="AppThemeLight" />
<style name="SplashTheme" parent="BootstrapTheme">
<item name="android:windowBackground">@drawable/splash_background</item>
</style>
</resources> </resources>