Skip to content

Commit

Permalink
Fix callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhuvaneshw committed Dec 27, 2024
1 parent d70bdae commit 9515a22
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ private fun Activity.MainScreen(
PdfViewer(
modifier = Modifier.fillMaxSize(),
containerColor = MaterialTheme.colorScheme.surfaceContainer,
afterLoadSource = {
onReady = { loadSource ->
loadSource()

pdfSettingsManager.restore(this)
setPdfViewer(this)
addListener(object : PdfListener {
Expand Down Expand Up @@ -412,7 +414,9 @@ private fun Activity.MainScreenWithScrollModeSupport() {
PdfViewer(
modifier = Modifier.fillMaxSize(),
containerColor = Color.Transparent,
afterLoadSource = {
onReady = { loadSource ->
loadSource()

showPageButtons = pageScrollMode == PdfViewer.PageScrollMode.SINGLE_PAGE
showPageNumber = pageScrollMode == PdfViewer.PageScrollMode.SINGLE_PAGE ||
pageScrollMode == PdfViewer.PageScrollMode.HORIZONTAL
Expand Down

0 comments on commit 9515a22

Please sign in to comment.