关注和取消关注
This commit is contained in:
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.Clear
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -48,15 +49,24 @@ fun OtherProfileAction(
|
||||
onFollow?.invoke()
|
||||
}
|
||||
) {
|
||||
if (profile.isFollowing) {
|
||||
Icon(
|
||||
Icons.Default.Clear,
|
||||
contentDescription = "",
|
||||
modifier = Modifier.size(24.dp),
|
||||
tint = Color.Black
|
||||
)
|
||||
} else {
|
||||
Icon(
|
||||
Icons.Default.Add,
|
||||
contentDescription = "",
|
||||
modifier = Modifier.size(24.dp),
|
||||
tint = if (profile.isFollowing) Color.Black else Color.White
|
||||
tint = Color.White
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Text(
|
||||
text = stringResource(if (profile.isFollowing) R.string.following_upper else R.string.follow_upper),
|
||||
text = stringResource(if (profile.isFollowing) R.string.unfollow_upper else R.string.follow_upper),
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.W600,
|
||||
color = if (profile.isFollowing) Color.Black else Color.White,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<string name="favourites_upper">收藏</string>
|
||||
<string name="notifications_upper">消息</string>
|
||||
<string name="following_upper">关注中</string>
|
||||
<string name="unfollow_upper">取消关注</string>
|
||||
<string name="comment_count">%d条评论</string>
|
||||
<string name="post_comment_hint">说点什么</string>
|
||||
<string name="follow_upper">关注</string>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<string name="favourites_upper">FAVOURITES</string>
|
||||
<string name="notifications_upper">NOTIFICATIONS</string>
|
||||
<string name="following_upper">FOLLOWING</string>
|
||||
<string name="unfollow_upper">UNFOLLOW</string>
|
||||
<string name="comment_count">%d Comments</string>
|
||||
<string name="post_comment_hint">Say something...</string>
|
||||
<string name="follow_upper">FOLLOW</string>
|
||||
|
||||
Reference in New Issue
Block a user