添加启动界面
@@ -43,7 +43,12 @@ import com.google.firebase.analytics.analytics
|
|||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
import com.aiosman.ravenow.ui.splash.SplashScreen
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
// Firebase Analytics
|
// Firebase Analytics
|
||||||
@@ -122,11 +127,22 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
|
var showSplash by remember { mutableStateOf(true) }
|
||||||
|
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
kotlinx.coroutines.delay(2000)
|
||||||
|
showSplash = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showSplash) {
|
||||||
|
SplashScreen()
|
||||||
|
} else {
|
||||||
CompositionLocalProvider(
|
CompositionLocalProvider(
|
||||||
LocalAppTheme provides AppState.appTheme
|
LocalAppTheme provides AppState.appTheme
|
||||||
) {
|
) {
|
||||||
CheckUpdateDialog()
|
CheckUpdateDialog()
|
||||||
Navigation(startDestination) { navController ->
|
Navigation(startDestination) { navController ->
|
||||||
|
|
||||||
// 处理带有 postId 的通知点击
|
// 处理带有 postId 的通知点击
|
||||||
val postId = intent.getStringExtra("POST_ID")
|
val postId = intent.getStringExtra("POST_ID")
|
||||||
var commentId = intent.getStringExtra("COMMENT_ID")
|
var commentId = intent.getStringExtra("COMMENT_ID")
|
||||||
@@ -179,17 +195,15 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
NewPostViewModel.asNewPostWithImageUris(imageUris!!.map { it.toString() })
|
NewPostViewModel.asNewPostWithImageUris(imageUris!!.map { it.toString() })
|
||||||
navController.navigate(NavigationRoute.NewPost.route)
|
navController.navigate(NavigationRoute.NewPost.route)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求通知权限
|
* 请求通知权限
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
package com.aiosman.ravenow.ui.splash
|
package com.aiosman.ravenow.ui.splash
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.material.Scaffold
|
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
@@ -22,38 +21,36 @@ import com.aiosman.ravenow.R
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SplashScreen() {
|
fun SplashScreen() {
|
||||||
Scaffold {
|
|
||||||
it
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize()
|
||||||
) {
|
) {
|
||||||
// to bottom
|
// 居中的图标
|
||||||
Box(
|
Image(
|
||||||
contentAlignment = Alignment.TopCenter,
|
painter = painterResource(id = R.mipmap.invalid_name),
|
||||||
modifier = Modifier.padding(top = 211.dp)
|
contentDescription = "App Logo",
|
||||||
) {
|
modifier = Modifier
|
||||||
|
.align(Alignment.Center)
|
||||||
|
.size(120.dp)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 底部文字
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
modifier = Modifier.fillMaxWidth()
|
verticalArrangement = Arrangement.Bottom,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(bottom = 80.dp)
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = R.mipmap.rider_pro_logo),
|
painterResource(id = R.mipmap.kp_p_img),
|
||||||
contentDescription = "Rave Now",
|
contentDescription = "",
|
||||||
modifier = Modifier
|
modifier = Modifier.size(85.dp, 25.dp)
|
||||||
.width(108.dp)
|
|
||||||
.height(45.dp)
|
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(32.dp))
|
Spacer(modifier = Modifier.padding(top = 16.dp))
|
||||||
Text(
|
Text(
|
||||||
"Rave Now".uppercase(),
|
stringResource(R.string.splash_title),
|
||||||
fontSize = 28.sp,
|
fontSize = 13.sp
|
||||||
fontWeight = FontWeight.Bold
|
|
||||||
)
|
)
|
||||||
Text("Your Night Starts Here".uppercase(), fontSize = 20.sp, fontWeight = FontWeight.W700)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
app/src/main/res/mipmap-hdpi/kp_bj_img.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
app/src/main/res/mipmap-hdpi/kp_logo_img.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
app/src/main/res/mipmap-hdpi/kp_p_img.png
Normal file
|
After Width: | Height: | Size: 852 B |
BIN
app/src/main/res/mipmap-mdpi/kp_bj_img.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/mipmap-mdpi/kp_logo_img.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/mipmap-mdpi/kp_p_img.png
Normal file
|
After Width: | Height: | Size: 599 B |
BIN
app/src/main/res/mipmap-xhdpi/kp_bj_img.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
app/src/main/res/mipmap-xhdpi/kp_logo_img.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/kp_p_img.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/kp_bj_img.png
Normal file
|
After Width: | Height: | Size: 374 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/kp_logo_img.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/kp_p_img.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/kp_bj_img.png
Normal file
|
After Width: | Height: | Size: 652 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/kp_logo_img.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/kp_p_img.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
@@ -18,4 +18,7 @@
|
|||||||
<string name="create_agent_auto">一言でAIを作成</string>
|
<string name="create_agent_auto">一言でAIを作成</string>
|
||||||
<string name="agent_name_hint_1">名前を付けて、あなただけの特別な存在にしましょう</string>
|
<string name="agent_name_hint_1">名前を付けて、あなただけの特別な存在にしましょう</string>
|
||||||
<string name="create_success">スマートボディの作成が完了しました!</string>
|
<string name="create_success">スマートボディの作成が完了しました!</string>
|
||||||
|
|
||||||
|
<!-- splash Page -->
|
||||||
|
<string name="splash_title">社交はA Iと人間に属する</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -210,4 +210,7 @@
|
|||||||
<string name="create_agent_auto">一句话创造Ai</string>
|
<string name="create_agent_auto">一句话创造Ai</string>
|
||||||
<string name="agent_name_hint_1">给它取个名字,让它成为独一无二的你</string>
|
<string name="agent_name_hint_1">给它取个名字,让它成为独一无二的你</string>
|
||||||
<string name="create_success">智能体创建完成!</string>
|
<string name="create_success">智能体创建完成!</string>
|
||||||
|
|
||||||
|
<!-- splash Page -->
|
||||||
|
<string name="splash_title">社 交 属 于 A I 和 人 类</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -206,4 +206,7 @@
|
|||||||
<string name="create_agent_auto">Create AI with One Sentence</string>
|
<string name="create_agent_auto">Create AI with One Sentence</string>
|
||||||
<string name="agent_name_hint_1">Give it a name to make it uniquely yours</string>
|
<string name="agent_name_hint_1">Give it a name to make it uniquely yours</string>
|
||||||
<string name="create_success">Agent creation completed!</string>
|
<string name="create_success">Agent creation completed!</string>
|
||||||
|
|
||||||
|
<!-- splash Page -->
|
||||||
|
<string name="splash_title">Social interaction belongs to AI and humans</string>
|
||||||
</resources>
|
</resources>
|
||||||