Coder Social home page Coder Social logo

muddz / quickshot Goto Github PK

View Code? Open in Web Editor NEW
686.0 15.0 69.0 38.85 MB

[Moved to MavenCentral] Capture images of any View, SurfaceView or Bitmap from your Android app in: .jpg .png or .nomedia with simple oneliner codes.

License: Apache License 2.0

Java 100.00%
android screenshot capture bitmap android-library quickshot view jpg png

quickshot's People

Contributors

29jitender avatar muddz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickshot's Issues

cannot capture a webview contents

I am using Kotlin and trying to capture a webviews contents (including data outside of the screen area) the old java methods I use to use are depraciated (bless google for making things tough)
at first your library seemed like a godsend but I can not get it to work for my needs.

PixelShot.of(generator_webview).save()
captures a blank image

PixelShot.of(generator_webview.view().rootView).save()
captures an image as though the user has used thier phones screenshot function (ie full ui is shown, anything off screen is not etc) impressive how easy that is to do with your library but alas not my goal.

I also could not use the callback code as I can not implement a java class in a kotlin class...thats a lesser issue though

Rounded CardView problem

Hello!

I'm trying to make screenshot of layout with rounded CardView inside.

<androidx.cardview.widget.CardView android:innerRadius="0dp" android:shape="ring" app:cardElevation="0dp" app:cardCornerRadius="75dp">

It is rendered correctly on device, but is square on screenshot.Any idea how to fix it?

Path is not useful in api 29-android 10

@OverRide
public void onQuickShotSuccess(String path) {
File file = new File(path);
Uri uri = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID +
getString(R.string.file_provider_authority), file);
}
Path not working in android 10 in order to get uri and throws exception :
java.lang.IllegalArgumentException: Failed to find configured root that contains /Pictures/1587840596143.png

FileNotFoundException on Emulator

here is the logcat. This only happens on emulator. Device works fine.

W/System.err: java.io.FileNotFoundException:myapp/screenshots/1580444203567.png (No such file or directory)
W/System.err: at java.io.FileOutputStream.open0(Native Method)
W/System.err: at java.io.FileOutputStream.open(FileOutputStream.java:287)
W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:223)
W/System.err: at java.io.FileOutputStream.(FileOutputStream.java:171)
W/System.err: at com.muddzdev.quickshot.QuickShot$BitmapSaver.save(QuickShot.java:245)
W/System.err: at com.muddzdev.quickshot.QuickShot$BitmapSaver.doInBackground(QuickShot.java:315)
W/System.err: at com.muddzdev.quickshot.QuickShot$BitmapSaver.doInBackground(QuickShot.java:214)
W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:333)
W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
W/System.err: at java.lang.Thread.run(Thread.java:764)

Empty classes.jar

I've imported the library via gradle, but the classes.jar from the library seems to be empty, which means the classes cannot be resolved in my project:

screen shot 2018-09-21

Resources not found during linkage

I have this kind of error when trying to sync project after adding implementation of your lib.

Android resource linking failed
Output:  
.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.

.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.

.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:910: error: resource android:attr/fontVariationSettings not found.

.../app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:910: error: resource android:attr/ttcIndex not found.
error: failed linking references.

May be it's because of conflicts with another libs. I can send you a whole gradle file i you will need it

width and height must be > 0

I tried any view and I had the same problem. do you know why I get this error?

Process: com.hdts.present, PID: 30499 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hdts.present/com.hdts.present.activity.ActivityMain}: java.lang.IllegalArgumentException: width and height must be > 0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:1113) at android.graphics.Bitmap.createBitmap(Bitmap.java:1080) at android.graphics.Bitmap.createBitmap(Bitmap.java:1030) at android.graphics.Bitmap.createBitmap(Bitmap.java:991) at com.muddzdev.quickshot.QuickShot.getBitmap(QuickShot.java:179) at com.muddzdev.quickshot.QuickShot.save(QuickShot.java:207) at com.hdts.present.activity.ActivityMain.onCreate(ActivityMain.java:85) at android.app.Activity.performCreate(Activity.java:7893) at android.app.Activity.performCreate(Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283)

WRITE_EXTERNAL_STORAGE permission

else if (!Utils.isPermissionGranted(this.getAppContext())) {
            throw new SecurityException("Permission WRITE_EXTERNAL_STORAGE is missing");
        }

If I want to save to the internal memory of the app, this condition is redundant.
This condition must be removed.

Wrong logic for save file

I want to save to the internal memory of the phone and this line does not allow me to do it
File directory = new File(Environment.getExternalStorageDirectory(), path);
Let the user decide where to save
File directory = new File(path);
thanks

couldn't create bitmap of the surfaceview

I'm trying to capture surface view in camera but it is returning
couldn't create bitmap of the surfaceview
on onQuickShotFailed()

it there any reasons?
View current = preview.getSurfaceView(this);
QuickShot.of(current).setResultListener(this).save();

how to use this library to take full screen screenshot

hello, and sorry for this newbee question.

how can i use this library to take a full screen screenshot, i want to write a simplest screenshot app.

i've viewed the demo code and still don't know how to use the code like:

QuickShot.of(view).setResultListener(this)
                      .setFilename("Hello World")
                      .setPath("MyApp/Pictures")
                      .toPNG()
                      .save();

sorry for not understanding vary type of fragments..

if bothered closed this please.

of(bitmap) not working because of this

private Context getAppContext() {
    if (view == null) {
        throw new NullPointerException("Attempt to save the view failed: view was null");
    }
    return view.getContext().getApplicationContext();
}

............
new BitmapSaver(getAppContext(), getBitmap(), saveInternal, path, filename, fileExtension, jpgQuality, listener).execute();

Any plans for backporting to api 14+?

I haven't checked the library's internal code but have seen the demo app & its good!
I need the same type of functionality for my App but it supports 14+.

so any plans for backporting to 14+ or any Info. that can be helpfull for me to backport?

Getting error in QuickShotListener

Error ---
method

'io.github.muddz.quickshot.QuickShot

.setResultListener(io.github.muddz.qu ickshot.QuickShot.QuickShot Listener)'

exist 'io.github.muddz.quickshot.QuickShot'

cannot be applied to (com.saveview.MainActivity)'

Save full views (not only visible parts)

Question, my page has a lot of data, that doesnt fit your screen.
Is it possible to save the full view, and not only that whats visible in the screen??

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.