更新
This commit is contained in:
@@ -78,7 +78,9 @@ data class Image(
|
|||||||
@SerializedName("url")
|
@SerializedName("url")
|
||||||
val url: String,
|
val url: String,
|
||||||
@SerializedName("thumbnail")
|
@SerializedName("thumbnail")
|
||||||
val thumbnail: String
|
val thumbnail: String,
|
||||||
|
@SerializedName("blurHash")
|
||||||
|
val blurHash: String?
|
||||||
)
|
)
|
||||||
|
|
||||||
data class User(
|
data class User(
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import com.aiosman.riderpro.ui.login.EmailSignupScreen
|
|||||||
import com.aiosman.riderpro.ui.login.LoginPage
|
import com.aiosman.riderpro.ui.login.LoginPage
|
||||||
import com.aiosman.riderpro.ui.login.SignupScreen
|
import com.aiosman.riderpro.ui.login.SignupScreen
|
||||||
import com.aiosman.riderpro.ui.login.UserAuthScreen
|
import com.aiosman.riderpro.ui.login.UserAuthScreen
|
||||||
import com.aiosman.riderpro.ui.message.NotificationsScreen
|
import com.aiosman.riderpro.ui.index.tabs.message.NotificationsScreen
|
||||||
import com.aiosman.riderpro.ui.modification.EditModificationScreen
|
import com.aiosman.riderpro.ui.modification.EditModificationScreen
|
||||||
import com.aiosman.riderpro.ui.post.NewPostScreen
|
import com.aiosman.riderpro.ui.post.NewPostScreen
|
||||||
import com.aiosman.riderpro.ui.post.PostScreen
|
import com.aiosman.riderpro.ui.post.PostScreen
|
||||||
|
|||||||
@@ -26,11 +26,13 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.aiosman.riderpro.ui.index.tabs.add.AddPage
|
import com.aiosman.riderpro.ui.index.tabs.add.AddPage
|
||||||
|
import com.aiosman.riderpro.ui.index.tabs.message.NotificationsScreen
|
||||||
import com.aiosman.riderpro.ui.index.tabs.moment.MomentsList
|
import com.aiosman.riderpro.ui.index.tabs.moment.MomentsList
|
||||||
import com.aiosman.riderpro.ui.index.tabs.profile.ProfilePage
|
import com.aiosman.riderpro.ui.index.tabs.profile.ProfilePage
|
||||||
import com.aiosman.riderpro.ui.index.tabs.search.SearchScreen
|
import com.aiosman.riderpro.ui.index.tabs.search.SearchScreen
|
||||||
import com.aiosman.riderpro.ui.index.tabs.shorts.ShortVideo
|
import com.aiosman.riderpro.ui.index.tabs.shorts.ShortVideo
|
||||||
import com.aiosman.riderpro.ui.index.tabs.street.StreetPage
|
import com.aiosman.riderpro.ui.index.tabs.street.StreetPage
|
||||||
|
import com.aiosman.riderpro.ui.message.MessagePage
|
||||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -45,6 +47,7 @@ fun IndexScreen() {
|
|||||||
// NavigationItem.Street,
|
// NavigationItem.Street,
|
||||||
NavigationItem.Add,
|
NavigationItem.Add,
|
||||||
// NavigationItem.Message,
|
// NavigationItem.Message,
|
||||||
|
NavigationItem.Notification,
|
||||||
NavigationItem.Profile
|
NavigationItem.Profile
|
||||||
)
|
)
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
@@ -101,6 +104,7 @@ fun IndexScreen() {
|
|||||||
) {
|
) {
|
||||||
Home()
|
Home()
|
||||||
}
|
}
|
||||||
|
|
||||||
1 -> Box(
|
1 -> Box(
|
||||||
modifier = Modifier.padding(innerPadding)
|
modifier = Modifier.padding(innerPadding)
|
||||||
) {
|
) {
|
||||||
@@ -115,9 +119,14 @@ fun IndexScreen() {
|
|||||||
// 3 -> Box(
|
// 3 -> Box(
|
||||||
// modifier = Modifier.padding(innerPadding)
|
// modifier = Modifier.padding(innerPadding)
|
||||||
// ) { Video() }
|
// ) { Video() }
|
||||||
|
|
||||||
3 -> Box(
|
3 -> Box(
|
||||||
modifier = Modifier.padding(innerPadding)
|
modifier = Modifier.padding(innerPadding)
|
||||||
|
) {
|
||||||
|
Notifications()
|
||||||
|
}
|
||||||
|
|
||||||
|
4 -> Box(
|
||||||
|
modifier = Modifier.padding(innerPadding)
|
||||||
) { Profile() }
|
) { Profile() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,3 +215,19 @@ fun Profile() {
|
|||||||
ProfilePage()
|
ProfilePage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun Notifications() {
|
||||||
|
val systemUiController = rememberSystemUiController()
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = true)
|
||||||
|
}
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.Center,
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
NotificationsScreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,6 +33,11 @@ sealed class NavigationItem(
|
|||||||
selectedIcon = { ImageVector.vectorResource(R.drawable.rider_pro_video) }
|
selectedIcon = { ImageVector.vectorResource(R.drawable.rider_pro_video) }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data object Notification : NavigationItem("Notification",
|
||||||
|
icon = { ImageVector.vectorResource(R.drawable.rider_pro_notification) },
|
||||||
|
selectedIcon = { ImageVector.vectorResource(R.drawable.rider_pro_notification) }
|
||||||
|
)
|
||||||
|
|
||||||
data object Profile : NavigationItem("Profile",
|
data object Profile : NavigationItem("Profile",
|
||||||
icon = { ImageVector.vectorResource(R.drawable.rider_pro_profile) },
|
icon = { ImageVector.vectorResource(R.drawable.rider_pro_profile) },
|
||||||
selectedIcon = { ImageVector.vectorResource(R.drawable.rider_pro_profile_filed) }
|
selectedIcon = { ImageVector.vectorResource(R.drawable.rider_pro_profile_filed) }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.aiosman.riderpro.ui.message
|
package com.aiosman.riderpro.ui.index.tabs.message
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@@ -32,7 +32,6 @@ import androidx.compose.ui.unit.sp
|
|||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.data.Comment
|
|
||||||
import com.aiosman.riderpro.data.CommentEntity
|
import com.aiosman.riderpro.data.CommentEntity
|
||||||
import com.aiosman.riderpro.exp.timeAgo
|
import com.aiosman.riderpro.exp.timeAgo
|
||||||
import com.aiosman.riderpro.ui.NavigationRoute
|
import com.aiosman.riderpro.ui.NavigationRoute
|
||||||
@@ -49,17 +48,15 @@ fun NotificationsScreen() {
|
|||||||
val model = MessageListViewModel
|
val model = MessageListViewModel
|
||||||
val navController = LocalNavController.current
|
val navController = LocalNavController.current
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
var dataFlow = model.commentItemsFlow
|
var dataFlow = MessageListViewModel.commentItemsFlow
|
||||||
var comments = dataFlow.collectAsLazyPagingItems()
|
var comments = dataFlow.collectAsLazyPagingItems()
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setNavigationBarColor(Color.Transparent)
|
systemUiController.setNavigationBarColor(Color.Transparent)
|
||||||
model.initData()
|
MessageListViewModel.initData()
|
||||||
}
|
}
|
||||||
StatusBarMaskLayout(darkIcons = true) {
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxSize()
|
||||||
.fillMaxWidth()
|
|
||||||
.weight(1f)
|
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -78,18 +75,22 @@ fun NotificationsScreen() {
|
|||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
) {
|
) {
|
||||||
NotificationIndicator(model.likeNoticeCount, R.drawable.rider_pro_like, "LIKE") {
|
NotificationIndicator(
|
||||||
|
MessageListViewModel.likeNoticeCount,
|
||||||
|
R.drawable.rider_pro_like,
|
||||||
|
"LIKE"
|
||||||
|
) {
|
||||||
navController.navigate(NavigationRoute.Likes.route)
|
navController.navigate(NavigationRoute.Likes.route)
|
||||||
}
|
}
|
||||||
NotificationIndicator(
|
NotificationIndicator(
|
||||||
model.followNoticeCount,
|
MessageListViewModel.followNoticeCount,
|
||||||
R.drawable.rider_pro_followers,
|
R.drawable.rider_pro_followers,
|
||||||
"FOLLOWERS"
|
"FOLLOWERS"
|
||||||
) {
|
) {
|
||||||
navController.navigate(NavigationRoute.Followers.route)
|
navController.navigate(NavigationRoute.Followers.route)
|
||||||
}
|
}
|
||||||
NotificationIndicator(
|
NotificationIndicator(
|
||||||
model.favouriteNoticeCount,
|
MessageListViewModel.favouriteNoticeCount,
|
||||||
R.drawable.rider_pro_favoriate,
|
R.drawable.rider_pro_favoriate,
|
||||||
"Favourites"
|
"Favourites"
|
||||||
) {
|
) {
|
||||||
@@ -97,7 +98,7 @@ fun NotificationsScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
HorizontalDivider(color = Color(0xFFEbEbEb), modifier = Modifier.padding(16.dp))
|
HorizontalDivider(color = Color(0xFFEbEbEb), modifier = Modifier.padding(16.dp))
|
||||||
NotificationCounterItem(model.commentNoticeCount)
|
NotificationCounterItem(MessageListViewModel.commentNoticeCount)
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
@@ -106,7 +107,7 @@ fun NotificationsScreen() {
|
|||||||
items(comments.itemCount) { index ->
|
items(comments.itemCount) { index ->
|
||||||
comments[index]?.let { comment ->
|
comments[index]?.let { comment ->
|
||||||
CommentItem(comment) {
|
CommentItem(comment) {
|
||||||
model.updateReadStatus(comment.id)
|
MessageListViewModel.updateReadStatus(comment.id)
|
||||||
navController.navigate(
|
navController.navigate(
|
||||||
NavigationRoute.Post.route.replace(
|
NavigationRoute.Post.route.replace(
|
||||||
"{id}",
|
"{id}",
|
||||||
@@ -121,7 +122,7 @@ fun NotificationsScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.aiosman.riderpro.ui.message
|
package com.aiosman.riderpro.ui.index.tabs.message
|
||||||
|
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -2,10 +2,12 @@ package com.aiosman.riderpro.ui.index.tabs.moment
|
|||||||
|
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
||||||
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
|
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.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
@@ -21,6 +23,9 @@ import androidx.compose.foundation.layout.size
|
|||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.wrapContentWidth
|
import androidx.compose.foundation.layout.wrapContentWidth
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.pager.HorizontalPager
|
||||||
|
import androidx.compose.foundation.pager.rememberPagerState
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.material.ExperimentalMaterialApi
|
import androidx.compose.material.ExperimentalMaterialApi
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Build
|
import androidx.compose.material.icons.filled.Build
|
||||||
@@ -42,6 +47,7 @@ import androidx.compose.runtime.rememberCoroutineScope
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
@@ -59,6 +65,7 @@ import com.aiosman.riderpro.LocalNavController
|
|||||||
import com.aiosman.riderpro.LocalSharedTransitionScope
|
import com.aiosman.riderpro.LocalSharedTransitionScope
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.model.MomentEntity
|
import com.aiosman.riderpro.model.MomentEntity
|
||||||
|
import com.aiosman.riderpro.model.MomentImageEntity
|
||||||
import com.aiosman.riderpro.ui.NavigationRoute
|
import com.aiosman.riderpro.ui.NavigationRoute
|
||||||
import com.aiosman.riderpro.ui.comment.CommentModalContent
|
import com.aiosman.riderpro.ui.comment.CommentModalContent
|
||||||
import com.aiosman.riderpro.ui.composables.AnimatedCounter
|
import com.aiosman.riderpro.ui.composables.AnimatedCounter
|
||||||
@@ -66,6 +73,7 @@ import com.aiosman.riderpro.ui.composables.AnimatedFavouriteIcon
|
|||||||
import com.aiosman.riderpro.ui.composables.AnimatedLikeIcon
|
import com.aiosman.riderpro.ui.composables.AnimatedLikeIcon
|
||||||
import com.aiosman.riderpro.ui.composables.CustomAsyncImage
|
import com.aiosman.riderpro.ui.composables.CustomAsyncImage
|
||||||
import com.aiosman.riderpro.ui.composables.RelPostCard
|
import com.aiosman.riderpro.ui.composables.RelPostCard
|
||||||
|
import com.aiosman.riderpro.ui.imageviewer.ImageViewerViewModel
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
import com.aiosman.riderpro.ui.post.NewPostViewModel
|
import com.aiosman.riderpro.ui.post.NewPostViewModel
|
||||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||||
@@ -139,8 +147,12 @@ fun MomentCard(
|
|||||||
val navController = LocalNavController.current
|
val navController = LocalNavController.current
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp)
|
||||||
) {
|
) {
|
||||||
MomentTopRowGroup(momentEntity = momentEntity)
|
MomentTopRowGroup(momentEntity = momentEntity)
|
||||||
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -274,8 +286,6 @@ fun MomentTopRowGroup(momentEntity: MomentEntity) {
|
|||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(40.dp)
|
|
||||||
.padding(top = 0.dp, bottom = 0.dp, start = 24.dp, end = 24.dp)
|
|
||||||
) {
|
) {
|
||||||
CustomAsyncImage(
|
CustomAsyncImage(
|
||||||
context,
|
context,
|
||||||
@@ -320,45 +330,108 @@ fun MomentTopRowGroup(momentEntity: MomentEntity) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalSharedTransitionApi::class)
|
@OptIn(ExperimentalFoundationApi::class, ExperimentalSharedTransitionApi::class)
|
||||||
|
@Composable
|
||||||
|
fun PostImageView(
|
||||||
|
postId: String,
|
||||||
|
images: List<MomentImageEntity>,
|
||||||
|
) {
|
||||||
|
val pagerState = rememberPagerState(pageCount = { images.size })
|
||||||
|
val navController = LocalNavController.current
|
||||||
|
val sharedTransitionScope = LocalSharedTransitionScope.current
|
||||||
|
val animatedVisibilityScope = LocalAnimatedContentScope.current
|
||||||
|
val context = LocalContext.current
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
) {
|
||||||
|
HorizontalPager(
|
||||||
|
state = pagerState,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.aspectRatio(1f),
|
||||||
|
) { page ->
|
||||||
|
val image = images[page]
|
||||||
|
with(sharedTransitionScope) {
|
||||||
|
CustomAsyncImage(
|
||||||
|
context,
|
||||||
|
image.thumbnail,
|
||||||
|
contentDescription = "Image",
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
|
modifier = Modifier
|
||||||
|
.sharedElement(
|
||||||
|
rememberSharedContentState(key = image),
|
||||||
|
animatedVisibilityScope = animatedVisibilityScope
|
||||||
|
)
|
||||||
|
.fillMaxSize()
|
||||||
|
// .noRippleClickable {
|
||||||
|
// ImageViewerViewModel.asNew(images, page)
|
||||||
|
// navController.navigate(
|
||||||
|
// NavigationRoute.ImageViewer.route
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Indicator container
|
||||||
|
if (images.size > 1) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(8.dp)
|
||||||
|
.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.Center
|
||||||
|
) {
|
||||||
|
images.forEachIndexed { index, _ ->
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.size(8.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
|
||||||
|
.background(
|
||||||
|
if (pagerState.currentPage == index) Color.Red else Color.Gray.copy(
|
||||||
|
alpha = 0.5f
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.padding(4.dp)
|
||||||
|
|
||||||
|
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MomentContentGroup(
|
fun MomentContentGroup(
|
||||||
momentEntity: MomentEntity,
|
momentEntity: MomentEntity,
|
||||||
) {
|
) {
|
||||||
val displayImageUrl = momentEntity.images.firstOrNull()
|
if (momentEntity.momentTextContent.isNotEmpty()) {
|
||||||
val sharedTransitionScope = LocalSharedTransitionScope.current
|
|
||||||
val animatedVisibilityScope = LocalAnimatedContentScope.current
|
|
||||||
val context = LocalContext.current
|
|
||||||
Text(
|
Text(
|
||||||
text = "${momentEntity.momentTextContent}",
|
text = momentEntity.momentTextContent,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(top = 22.dp, bottom = 16.dp, start = 24.dp, end = 24.dp),
|
.padding(horizontal = 24.dp, vertical = 8.dp),
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp
|
||||||
)
|
)
|
||||||
|
}
|
||||||
if (momentEntity.relMoment != null) {
|
if (momentEntity.relMoment != null) {
|
||||||
RelPostCard(
|
RelPostCard(
|
||||||
momentEntity = momentEntity.relMoment!!,
|
momentEntity = momentEntity.relMoment!!,
|
||||||
modifier = Modifier.background(Color(0xFFF8F8F8))
|
modifier = Modifier.background(Color(0xFFF8F8F8))
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
displayImageUrl?.let {
|
Box(
|
||||||
with(sharedTransitionScope) {
|
modifier = Modifier.fillMaxWidth()
|
||||||
CustomAsyncImage(
|
) {
|
||||||
context,
|
PostImageView(
|
||||||
it.thumbnail,
|
postId = momentEntity.id.toString(),
|
||||||
modifier = Modifier
|
images = momentEntity.images
|
||||||
.sharedElement(
|
|
||||||
rememberSharedContentState(key = it),
|
|
||||||
animatedVisibilityScope = animatedVisibilityScope
|
|
||||||
)
|
)
|
||||||
.fillMaxWidth()
|
|
||||||
.aspectRatio(1f),
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
contentDescription = ""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -374,50 +374,6 @@ fun CommunicationOperatorGroup(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSelf) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(width = 142.dp, height = 40.dp)
|
|
||||||
.padding(start = 6.dp)
|
|
||||||
.clickable {
|
|
||||||
navController.navigate("MyMessage")
|
|
||||||
},
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
Image(
|
|
||||||
modifier = Modifier.fillMaxSize(),
|
|
||||||
painter = painterResource(id = R.drawable.rider_pro_profile_message),
|
|
||||||
contentDescription = ""
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
text = "MESSAGE",
|
|
||||||
fontSize = 16.sp,
|
|
||||||
color = Color.White,
|
|
||||||
style = TextStyle(fontWeight = FontWeight.Bold)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
// Box(
|
|
||||||
// modifier = Modifier
|
|
||||||
// .size(width = 142.dp, height = 40.dp)
|
|
||||||
// .clickable {
|
|
||||||
// navController.navigate("ProfileTimeline")
|
|
||||||
// },
|
|
||||||
// contentAlignment = Alignment.Center
|
|
||||||
// ) {
|
|
||||||
// Image(
|
|
||||||
// modifier = Modifier.fillMaxSize(),
|
|
||||||
// painter = painterResource(id = R.drawable.rider_pro_profile_follow),
|
|
||||||
// contentDescription = ""
|
|
||||||
// )
|
|
||||||
// Text(
|
|
||||||
// text = "GALLERY",
|
|
||||||
// fontSize = 16.sp,
|
|
||||||
// color = Color.White,
|
|
||||||
// style = TextStyle(fontWeight = FontWeight.Bold)
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,10 +70,10 @@ fun SearchScreen() {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(Color.White)
|
.background(Color.White)
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(start = 16.dp, end = 16.dp, top = 24.dp)
|
|
||||||
) {
|
) {
|
||||||
SearchInput(
|
SearchInput(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth().padding(top = 16.dp, start = 24.dp, end = 24.dp),
|
||||||
text = model.searchText,
|
text = model.searchText,
|
||||||
onTextChange = {
|
onTextChange = {
|
||||||
model.searchText = it
|
model.searchText = it
|
||||||
@@ -125,7 +125,7 @@ fun SearchInput(
|
|||||||
.clip(shape = RoundedCornerShape(8.dp))
|
.clip(shape = RoundedCornerShape(8.dp))
|
||||||
|
|
||||||
.background(Color(0xFFEEEEEE))
|
.background(Color(0xFFEEEEEE))
|
||||||
.padding(horizontal = 16.dp, vertical = 16.dp)
|
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
|||||||
@@ -52,9 +52,11 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.res.vectorResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
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
|
||||||
@@ -308,7 +310,6 @@ fun PostScreen(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.aspectRatio(1f)
|
.aspectRatio(1f)
|
||||||
|
|
||||||
) {
|
) {
|
||||||
PostImageView(
|
PostImageView(
|
||||||
id,
|
id,
|
||||||
@@ -403,7 +404,8 @@ fun Header(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(20.dp)
|
.height(20.dp)
|
||||||
.wrapContentWidth()
|
.wrapContentWidth()
|
||||||
.padding(start = 6.dp).noRippleClickable {
|
.padding(start = 6.dp)
|
||||||
|
.noRippleClickable {
|
||||||
onFollowClick()
|
onFollowClick()
|
||||||
},
|
},
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
@@ -441,7 +443,7 @@ fun PostImageView(
|
|||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.fillMaxWidth(),
|
.fillMaxWidth().background(Color.Gray.copy(alpha = 0.1f)),
|
||||||
) { page ->
|
) { page ->
|
||||||
val image = images[page]
|
val image = images[page]
|
||||||
with(sharedTransitionScope) {
|
with(sharedTransitionScope) {
|
||||||
@@ -449,7 +451,7 @@ fun PostImageView(
|
|||||||
context,
|
context,
|
||||||
image.thumbnail,
|
image.thumbnail,
|
||||||
contentDescription = "Image",
|
contentDescription = "Image",
|
||||||
contentScale = ContentScale.Fit,
|
contentScale = ContentScale.Crop,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.sharedElement(
|
.sharedElement(
|
||||||
rememberSharedContentState(key = image),
|
rememberSharedContentState(key = image),
|
||||||
@@ -661,7 +663,7 @@ fun BottomNavigationBar(
|
|||||||
onLikeClick()
|
onLikeClick()
|
||||||
}) {
|
}) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Filled.Favorite,
|
imageVector = ImageVector.vectorResource(id = R.drawable.rider_pro_like),
|
||||||
contentDescription = "like",
|
contentDescription = "like",
|
||||||
tint = if (momentEntity?.liked == true) Color.Red else Color.Gray
|
tint = if (momentEntity?.liked == true) Color.Red else Color.Gray
|
||||||
)
|
)
|
||||||
@@ -673,7 +675,7 @@ fun BottomNavigationBar(
|
|||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Filled.Star,
|
imageVector = ImageVector.vectorResource(id = R.drawable.rider_pro_favoriate),
|
||||||
contentDescription = "Favourite",
|
contentDescription = "Favourite",
|
||||||
tint = if (momentEntity?.isFavorite == true) Color.Red else Color.Gray
|
tint = if (momentEntity?.isFavorite == true) Color.Red else Color.Gray
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user