feat: 楼中楼用户昵称点击打开用户资料
This commit is contained in:
parent
618cc74f9c
commit
ea0bcc9384
|
|
@ -77,10 +77,13 @@ import androidx.compose.ui.graphics.Color
|
|||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.ExperimentalTextApi
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.text.withAnnotation
|
||||
import androidx.compose.ui.text.withStyle
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
|
@ -1238,6 +1241,7 @@ private fun BottomBar(
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalTextApi::class)
|
||||
@Composable
|
||||
fun PostCard(
|
||||
postHolder: ImmutableHolder<Post>,
|
||||
|
|
@ -1296,6 +1300,7 @@ fun PostCard(
|
|||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
) {
|
||||
withAnnotation("user", "${subPostList.author?.id}") {
|
||||
append(
|
||||
StringUtil.getUsernameAnnotatedString(
|
||||
context,
|
||||
|
|
@ -1306,6 +1311,7 @@ fun PostCard(
|
|||
append(": ")
|
||||
}
|
||||
}
|
||||
}
|
||||
val contentStrings = subPostList.content.renders.map { it.toAnnotationString() }
|
||||
|
||||
userNameString + contentStrings.reduce { acc, annotatedString -> acc + annotatedString }
|
||||
|
|
@ -1389,7 +1395,9 @@ fun PostCard(
|
|||
color = ExtendedTheme.colors.text,
|
||||
fontSize = 13.sp,
|
||||
style = MaterialTheme.typography.body2,
|
||||
emoticonSize = 0.9f
|
||||
emoticonSize = 0.9f,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 4,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue