From d70bdae7c5c5fb5535a4631544de741f4a930d3f Mon Sep 17 00:00:00 2001 From: Bhuvaneshwaran Date: Fri, 27 Dec 2024 14:59:02 +0530 Subject: [PATCH] Flexible onReady callback --- .../pdfviewer/compose/ui/PdfViewerContainer.kt | 14 -------------- .../acutecoder/pdfviewer/compose/PdfViewer.kt | 18 ------------------ 2 files changed, 32 deletions(-) diff --git a/compose-ui/src/main/java/com/acutecoder/pdfviewer/compose/ui/PdfViewerContainer.kt b/compose-ui/src/main/java/com/acutecoder/pdfviewer/compose/ui/PdfViewerContainer.kt index 4493aa9..39b1ef5 100644 --- a/compose-ui/src/main/java/com/acutecoder/pdfviewer/compose/ui/PdfViewerContainer.kt +++ b/compose-ui/src/main/java/com/acutecoder/pdfviewer/compose/ui/PdfViewerContainer.kt @@ -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, diff --git a/compose/src/main/java/com/acutecoder/pdfviewer/compose/PdfViewer.kt b/compose/src/main/java/com/acutecoder/pdfviewer/compose/PdfViewer.kt index d5a035d..3f8dff3 100644 --- a/compose/src/main/java/com/acutecoder/pdfviewer/compose/PdfViewer.kt +++ b/compose/src/main/java/com/acutecoder/pdfviewer/compose/PdfViewer.kt @@ -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,