Skip to content

Commit

Permalink
Set webview background color
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Jan 30, 2024
1 parent 03a1832 commit 650c50d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ internal fun ReaderScreen(presenter: ReaderPresenter, modifier: Modifier = Modif
}
}
state.hasContent -> {
val backgroundColor =
StringUtils.hexFromArgb(AppTheme.colorScheme.surfaceContainerLowest.toArgb())
val codeBackgroundColor =
StringUtils.hexFromArgb(AppTheme.colorScheme.surfaceContainerHighest.toArgb())
val textColor = StringUtils.hexFromArgb(AppTheme.colorScheme.onSurface.toArgb())
Expand All @@ -230,7 +228,6 @@ internal fun ReaderScreen(presenter: ReaderPresenter, modifier: Modifier = Modif
<style>
body {
padding-top: 16px;
background-color: $backgroundColor;
color: $textColor;
font-family: 'Golos Text', sans-serif;
}
Expand Down Expand Up @@ -351,6 +348,9 @@ internal fun ReaderScreen(presenter: ReaderPresenter, modifier: Modifier = Modif
.trimIndent()
}
val webViewState = rememberWebViewStateWithHTMLData(htmlTemplate)
webViewState.webSettings.apply {
this.backgroundColor = AppTheme.colorScheme.surfaceContainerLowest
}

Box(Modifier.fillMaxSize().padding(paddingValues).padding(horizontal = 16.dp)) {
WebView(
Expand Down

0 comments on commit 650c50d

Please sign in to comment.