From 19fba5d34a444ce145ab0d3a12c578d9d5d3f38c Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Fri, 30 Aug 2013 18:37:43 -0700 Subject: KLP API Review: PrintDocumentAdapter documentation bug:10551676 Change-Id: I755cc1827ed950b8481b8b260ea3cde83bcdd418 --- core/java/android/print/PrintDocumentAdapter.java | 10 ++++++---- core/java/android/print/PrintFileDocumentAdapter.java | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'core/java/android') diff --git a/core/java/android/print/PrintDocumentAdapter.java b/core/java/android/print/PrintDocumentAdapter.java index 33b4aad..8a59b6b 100644 --- a/core/java/android/print/PrintDocumentAdapter.java +++ b/core/java/android/print/PrintDocumentAdapter.java @@ -55,7 +55,7 @@ import java.util.List; * The APIs defined in this class are designed to enable doing part or all * of the work on an arbitrary thread. For example, if the printed content * does not depend on the UI state, i.e. on what is shown on the screen, then - * you can off load the entire work on a dedicated thread, thus making your + * you can offload the entire work on a dedicated thread, thus making your * application interactive while the print work is being performed. *

*

@@ -99,6 +99,7 @@ public abstract class PrintDocumentAdapter { * the last argument true or false depending on * whether the layout changed the content or not, respectively; and {@link * LayoutResultCallback#onLayoutFailed(CharSequence)}, if an error occurred. + * Note that you must call one of the methods of the given callback. *

*

* When doing a layout you may satisfy some of the constraints in the print @@ -147,13 +148,14 @@ public abstract class PrintDocumentAdapter { /** * Called when specific pages of the content should be written in the - * from of a PDF file to the given file descriptor. This method is invoked + * form of a PDF file to the given file descriptor. This method is invoked * on the main thread. *

* After you are done writing, you should close the file descriptor and - * invoke {@link WriteResultCallback #onWriteFinished(List)}, if writing + * invoke {@link WriteResultCallback #onWriteFinished(PageRange[]), if writing * completed successfully; or {@link WriteResultCallback#onWriteFailed( - * CharSequence)}, if an error occurred. + * CharSequence)}, if an error occurred. Note that you must call one of + * the methods of the given callback. *

*

* Note: If the printed content is large, it is a good diff --git a/core/java/android/print/PrintFileDocumentAdapter.java b/core/java/android/print/PrintFileDocumentAdapter.java index b905396..c3a23a5 100644 --- a/core/java/android/print/PrintFileDocumentAdapter.java +++ b/core/java/android/print/PrintFileDocumentAdapter.java @@ -36,10 +36,11 @@ import java.io.InputStream; import java.io.OutputStream; /** - * Adapter for printing files. This class could be useful if you + * Adapter for printing PDF files. This class could be useful if you * want to print a file and intercept when the system is ready - * spooling the data, so you can deleted the file if it is a - * temporary one. + * spooling the data, so you can delete the file if it is a + * temporary one. To achieve this one must override {@link #onFinish()} + * and delete the file yourself. */ public class PrintFileDocumentAdapter extends PrintDocumentAdapter { @@ -57,7 +58,7 @@ public class PrintFileDocumentAdapter extends PrintDocumentAdapter { * Constructor. * * @param context Context for accessing resources. - * @param file The file to print. + * @param file The PDF file to print. * @param documentInfo The information about the printed file. */ public PrintFileDocumentAdapter(Context context, File file, -- cgit v1.1