作者 zhangji

增加闪屏页面

... ... @@ -54,7 +54,8 @@
<activity
android:name=".ui.login.AccountLoginActivity"
android:theme="@style/Theme.SecurityTrainMaster.Launcher"
android:name=".ui.SplashActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
... ... @@ -164,6 +165,7 @@
<activity android:name=".ui.mine.activity.ServiceActivity" />
<activity android:name=".ui.home.activity.VerifyCameraActivity"/>
<activity android:name=".ui.home.activity.VerifyCameraCompleteActivity"/>
<activity android:name=".ui.login.AccountLoginActivity" />
</application>
... ...
package com.br_technology.securitytrain_master.ui
import android.content.Intent
import android.os.Build
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.br_technology.securitytrain_master.ui.login.AccountLoginActivity
import com.gyf.immersionbar.ImmersionBar
import io.reactivex.rxjava3.core.Observable
import java.util.concurrent.TimeUnit
/**
* Time: 7/26/2021 10:11
* Author: Captain
* Description: 初见时你很迷人
*/
class SplashActivity {
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
ImmersionBar.with(this).navigationBarColor(android.R.color.transparent).init()
}
super.onCreate(savedInstanceState)
Observable.timer(1, TimeUnit.SECONDS)
.subscribe {
val intent = Intent(this, AccountLoginActivity::class.java)
startActivity(intent)
finish()
}
}
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<item>
<bitmap android:src="@mipmap/launcher" />
</item>
</layer-list>
\ No newline at end of file
... ...
... ... @@ -13,4 +13,6 @@
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
... ...
... ... @@ -13,4 +13,19 @@
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.SecurityTrainMaster.Launcher">
<item name="colorPrimaryVariant">@android:color/transparent</item>
<!--无窗口状态栏-->
<item name="windowActionBar">false</item>
<!-- &lt;!&ndash;无标题&ndash;&gt;-->
<!-- <item name="android:windowNoTitle">true</item>-->
<!-- &lt;!&ndash;无标题&ndash;&gt;-->
<!-- <item name="windowNoTitle">true</item>-->
<!-- &lt;!&ndash;无窗口半透明导航&ndash;&gt;-->
<item name="android:windowTranslucentNavigation">false</item>
<!-- &lt;!&ndash;窗口半透明状态&ndash;&gt;-->
<item name="android:windowTranslucentStatus">false</item>
<item name="android:background">@drawable/launcher</item>
</style>
</resources>
\ No newline at end of file
... ...