diff --git a/sample/build.gradle b/sample/build.gradle index 347a7b7..a95f96d 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -25,7 +25,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'androidx.appcompat:appcompat:1.4.2' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.legacy:legacy-support-v4:1.0.0' testImplementation 'junit:junit:4.13.2' diff --git a/sample/src/main/java/com/emon/exampleXMLtoPDF/MainActivity.java b/sample/src/main/java/com/emon/exampleXMLtoPDF/MainActivity.java index cf694dc..c37e3fe 100644 --- a/sample/src/main/java/com/emon/exampleXMLtoPDF/MainActivity.java +++ b/sample/src/main/java/com/emon/exampleXMLtoPDF/MainActivity.java @@ -58,7 +58,7 @@ public void onClick(View v) { .fromLayoutXML(R.layout.layout_print_horizontal_scroll) .setFileName("Demo-Horizontal-Scroll-View-Text") .setFolderNameOrPath("MyFolder/MyDemoHorizontalText/") - .actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.SHARE) + .actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.NONE) .build(new PdfGeneratorListener() { @Override public void onFailure(FailureResponse failureResponse) { @@ -104,7 +104,7 @@ public void onClick(View v) { .fromViewID(MainActivity.this, R.id.tv_print_area) .setFileName("Demo-Landscape") .setFolderNameOrPath("MyFolder/MyDemoLandscape/") - .actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.OPEN) + .actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.SHARE) .build(new PdfGeneratorListener() { @Override public void onFailure(FailureResponse failureResponse) { diff --git a/xml-to-pdf/src/main/java/com/gkemon/XMLtoPDF/PdfGenerator.java b/xml-to-pdf/src/main/java/com/gkemon/XMLtoPDF/PdfGenerator.java index 5320488..970a285 100644 --- a/xml-to-pdf/src/main/java/com/gkemon/XMLtoPDF/PdfGenerator.java +++ b/xml-to-pdf/src/main/java/com/gkemon/XMLtoPDF/PdfGenerator.java @@ -156,7 +156,7 @@ public interface Build { } public enum ActionAfterPDFGeneration { - OPEN, SHARE + OPEN, SHARE, NONE } public enum PrintingMode { @@ -355,7 +355,8 @@ private void print() { }) .subscribe(() -> { postSuccess(document, filePath, pageWidthInPixel, pageHeightInPixel); - dealAfterGeneration(actionAfterPDFGeneration); + if (actionAfterPDFGeneration != ActionAfterPDFGeneration.NONE) + dealAfterGeneration(actionAfterPDFGeneration); }, this::postFailure);