Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextLinkStyles
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.TextUnit
Expand Down Expand Up @@ -231,9 +233,11 @@ constructor(
)
}
}

OpenUrl -> {
scope.launch { linkManager.openUrl(detail.linkUrl!!) }
}

is ToggleCollapse -> {
val commentId = event.commentId
if (commentId in collapsedItems) {
Expand All @@ -242,6 +246,7 @@ constructor(
collapsedItems[commentId] = Unit
}
}

Share -> {
linkManager.shareUrl(detail.shareUrl!!, detail.title)
}
Expand Down Expand Up @@ -304,6 +309,7 @@ private fun CommentsList(state: ServiceDetailScreen.State, modifier: Modifier =
}
}
}

0 -> {
item(key = "empty", contentType = "empty") {
Box(
Expand All @@ -314,6 +320,7 @@ private fun CommentsList(state: ServiceDetailScreen.State, modifier: Modifier =
}
}
}

else -> {
items(
count = numComments,
Expand Down Expand Up @@ -578,6 +585,7 @@ fun catchupMarkdownTypography(
h5: TextStyle = MaterialTheme.typography.titleLarge.copy(fontSize = seedSize * 1f),
h6: TextStyle = MaterialTheme.typography.titleLarge.copy(fontSize = seedSize * 0.85f),
text: TextStyle = MaterialTheme.typography.bodySmall,
inlineCode: TextStyle = text.copy(fontFamily = FontFamily.Monospace),
code: TextStyle =
MaterialTheme.typography.bodySmall.copy(
fontFamily = FontFamily.Monospace,
Expand All @@ -591,6 +599,12 @@ fun catchupMarkdownTypography(
ordered: TextStyle = MaterialTheme.typography.bodySmall.copy(fontSize = seedSize),
bullet: TextStyle = MaterialTheme.typography.bodySmall.copy(fontSize = seedSize),
list: TextStyle = MaterialTheme.typography.bodySmall.copy(fontSize = seedSize),
link: TextStyle =
MaterialTheme.typography.bodyLarge.copy(
fontWeight = FontWeight.Bold,
textDecoration = TextDecoration.Underline,
),
textLink: TextLinkStyles = TextLinkStyles(style = link.toSpanStyle()),
): MarkdownTypography =
DefaultMarkdownTypography(
h1 = h1,
Expand All @@ -606,4 +620,7 @@ fun catchupMarkdownTypography(
ordered = ordered,
bullet = bullet,
list = list,
inlineCode = inlineCode,
link = link,
textLink = textLink,
)
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ksp = "2.1.10-1.0.30"
ktfmt = "0.54"
leakcanary = "3.0-alpha-8"
lifecycle = "2.9.0-alpha10"
markdown = "0.26.0"
markdown = "0.31.0"
moshi = "1.15.2"
moshix = "0.29.0"
okhttp = "5.0.0-alpha.14"
Expand Down
Loading