|
@@ -1,10 +1,11 @@
|
|
|
-package com.zaojiao.app.ui.home.main
|
|
|
+package com.zaojiao.app.feat.home.index
|
|
|
|
|
|
import androidx.compose.foundation.Image
|
|
|
import androidx.compose.foundation.background
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
+import androidx.compose.foundation.layout.RowScope
|
|
|
import androidx.compose.foundation.layout.fillMaxHeight
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
@@ -29,27 +30,28 @@ import androidx.compose.ui.text.font.FontWeight
|
|
|
import androidx.compose.ui.text.style.TextOverflow
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
-import com.zaojiao.app.R
|
|
|
+import com.zaojiao.app.feat.home.R
|
|
|
+import com.zaojiao.component.common.Spacer
|
|
|
|
|
|
@Composable
|
|
|
-fun HomeMainTopBar() {
|
|
|
+fun HomeIndexTopBar() {
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
- .padding(top = 24.dp, bottom = 22.dp)
|
|
|
+ .background(color = Color(0xFFFBFCFD))
|
|
|
+ .padding(top = 24.dp, bottom = 10.dp)
|
|
|
.statusBarsPadding()
|
|
|
.fillMaxWidth()
|
|
|
- .height(44.dp)
|
|
|
+ .height(44.dp),
|
|
|
+ verticalAlignment = Alignment.CenterVertically,
|
|
|
) {
|
|
|
- HomeMainTopBarUserInfo()
|
|
|
- Box(modifier = Modifier.weight(1f)) {
|
|
|
- HomeMainTopBarSearchBar()
|
|
|
- }
|
|
|
- HomeMainTopMainSignupButton()
|
|
|
+ HomeIndexTopBarUserInfo()
|
|
|
+ HomeIndexTopBarSearchBar()
|
|
|
+ HomeIndexTopBarSignupButton()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Composable
|
|
|
-fun HomeMainTopBarUserInfo() {
|
|
|
+fun HomeIndexTopBarUserInfo() {
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
.padding(start = 16.dp)
|
|
@@ -62,7 +64,7 @@ fun HomeMainTopBarUserInfo() {
|
|
|
verticalAlignment = Alignment.CenterVertically,
|
|
|
) {
|
|
|
Image(
|
|
|
- painter = painterResource(id = R.mipmap.ic_default_avatar),
|
|
|
+ painter = painterResource(id = R.mipmap.default_avatar),
|
|
|
contentDescription = "这是用户的头像",
|
|
|
modifier = Modifier
|
|
|
.clip(
|
|
@@ -101,9 +103,10 @@ fun HomeMainTopBarUserInfo() {
|
|
|
}
|
|
|
|
|
|
@Composable
|
|
|
-fun HomeMainTopBarSearchBar() {
|
|
|
+fun RowScope.HomeIndexTopBarSearchBar() {
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
+ .weight(1f)
|
|
|
.padding(start = 12.dp, end = 12.dp)
|
|
|
.shadow(
|
|
|
elevation = 2.dp,
|
|
@@ -119,10 +122,11 @@ fun HomeMainTopBarSearchBar() {
|
|
|
verticalAlignment = Alignment.CenterVertically,
|
|
|
) {
|
|
|
Image(
|
|
|
- painter = painterResource(id = R.mipmap.ic_home_search),
|
|
|
+ painter = painterResource(id = R.mipmap.index_search),
|
|
|
contentDescription = "",
|
|
|
contentScale = ContentScale.Fit,
|
|
|
)
|
|
|
+ Spacer(width = 6.dp)
|
|
|
Text(
|
|
|
text = "逻辑狗",
|
|
|
style = TextStyle(
|
|
@@ -133,7 +137,7 @@ fun HomeMainTopBarSearchBar() {
|
|
|
modifier = Modifier.weight(1f),
|
|
|
)
|
|
|
Image(
|
|
|
- painter = painterResource(id = R.mipmap.ic_home_qrcode),
|
|
|
+ painter = painterResource(id = R.mipmap.index_qrcode),
|
|
|
contentDescription = "",
|
|
|
contentScale = ContentScale.Fit,
|
|
|
)
|
|
@@ -141,19 +145,13 @@ fun HomeMainTopBarSearchBar() {
|
|
|
}
|
|
|
|
|
|
@Composable
|
|
|
-fun HomeMainTopMainSignupButton() {
|
|
|
+fun HomeIndexTopBarSignupButton() {
|
|
|
Image(
|
|
|
- painter = painterResource(id = R.mipmap.ic_default_avatar),
|
|
|
- contentDescription = "这是用户的头像",
|
|
|
+ painter = painterResource(id = R.mipmap.index_signup),
|
|
|
+ contentDescription = "签到",
|
|
|
modifier = Modifier
|
|
|
.padding(end = 16.dp)
|
|
|
- .clip(shape = RoundedCornerShape(50))
|
|
|
.size(44.dp),
|
|
|
contentScale = ContentScale.Crop,
|
|
|
)
|
|
|
-}
|
|
|
-
|
|
|
-@Composable
|
|
|
-fun HomeMainSlider() {
|
|
|
-
|
|
|
}
|