Giter Site home page Giter Site logo

telescope's People

Contributors

jakewharton avatar jonathan-caryl avatar julioz avatar kageiit avatar kkamaraj avatar mattprecious avatar nightlynexus avatar pyricau avatar rciovati avatar swankjesse avatar tasomaniac avatar zacsweers 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telescope's Issues

Add a hook to do operations between trigger and screenshot being taken

I'd like to be able to clean up the status bar with Demo Mode before taking the screenshot.
Something could go in trigger() (maybe only invoked when the screenshot mode is not NONE?), and the implementer would call through to continue the capture.
I don't yet have a clear idea of what the mechanism would look like; this might be a fork if it's overly complex.

Initializing TelescopeLayout causes StrictMode violations

Getting the external cache directory causes strict mode errors for disk access on mainthread. It looks like it might be possible to defer that call until after the constructor, possibly until the SaveScreenshotTask. I can try and submit a PR fixing this up.

07-05 13:31:41.118 8906-8906/com.app.package D/StrictMode: StrictMode policy violation; ~duration=58 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=4784159 violation=2
                                                                                at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)
                                                                                at libcore.io.BlockGuardOs.statvfs(BlockGuardOs.java:297)
                                                                                at java.io.File.getTotalSpace(File.java:1126)
                                                                                at android.os.storage.StorageManager.getStorageLowBytes(StorageManager.java:943)
                                                                                at android.os.storage.VolumeInfo.buildStorageVolume(VolumeInfo.java:362)
                                                                                at com.android.server.MountService.getVolumeList(MountService.java:2758)
                                                                                at android.os.storage.IMountService$Stub.onTransact(IMountService.java:1676)
                                                                                at android.os.Binder.execTransact(Binder.java:453)
                                                                            # via Binder call with stack:
                                                                            android.os.StrictMode$LogStackTrace
                                                                                at android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1911)
                                                                                at android.os.Parcel.readExceptionCode(Parcel.java:1601)
                                                                                at android.os.Parcel.readException(Parcel.java:1570)
                                                                                at android.os.storage.IMountService$Stub$Proxy.getVolumeList(IMountService.java:790)
                                                                                at android.os.storage.StorageManager.getVolumeList(StorageManager.java:883)
                                                                                at android.os.Environment$UserEnvironment.getExternalDirs(Environment.java:83)
                                                                                at android.os.Environment$UserEnvironment.buildExternalStorageAppFilesDirs(Environment.java:127)
                                                                                at android.os.Environment.buildExternalStorageAppFilesDirs(Environment.java:539)
                                                                                at android.app.ContextImpl.getExternalFilesDirs(ContextImpl.java:465)
                                                                                at android.app.ContextImpl.getExternalFilesDir(ContextImpl.java:458)
                                                                                at android.content.ContextWrapper.getExternalFilesDir(ContextWrapper.java:213)
                                                                                at android.content.ContextWrapper.getExternalFilesDir(ContextWrapper.java:213)
                                                                                at com.mattprecious.telescope.TelescopeLayout.getScreenshotFolder(TelescopeLayout.java:392)
                                                                                at com.mattprecious.telescope.TelescopeLayout.<init>(TelescopeLayout.java:138)
                                                                                at com.mattprecious.telescope.TelescopeLayout.<init>(TelescopeLayout.java:80)
                                                                                at com.mattprecious.telescope.TelescopeLayout.<init>(TelescopeLayout.java:76)
                                                                                ...
                                                                                at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1189)
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2398)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                                at android.app.ActivityThread.access$900(ActivityThread.java:150)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                at android.os.Looper.loop(Looper.java:148)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:764)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

Resource acquired was not closed

StrictMode  E  A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding re
                            source leaks.
                         E  java.lang.Throwable: Explicit termination method 'release' not called
                         E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                         E      at android.view.Surface.setNativeObjectLocked(Surface.java:460)
                         E      at android.view.Surface.<init>(Surface.java:152)
                         E      at android.media.ImageReader.nativeGetSurface(Native Method)
                         E      at android.media.ImageReader.<init>(ImageReader.java:130)
                         E      at android.media.ImageReader.newInstance(ImageReader.java:100)
                         E      at com.mattprecious.telescope.TelescopeLayout$6.run(TelescopeLayout.java:615)
                         E      at android.os.Handler.handleCallback(Handler.java:739)
                         E      at android.os.Handler.dispatchMessage(Handler.java:95)
                         E      at android.os.Looper.loop(Looper.java:135)
                         E      at android.app.ActivityThread.main(ActivityThread.java:5254)
                         E      at java.lang.reflect.Method.invoke(Native Method)
                         E      at java.lang.reflect.Method.invoke(Method.java:372)
                         E      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                         E      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

looks like this is caused by imageReader not being closed at https://github.com/mattprecious/telescope/blob/master/telescope/src/main/java/com/mattprecious/telescope/TelescopeLayout.java#L616

found via strictmode

ScreenshotMode.NONE and progress border?

I have a class which extends TelescopeLayout. In the constructor, I call setProgressColor (to a blue color), setLens, and setScreenshotMode(ScreenshotMode.NONE). Everything works fine, except the progress border does not disappear after the screenshot is captured. If I instead call setScreenshotMode(ScreenshotMode.CANVAS), or do not call setScreenshotMode, the progress border correctly disappears after the screenshot is captured. Is this a bug, or is there something additional I should do in order to use ScreenshotMode.NONE correctly?

ActivityNotFoundException on HUWAI P8 / Huawei GRA-L09

We are currently developping an application, and using Telescope as a mean for our beta-testers to send us screenshots of problems, but Telescope is crashing with ActivityNotFoundException on a specific phone (namely a HUAWEI P8 aka Huawei GRA-L09).

This seems to be a known bug of this specific model/vendor so nothing can be done... except catching the exception when it happens (most likely with a bit of log and comment ;))!
Exception happens in com.matttpreciousRequestCaptureActivity, when calling the "startActivityForResult" in requestCapture method (line 45).

Bug known and reported to huawei here : http://support.huawei.com/huaweiconnect/enterprise/thread-146661-1-1.html?lang=en
Bug known and reported to Android here : https://code.google.com/p/android/issues/detail?id=178352

Attempt to cast generated internal exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList

03-01 10:01:53.078 12936-12936/com.mattprecious.telescope.sample W/Bundle: Key android.intent.extra.TEXT expected ArrayList<CharSequence> but value was a java.lang.String. The default value <null> was returned. 03-01 10:01:53.078 12936-12936/com.mattprecious.telescope.sample W/Bundle: Attempt to cast generated internal exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList at android.os.BaseBundle.getCharSequenceArrayList(BaseBundle.java:1067) at android.os.Bundle.getCharSequenceArrayList(Bundle.java:922) at android.content.Intent.getCharSequenceArrayListExtra(Intent.java:5471) at android.content.Intent.migrateExtraStreamToClipData(Intent.java:8173) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1572) at android.app.Activity.startActivityForResult(Activity.java:3921) at android.app.Activity.startActivityForResult(Activity.java:3881) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:784) at android.app.Activity.startActivity(Activity.java:4208) at android.app.Activity.startActivity(Activity.java:4176) at com.mattprecious.telescope.EmailLens.onCapture(EmailLens.java:71) at com.mattprecious.telescope.TelescopeLayout$SaveScreenshotTask.onPostExecute(TelescopeLayout.java:582) at com.mattprecious.telescope.TelescopeLayout$SaveScreenshotTask.onPostExecute(TelescopeLayout.java:543) at android.os.AsyncTask.finish(AsyncTask.java:651) at android.os.AsyncTask.-wrap1(AsyncTask.java) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

I am getting this error log here to long press with two finger:
https://goo.gl/9uRTkz

Support minSdkVersion="8"

Hey Matt,

I was just wondering if you intend backporting this library to minSdkVersion 8, or if you wouldn't mind accepting pull requests for these changes.

Thanks!

Access to `MediaProjection` APIs cause `SecurityException` crash on Android 10

Crash being reported only on Android 10. The stack trace is as follows:

Caused by java.lang.SecurityException

Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
android.os.Parcel.createException (Parcel.java:2071)
android.os.Parcel.readException (Parcel.java:2039)
android.os.Parcel.readException (Parcel.java:1987)
android.media.projection.IMediaProjection$Stub$Proxy.start (IMediaProjection.java:231)
android.media.projection.MediaProjection.<init> (MediaProjection.java:58)
android.media.projection.MediaProjectionManager.getMediaProjection (MediaProjectionManager.java:104)
com.mattprecious.telescope.TelescopeLayout$4.onReceive (TelescopeLayout.java:198)
android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args (LoadedApk.java:1550)
android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run (-.java:2)
android.os.Handler.handleCallback (Handler.java:883)
android.os.Handler.dispatchMessage (Handler.java:100)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:7356)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)

Make it easier to use telescope

Is there a possibility of using telescope (or modifying it to be used) without having to add the TelescopeLayout to each of the activity layouts?

I'm thinking of something like adding a bit of code to the BaseActivity and then being able to enable bug reporting for every screen in the app for alpha/beta builds.

Capturing dialogs

Hi guys,
Thanks for a great tool ๐Ÿ‘

What about capturing dialogs? Are there any plans for supporting this?

Update gif in README

I think the current one didn't use the palette intermediate image in ffmpeg.
I could send an updated gif, but I can't reproduce the current gif exactly easily since I can't tell Inbox that I have Matt's email.
If replication is important, there is a copypasta script here
If not, I can send a PR.

Google Maps in a screenshot

When I have Google Maps in the hierarchy the screenshot shows just a black surface. Here is the screenshot taken with Telescope.

telescope-2015-09-08-100034

I think #13 would fix this for > Lollipop devices.

Devices with only 2 fingers support

Hi,

I've been using the library and it is really helpful.
I have a rooted Nexus 6 with some gesture application. It was interfering with multi-touch events and 3+ pointerCount was not working. I had the same issue with another cheap Android device. Since I have 2 devices not working I started debugging the library and spent ~3 hours. ๐Ÿ˜„ I forgot that I had that gesture application installed.

Since I have multi-touch pan-zoom features in my app, I want to use pointerCount 3.
For the other cheap device, I used FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND in PackageManager to detect the device. This feature gives us that the device is capable to detect 5 fingers.

I assumed that there are no devices that detect only 3-4 fingers. It should be either 2 or 5 or 5+.

Do you think the library should have some built-in mechanism to detect this and adjust itself? Like make pointerCount 2 if the device is not capable to detect 5 fingers? Or at least give warning to developers.

What do you think? Depending on your comment, I would like to open a PR.

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.