Moving Markdown default styling to a singleton
This commit is contained in:
@@ -68,6 +68,8 @@ fun isValidURL(url: String?): Boolean {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val richTextDefaults = RichTextStyle().resolveDefaults()
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun RichTextViewer(
|
fun RichTextViewer(
|
||||||
content: String,
|
content: String,
|
||||||
@@ -78,8 +80,8 @@ fun RichTextViewer(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
navController: NavController
|
navController: NavController
|
||||||
) {
|
) {
|
||||||
val myMarkDownStyle = RichTextStyle().resolveDefaults().copy(
|
val myMarkDownStyle = richTextDefaults.copy(
|
||||||
codeBlockStyle = RichTextStyle().resolveDefaults().codeBlockStyle?.copy(
|
codeBlockStyle = richTextDefaults.codeBlockStyle?.copy(
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontFamily = FontFamily.Monospace,
|
fontFamily = FontFamily.Monospace,
|
||||||
fontSize = 14.sp
|
fontSize = 14.sp
|
||||||
@@ -99,7 +101,7 @@ fun RichTextViewer(
|
|||||||
.compositeOver(backgroundColor)
|
.compositeOver(backgroundColor)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
stringStyle = RichTextStyle().resolveDefaults().stringStyle?.copy(
|
stringStyle = richTextDefaults.stringStyle?.copy(
|
||||||
linkStyle = SpanStyle(
|
linkStyle = SpanStyle(
|
||||||
textDecoration = TextDecoration.Underline,
|
textDecoration = TextDecoration.Underline,
|
||||||
color = MaterialTheme.colors.primary
|
color = MaterialTheme.colors.primary
|
||||||
|
|||||||
Reference in New Issue
Block a user