2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="1.9.0" />
|
<option name="version" value="1.9.10" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -79,7 +79,7 @@ fun MomentsList() {
|
|||||||
// center the tabs
|
// center the tabs
|
||||||
horizontalArrangement = Arrangement.Start,
|
horizontalArrangement = Arrangement.Start,
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {//探索tab
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
@@ -108,38 +108,8 @@ fun MomentsList() {
|
|||||||
.width(34.dp)
|
.width(34.dp)
|
||||||
.height(4.dp)
|
.height(4.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
|
||||||
Spacer(modifier = Modifier.width(16.dp))
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.noRippleClickable {
|
|
||||||
scope.launch {
|
|
||||||
pagerState.animateScrollToPage(1)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
verticalArrangement = Arrangement.Center,
|
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(R.string.index_dynamic),
|
|
||||||
fontSize = 16.sp,
|
|
||||||
color = if (pagerState.currentPage == 1) AppColors.text else AppColors.nonActiveText,
|
|
||||||
fontWeight = FontWeight.W600)
|
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
|
||||||
|
|
||||||
Image(
|
|
||||||
painter = painterResource(
|
|
||||||
if (pagerState.currentPage == 1) R.mipmap.tab_indicator_selected
|
|
||||||
else R.drawable.tab_indicator_unselected
|
|
||||||
),
|
|
||||||
contentDescription = "tab indicator",
|
|
||||||
modifier = Modifier
|
|
||||||
.width(34.dp)
|
|
||||||
.height(4.dp)
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//“关注”tab
|
||||||
Spacer(modifier = Modifier.width(16.dp))
|
Spacer(modifier = Modifier.width(16.dp))
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ import androidx.compose.ui.unit.sp
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.draw.blur
|
import androidx.compose.ui.draw.blur
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
|
||||||
import com.aiosman.ravenow.ui.composables.CustomAsyncImage
|
import com.aiosman.ravenow.ui.composables.CustomAsyncImage
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import com.aiosman.ravenow.AppStore
|
import com.aiosman.ravenow.AppStore
|
||||||
@@ -233,9 +232,9 @@ fun Explore() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AgentPage(agentItems: List<AgentItem>, page: Int, modifier: Modifier = Modifier) {
|
fun AgentPage(agentItems: List<AgentItem>, page: Int) {
|
||||||
Column(
|
Column(
|
||||||
modifier = modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(horizontal = 0.dp)
|
.padding(horizontal = 0.dp)
|
||||||
) {
|
) {
|
||||||
@@ -269,27 +268,11 @@ fun Explore() {
|
|||||||
) {
|
) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize()
|
||||||
contentPadding = androidx.compose.foundation.layout.PaddingValues(horizontal = 4.dp),
|
|
||||||
pageSpacing = 0.dp
|
|
||||||
) { page ->
|
) { page ->
|
||||||
// 计算当前页面的偏移量
|
|
||||||
val pageOffset = (
|
|
||||||
(pagerState.currentPage - page) + pagerState
|
|
||||||
.currentPageOffsetFraction
|
|
||||||
).coerceIn(-1f, 1f)
|
|
||||||
|
|
||||||
// 根据偏移量计算缩放比例
|
|
||||||
val scale = 1f - (0.1f * kotlin.math.abs(pageOffset))
|
|
||||||
|
|
||||||
AgentPage(
|
AgentPage(
|
||||||
agentItems = agentItems.drop(page * itemsPerPage).take(itemsPerPage),
|
agentItems = agentItems.drop(page * itemsPerPage).take(itemsPerPage),
|
||||||
page = page,
|
page = page
|
||||||
modifier = Modifier
|
|
||||||
.graphicsLayer {
|
|
||||||
scaleX = scale
|
|
||||||
scaleY = scale
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -427,12 +410,12 @@ fun Explore() {
|
|||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BannerCard(bannerItem: BannerItem, modifier: Modifier = Modifier) {
|
fun BannerCard(bannerItem: BannerItem) {
|
||||||
val AppColors = LocalAppTheme.current
|
val AppColors = LocalAppTheme.current
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
Card(
|
Card(
|
||||||
modifier = modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(horizontal = 0.dp),
|
.padding(horizontal = 0.dp),
|
||||||
shape = RoundedCornerShape(20.dp),
|
shape = RoundedCornerShape(20.dp),
|
||||||
@@ -612,15 +595,15 @@ fun Explore() {
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
// 第一块区域
|
// 可以添加更多不同高度的内容项
|
||||||
item {
|
item {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(vertical = 6.dp),
|
.padding(vertical = 6.dp),
|
||||||
horizontalArrangement = androidx.compose.foundation.layout.Arrangement.SpaceBetween
|
horizontalArrangement = androidx.compose.foundation.layout.Arrangement.SpaceEvenly
|
||||||
) {
|
) {
|
||||||
// 第一个 - 靠左显示
|
// 第一个
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable {
|
.clickable {
|
||||||
@@ -650,11 +633,6 @@ fun Explore() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 中间两个 - 平均分布
|
|
||||||
Row(
|
|
||||||
modifier = Modifier.weight(1f),
|
|
||||||
horizontalArrangement = androidx.compose.foundation.layout.Arrangement.SpaceEvenly
|
|
||||||
) {
|
|
||||||
// 第二个
|
// 第二个
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -716,9 +694,8 @@ fun Explore() {
|
|||||||
fontWeight = androidx.compose.ui.text.font.FontWeight.W500
|
fontWeight = androidx.compose.ui.text.font.FontWeight.W500
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 第四个 - 靠右显示
|
// 第四个
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
@@ -790,28 +767,10 @@ fun BannerSection(bannerItems: List<BannerItem>) {
|
|||||||
) {
|
) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize()
|
||||||
contentPadding = androidx.compose.foundation.layout.PaddingValues(horizontal = 4.dp),
|
|
||||||
) { page ->
|
) { page ->
|
||||||
val bannerItem = bannerItems[page]
|
val bannerItem = bannerItems[page]
|
||||||
|
BannerCard(bannerItem = bannerItem)
|
||||||
// 计算当前页面的偏移量
|
|
||||||
val pageOffset = (
|
|
||||||
(pagerState.currentPage - page) + pagerState
|
|
||||||
.currentPageOffsetFraction
|
|
||||||
).coerceIn(-1f, 1f)
|
|
||||||
|
|
||||||
// 根据偏移量计算缩放比例
|
|
||||||
val scale = 1f - (0.1f * kotlin.math.abs(pageOffset))
|
|
||||||
|
|
||||||
BannerCard(
|
|
||||||
bannerItem = bannerItem,
|
|
||||||
modifier = Modifier
|
|
||||||
.graphicsLayer {
|
|
||||||
scaleX = scale
|
|
||||||
scaleY = scale
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,7 +807,7 @@ fun BannerSection(bannerItems: List<BannerItem>) {
|
|||||||
// 标题
|
// 标题
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.padding(bottom = 12.dp)
|
modifier = Modifier.padding(bottom = 30.dp)
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(R.mipmap.rider_pro_fire2),
|
painter = painterResource(R.mipmap.rider_pro_fire2),
|
||||||
@@ -889,9 +848,9 @@ fun BannerSection(bannerItems: List<BannerItem>) {
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
Text(
|
Text(
|
||||||
text = "推荐给你的智能体",
|
text = "推荐给你的Agent",
|
||||||
fontSize = 16.sp,
|
fontSize = 20.sp,
|
||||||
fontWeight = androidx.compose.ui.text.font.FontWeight.W600,
|
fontWeight = androidx.compose.ui.text.font.FontWeight.W900,
|
||||||
color = AppColors.text
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -916,7 +875,7 @@ fun BannerSection(bannerItems: List<BannerItem>) {
|
|||||||
Image(
|
Image(
|
||||||
painter = painterResource(R.mipmap.rider_pro_hot_room),
|
painter = painterResource(R.mipmap.rider_pro_hot_room),
|
||||||
contentDescription = "chat room",
|
contentDescription = "chat room",
|
||||||
modifier = Modifier.size(24.dp),
|
modifier = Modifier.size(28.dp),
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -249,24 +249,17 @@ fun LoginPage() {
|
|||||||
googleLogin()
|
googleLogin()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//登录tab
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
Box(
|
ActionButton(
|
||||||
contentAlignment = Alignment.Center,
|
modifier = Modifier.fillMaxWidth(),
|
||||||
modifier = Modifier.fillMaxWidth()
|
text = stringResource(R.string.login_upper),
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
stringResource(R.string.login_upper),
|
|
||||||
fontSize = 17.sp,
|
|
||||||
fontWeight = FontWeight.W900,
|
|
||||||
color = AppColors.text,
|
color = AppColors.text,
|
||||||
modifier = Modifier.noRippleClickable {
|
) {
|
||||||
navController.navigate(
|
navController.navigate(
|
||||||
NavigationRoute.UserAuth.route,
|
NavigationRoute.UserAuth.route,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
|
||||||
}
|
|
||||||
Spacer(modifier = Modifier.height(70.dp))
|
Spacer(modifier = Modifier.height(70.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user