更改部分 UI 下的状态栏表现
This commit is contained in:
@@ -30,11 +30,15 @@ import androidx.compose.ui.unit.sp
|
||||
@Preview
|
||||
@Composable
|
||||
fun CommentsScreen() {
|
||||
StatusBarMaskLayout(
|
||||
darkIcons = true,
|
||||
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(color = Color(0xFFFFFFFF))
|
||||
.padding(16.dp)
|
||||
.padding(horizontal = 16.dp)
|
||||
) {
|
||||
NoticeScreenHeader("COMMENTS")
|
||||
Spacer(modifier = Modifier.height(28.dp))
|
||||
@@ -48,6 +52,8 @@ fun CommentsScreen() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -27,11 +27,15 @@ import androidx.compose.ui.unit.sp
|
||||
@Preview
|
||||
@Composable
|
||||
fun LikePage() {
|
||||
StatusBarMaskLayout(
|
||||
darkIcons = true,
|
||||
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(color = Color(0xFFFFFFFF))
|
||||
.padding(16.dp)
|
||||
.padding(horizontal = 16.dp)
|
||||
) {
|
||||
NoticeScreenHeader("LIKES")
|
||||
Spacer(modifier = Modifier.height(28.dp))
|
||||
@@ -46,6 +50,8 @@ fun LikePage() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class MainActivity : ComponentActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
if (!Places.isInitialized()) {
|
||||
Places.initialize(applicationContext,"AIzaSyDpgLDH1-SECw_pdjJq_msynq1XrxwgKVI")
|
||||
Places.initialize(applicationContext, "AIzaSyDpgLDH1-SECw_pdjJq_msynq1XrxwgKVI")
|
||||
}
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
@@ -142,32 +142,19 @@ fun NavigationController(navController: NavHostController) {
|
||||
}
|
||||
}
|
||||
composable(route = "Comments") {
|
||||
Box(
|
||||
modifier = Modifier.padding(navigationBarHeight)
|
||||
) {
|
||||
CommentsScreen()
|
||||
}
|
||||
}
|
||||
composable(route = "Likes") {
|
||||
Box(
|
||||
modifier = Modifier.padding(navigationBarHeight)
|
||||
) {
|
||||
LikePage()
|
||||
}
|
||||
}
|
||||
composable(route = "Followers") {
|
||||
Box(
|
||||
modifier = Modifier.padding()
|
||||
) {
|
||||
|
||||
FollowerPage()
|
||||
}
|
||||
}
|
||||
composable(route = "NewPost") {
|
||||
Box(
|
||||
modifier = Modifier.padding(navigationBarHeight, top = 64.dp)
|
||||
) {
|
||||
|
||||
NewPostScreen()
|
||||
}
|
||||
|
||||
}
|
||||
composable(route = "EditModification") {
|
||||
Box(
|
||||
|
||||
@@ -34,6 +34,7 @@ import androidx.compose.ui.unit.sp
|
||||
@Composable
|
||||
fun NotificationsScreen() {
|
||||
val navController = LocalNavController.current
|
||||
StatusBarMaskLayout(darkIcons = true) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
@@ -90,6 +91,8 @@ fun NotificationsScreen() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -48,6 +48,9 @@ import coil.compose.AsyncImage
|
||||
@Composable
|
||||
fun NewPostScreen() {
|
||||
val model = NewPostViewModel
|
||||
StatusBarMaskLayout(
|
||||
darkIcons = true,
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
@@ -59,6 +62,8 @@ fun NewPostScreen() {
|
||||
AddImageGrid()
|
||||
AdditionalPostItem()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.aiosman.riderpro
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.asPaddingValues
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.systemBars
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -29,6 +32,7 @@ fun StatusBarMask(darkIcons: Boolean = true) {
|
||||
fun StatusBarMaskLayout(
|
||||
modifier: Modifier = Modifier,
|
||||
darkIcons: Boolean = true,
|
||||
maskBoxBackgroundColor: Color = Color.Transparent,
|
||||
content: @Composable ColumnScope.() -> Unit
|
||||
) {
|
||||
val paddingValues = WindowInsets.systemBars.asPaddingValues()
|
||||
@@ -39,7 +43,14 @@ fun StatusBarMaskLayout(
|
||||
Column(
|
||||
modifier = modifier
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(paddingValues.calculateTopPadding()))
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.height(paddingValues.calculateTopPadding())
|
||||
.fillMaxWidth()
|
||||
.background(maskBoxBackgroundColor)
|
||||
) {
|
||||
|
||||
}
|
||||
content()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user