Skip to content

Commit

Permalink
Allow build on AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
cdipierr committed Dec 1, 2021
1 parent aa85afd commit 091a9b5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/android/PrintAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.print.PrintAttributes;
import android.print.PrintDocumentAdapter;
import android.print.PrintDocumentInfo;
import android.support.annotation.NonNull;
import android.support.v4.print.PrintHelper;
import androidx.annotation.NonNull;
import androidx.print.PrintHelper;

import java.io.FileOutputStream;
import java.io.IOException;
Expand Down
4 changes: 2 additions & 2 deletions src/android/PrintContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.io.BufferedInputStream;
import java.io.IOException;
Expand Down
4 changes: 2 additions & 2 deletions src/android/PrintIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.util.Base64;

import java.io.ByteArrayInputStream;
Expand Down
6 changes: 3 additions & 3 deletions src/android/PrintManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.print.PrintAttributes;
import android.print.PrintDocumentAdapter;
import android.print.PrintJob;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.print.PrintHelper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.print.PrintHelper;
import android.webkit.CookieManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
Expand Down
12 changes: 6 additions & 6 deletions src/android/PrintOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Licensed to the Apache Software Foundation (ASF) under one
package de.appplant.cordova.plugin.printer;

import android.print.PrintAttributes;
import android.support.annotation.NonNull;
import android.support.v4.print.PrintHelper;
import androidx.annotation.NonNull;
import androidx.print.PrintHelper;

import org.json.JSONObject;

Expand All @@ -35,10 +35,10 @@ Licensed to the Apache Software Foundation (ASF) under one
import static android.print.PrintAttributes.MediaSize.UNKNOWN_LANDSCAPE;
import static android.print.PrintAttributes.MediaSize.UNKNOWN_PORTRAIT;
import static android.print.PrintDocumentInfo.PAGE_COUNT_UNKNOWN;
import static android.support.v4.print.PrintHelper.ORIENTATION_LANDSCAPE;
import static android.support.v4.print.PrintHelper.ORIENTATION_PORTRAIT;
import static android.support.v4.print.PrintHelper.SCALE_MODE_FILL;
import static android.support.v4.print.PrintHelper.SCALE_MODE_FIT;
import static androidx.print.PrintHelper.ORIENTATION_LANDSCAPE;
import static androidx.print.PrintHelper.ORIENTATION_PORTRAIT;
import static androidx.print.PrintHelper.SCALE_MODE_FILL;
import static androidx.print.PrintHelper.SCALE_MODE_FIT;

/**
* Wrapper for the print job settings.
Expand Down
4 changes: 2 additions & 2 deletions src/android/PrintProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.print.PageRange;
import android.print.PrintAttributes;
import android.print.PrintDocumentAdapter;
import android.support.annotation.NonNull;
import android.support.v4.print.PrintHelper;
import androidx.annotation.NonNull;
import androidx.print.PrintHelper;

/**
* Simple delegate class to have access to the onFinish method.
Expand Down
4 changes: 2 additions & 2 deletions src/android/Printer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Licensed to the Apache Software Foundation (ASF) under one

package de.appplant.cordova.plugin.printer;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.webkit.WebView;

import org.apache.cordova.CallbackContext;
Expand Down

6 comments on commit 091a9b5

@asad1590
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot it worked for me.

@anees-synavos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i re-run project it revert everything to android

@anees-synavos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any solution?

@tanhatariq
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton, it worked for me..

@tanhatariq
Copy link

@tanhatariq tanhatariq commented on 091a9b5 Aug 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i re-run project it revert everything to android

@anees-synavos clean and rebuild or manually copy .java files to android platform folder at relevant path

@shochberg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this fix!

Please sign in to comment.