Prefix classes
This commit is contained in:
parent
6c16959267
commit
fc2bbeca53
12
plugin.xml
12
plugin.xml
@ -104,17 +104,17 @@
|
||||
<source-file src="src/android/AssetUtil.java"
|
||||
target-dir="src/de/appplant/cordova/plugin/printer" />
|
||||
|
||||
<source-file src="src/android/Options.java"
|
||||
target-dir="src/de/appplant/cordova/plugin/printer" />
|
||||
|
||||
<source-file src="src/android/PdfAdapter.java"
|
||||
target-dir="src/de/appplant/cordova/plugin/printer" />
|
||||
|
||||
<source-file src="src/android/Printer.java"
|
||||
target-dir="src/de/appplant/cordova/plugin/printer" />
|
||||
|
||||
<source-file src="src/android/PrintManager.java"
|
||||
target-dir="src/de/appplant/cordova/plugin/printer" />
|
||||
|
||||
<source-file src="src/android/PrintOptions.java"
|
||||
target-dir="src/de/appplant/cordova/plugin/printer" />
|
||||
|
||||
<source-file src="src/android/PrintPdfAdapter.java"
|
||||
target-dir="src/de/appplant/cordova/plugin/printer" />
|
||||
</platform>
|
||||
|
||||
<!-- windows -->
|
||||
|
@ -24,7 +24,6 @@ package de.appplant.cordova.plugin.printer;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.print.PrintAttributes;
|
||||
import android.print.PrintDocumentAdapter;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.print.PrintHelper;
|
||||
@ -125,10 +124,10 @@ class PrintManager {
|
||||
private void printPdf (String path, JSONObject settings,
|
||||
@Nullable PrintHelper.OnPrintFinishCallback callback)
|
||||
{
|
||||
Options options = new Options(settings);
|
||||
String jobName = options.getJobName();
|
||||
PrintDocumentAdapter adapter = new PdfAdapter(path, context);
|
||||
PrintAttributes attributes = options.toPrintAttributes();
|
||||
PrintOptions options = new PrintOptions(settings);
|
||||
String jobName = options.getJobName();
|
||||
PrintPdfAdapter adapter = new PrintPdfAdapter(path, context);
|
||||
PrintAttributes attributes = options.toPrintAttributes();
|
||||
|
||||
getPrintService().print(jobName, adapter, attributes);
|
||||
}
|
||||
@ -143,14 +142,14 @@ class PrintManager {
|
||||
private void printImage (String path, JSONObject settings,
|
||||
@Nullable PrintHelper.OnPrintFinishCallback callback)
|
||||
{
|
||||
AssetUtil decoder = new AssetUtil(context);
|
||||
Bitmap bitmap = decoder.decode(path);
|
||||
AssetUtil decoder = new AssetUtil(context);
|
||||
Bitmap bitmap = decoder.decode(path);
|
||||
|
||||
if (bitmap == null) return;
|
||||
|
||||
Options options = new Options(settings);
|
||||
PrintHelper printer = new PrintHelper(context);
|
||||
String jobName = options.getJobName();
|
||||
PrintOptions options = new PrintOptions(settings);
|
||||
PrintHelper printer = new PrintHelper(context);
|
||||
String jobName = options.getJobName();
|
||||
|
||||
options.decoratePrintHelper(printer);
|
||||
|
||||
|
@ -40,7 +40,7 @@ import static android.support.v4.print.PrintHelper.SCALE_MODE_FIT;
|
||||
/**
|
||||
* Wrapper for the print job settings.
|
||||
*/
|
||||
class Options {
|
||||
class PrintOptions {
|
||||
|
||||
// The print job settings
|
||||
private @NonNull JSONObject spec;
|
||||
@ -50,7 +50,7 @@ class Options {
|
||||
*
|
||||
* @param spec The print job settings.
|
||||
*/
|
||||
Options (@NonNull JSONObject spec)
|
||||
PrintOptions (@NonNull JSONObject spec)
|
||||
{
|
||||
this.spec = spec;
|
||||
}
|
@ -39,7 +39,7 @@ import static android.print.PrintDocumentInfo.CONTENT_TYPE_DOCUMENT;
|
||||
/**
|
||||
* Document adapter to render and print PDF files.
|
||||
*/
|
||||
class PdfAdapter extends PrintDocumentAdapter {
|
||||
class PrintPdfAdapter extends PrintDocumentAdapter {
|
||||
|
||||
// The application context
|
||||
private @NonNull Context context;
|
||||
@ -52,7 +52,7 @@ class PdfAdapter extends PrintDocumentAdapter {
|
||||
*
|
||||
* @param context The context where to look for.
|
||||
*/
|
||||
PdfAdapter (@NonNull String path, @NonNull Context context)
|
||||
PrintPdfAdapter (@NonNull String path, @NonNull Context context)
|
||||
{
|
||||
this.path = path;
|
||||
this.context = context;
|
Loading…
Reference in New Issue
Block a user