Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug 1058 #1067

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix bug 1058 #1067

wants to merge 3 commits into from

Conversation

haodi19
Copy link

@haodi19 haodi19 commented Apr 24, 2022

Description

Modify PdfToImageFragment.java: In method onImagesInGalleryClick(), the original image URI is an invalid and fixed URI "content:///storage/emulated/0/PDFfiles/". I replace this URI with the URI of the generated image, and create an util method file2Content in FileUtils.java to convert URI starts with"file://" to URI starts with "content://", and then save the images to the gallery.
Now "view images in gallery" button can show generated images in gallery.

{MG7V}IF)XNOW%%BO)R_SB9

Fixes #1058

Type of change

Just put an x in the [] which are valid.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested on Pixel 2 API 30 in Android Studio
Please describe the tests that you ran to verify your changes.

  • ./gradlew assembleDebug assembleRelease
  • ./gradlew checkstyle

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@codeclimate
Copy link

codeclimate bot commented Apr 24, 2022

Code Climate has analyzed commit ea1cfcb and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 4

View more on Code Climate.

import static swati4star.createpdf.util.Constants.PDF_TO_IMAGES;
import static swati4star.createpdf.util.Constants.REQUEST_CODE_FOR_WRITE_PERMISSION;
import static swati4star.createpdf.util.Constants.WRITE_PERMISSIONS;

Copy link
Contributor

Choose a reason for hiding this comment

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

Revert these unnecessary changes! (Any beautification work should be done in separate commit may or may not in single pull request)

import com.afollestad.materialdialogs.MaterialDialog;
import com.airbnb.lottie.LottieAnimationView;
import com.dd.morphingbutton.MorphingButton;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
Copy link
Contributor

Choose a reason for hiding this comment

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

[I repeat] Any beautification work should be done in separate commit may or may not in single pull request.

Copy link
Owner

Choose a reason for hiding this comment

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

+1

@@ -12,6 +13,7 @@
import android.print.PrintDocumentAdapter;
import android.print.PrintManager;
import android.provider.MediaStore;

Copy link
Contributor

Choose a reason for hiding this comment

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

[I repeat] Any beautification work should be done in separate commit may or may not in single pull request.

@@ -108,7 +110,6 @@ private void shareFile(ArrayList<Uri> uris) {
* opens a file in appropriate application
*
* @param path - path of the file to be opened
*
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

[I repeat] Any beautification work should be done in separate commit may or may not in single pull request.

Copy link
Owner

Choose a reason for hiding this comment

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

+1

* @param ext the file extension
* @param saveMethod the method that should be called when a filename is chosen
* @param ext the file extension
* @param saveMethod the method that should be called when a filename is chosen
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

...

@Swati4star
Copy link
Owner

Can you fix merge conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In PDF to Images function, feature "View Images in Gallery" could not show generated images in gallery.
3 participants