parent
3dfc94b180
commit
694cc2a2ce
|
|
@ -66,11 +66,14 @@
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
tools:replace="android:allowBackup,android:supportsRtl"
|
tools:replace="android:allowBackup,android:supportsRtl"
|
||||||
tools:targetApi="33">
|
tools:targetApi="33">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.img.rabbit.MainActivity"
|
android:name="com.img.rabbit.MainActivity"
|
||||||
android:theme="@style/SplashTheme"
|
android:theme="@style/SplashTheme"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask" >
|
||||||
<intent-filter tools:ignore="AppLinkUrlError">
|
<intent-filter tools:ignore="AppLinkUrlError">
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.img.rabbit
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
|
import android.content.pm.ActivityInfo
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
|
|
@ -96,13 +97,16 @@ import kotlin.system.exitProcess
|
||||||
class MainActivity : ComponentActivity(), LoadingCallback {
|
class MainActivity : ComponentActivity(), LoadingCallback {
|
||||||
private lateinit var generalViewModel: GeneralViewModel
|
private lateinit var generalViewModel: GeneralViewModel
|
||||||
@OptIn(DelicateCoroutinesApi::class, ExperimentalPermissionsApi::class)
|
@OptIn(DelicateCoroutinesApi::class, ExperimentalPermissionsApi::class)
|
||||||
@SuppressLint("UnrememberedMutableState", "CoroutineCreationDuringComposition")
|
@SuppressLint("UnrememberedMutableState", "CoroutineCreationDuringComposition",
|
||||||
|
"SourceLockedOrientationActivity"
|
||||||
|
)
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
val splashScreen = installSplashScreen()
|
val splashScreen = installSplashScreen()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
// 启用Edge-to-Edge模式(沉浸模式)
|
// 启用Edge-to-Edge模式(沉浸模式)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
|
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
var showSplash by remember { mutableStateOf(false) }
|
var showSplash by remember { mutableStateOf(false) }
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,9 @@ import kotlinx.coroutines.launch
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import kotlin.collections.chunked
|
import kotlin.collections.chunked
|
||||||
|
|
||||||
@SuppressLint("UnrememberedMutableState", "MutableCollectionMutableState")
|
@SuppressLint("UnrememberedMutableState", "MutableCollectionMutableState",
|
||||||
|
"SourceLockedOrientationActivity"
|
||||||
|
)
|
||||||
@Composable
|
@Composable
|
||||||
fun HomeScreen(
|
fun HomeScreen(
|
||||||
navController: NavHostController,
|
navController: NavHostController,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue