Skip to content

Commit

Permalink
Flexible onReady callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhuvaneshw committed Dec 27, 2024
1 parent 7864d3a commit d70bdae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ fun PdfViewerContainer(
}
}

@Composable
fun PdfContainerBoxScope.PdfViewer(
modifier: Modifier = Modifier,
containerColor: Color? = null,
afterLoadSource: (PdfViewer.() -> Unit)? = null,
) {
com.acutecoder.pdfviewer.compose.PdfViewer(
pdfState = pdfState,
modifier = modifier,
containerColor = containerColor,
afterLoadSource = afterLoadSource,
)
}

@Composable
fun PdfContainerBoxScope.PdfViewer(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@ import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.viewinterop.AndroidView
import com.acutecoder.pdf.PdfViewer

@Composable
fun PdfViewer(
pdfState: PdfState,
modifier: Modifier = Modifier,
containerColor: Color? = null,
afterLoadSource: (PdfViewer.() -> Unit)? = null,
) {
PdfViewer(
pdfState = pdfState,
modifier = modifier,
containerColor = containerColor,
onReady = { loadSource ->
loadSource()
afterLoadSource?.invoke(this)
}
)
}

@Composable
fun PdfViewer(
pdfState: PdfState,
Expand Down

0 comments on commit d70bdae

Please sign in to comment.