|
@@ -5,6 +5,7 @@ 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.fillMaxHeight
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
import androidx.compose.foundation.layout.padding
|
|
@@ -19,6 +20,7 @@ import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.draw.clip
|
|
|
+import androidx.compose.ui.draw.shadow
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
import androidx.compose.ui.layout.ContentScale
|
|
|
import androidx.compose.ui.res.painterResource
|
|
@@ -33,12 +35,15 @@ import com.zaojiao.app.R
|
|
|
fun HomeMainTopBar() {
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
- .fillMaxWidth()
|
|
|
+ .padding(top = 24.dp, bottom = 22.dp)
|
|
|
.statusBarsPadding()
|
|
|
- .padding(top = 25.dp, bottom = 22.dp)
|
|
|
+ .fillMaxWidth()
|
|
|
+ .height(44.dp)
|
|
|
) {
|
|
|
HomeMainTopBarUserInfo()
|
|
|
- HomeMainTopBarSearchBar()
|
|
|
+ Box(modifier = Modifier.weight(1f)) {
|
|
|
+ HomeMainTopBarSearchBar()
|
|
|
+ }
|
|
|
HomeMainTopMainSignupButton()
|
|
|
}
|
|
|
}
|
|
@@ -47,7 +52,7 @@ fun HomeMainTopBar() {
|
|
|
fun HomeMainTopBarUserInfo() {
|
|
|
Row(
|
|
|
modifier = Modifier
|
|
|
- .padding(start = 16.dp, end = 16.dp)
|
|
|
+ .padding(start = 16.dp)
|
|
|
.background(
|
|
|
color = Color(0x260B57C7),
|
|
|
shape = RoundedCornerShape(100.dp)
|
|
@@ -97,8 +102,41 @@ fun HomeMainTopBarUserInfo() {
|
|
|
|
|
|
@Composable
|
|
|
fun HomeMainTopBarSearchBar() {
|
|
|
- Box(
|
|
|
+ Row(
|
|
|
+ modifier = Modifier
|
|
|
+ .padding(start = 12.dp, end = 12.dp)
|
|
|
+ .shadow(
|
|
|
+ elevation = 2.dp,
|
|
|
+ shape = RoundedCornerShape(100.dp),
|
|
|
+ )
|
|
|
+ .background(
|
|
|
+ color = Color.White,
|
|
|
+ shape = RoundedCornerShape(100.dp),
|
|
|
+ )
|
|
|
+ .padding(start = 10.dp, end = 10.dp, top = 11.dp, bottom = 11.dp)
|
|
|
+ .fillMaxHeight()
|
|
|
+ .fillMaxWidth(),
|
|
|
+ verticalAlignment = Alignment.CenterVertically,
|
|
|
) {
|
|
|
+ Image(
|
|
|
+ painter = painterResource(id = R.mipmap.ic_home_search),
|
|
|
+ contentDescription = "",
|
|
|
+ contentScale = ContentScale.Fit,
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ text = "逻辑狗",
|
|
|
+ style = TextStyle(
|
|
|
+ color = Color(0xFFCECECE),
|
|
|
+ fontSize = 14.sp,
|
|
|
+ lineHeight = 14.sp,
|
|
|
+ ),
|
|
|
+ modifier = Modifier.weight(1f),
|
|
|
+ )
|
|
|
+ Image(
|
|
|
+ painter = painterResource(id = R.mipmap.ic_home_qrcode),
|
|
|
+ contentDescription = "",
|
|
|
+ contentScale = ContentScale.Fit,
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -108,10 +146,14 @@ fun HomeMainTopMainSignupButton() {
|
|
|
painter = painterResource(id = R.mipmap.ic_message),
|
|
|
contentDescription = "这是用户的头像",
|
|
|
modifier = Modifier
|
|
|
- .clip(
|
|
|
- shape = RoundedCornerShape(50),
|
|
|
- )
|
|
|
+ .padding(end = 16.dp)
|
|
|
+ .clip(shape = RoundedCornerShape(50))
|
|
|
.size(44.dp),
|
|
|
contentScale = ContentScale.Crop,
|
|
|
)
|
|
|
+}
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun HomeMainSlider() {
|
|
|
+
|
|
|
}
|