-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(android): parity for screenshotcaptured event
#14311
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
Conversation
|
|
Thanks for the comments! I have to check how the iOS event is fired. I've added the window event and changed the example.
Update: the Ti.App event behaves the same now on both platforms. Android will also have the per Window event. |
prashantsaini1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
forgot to raise the version number here
apidoc/Titanium/UI/Window.yml
Outdated
| The listener for this event must be defined before this window | ||
| is opened. | ||
| - name: screenshotcaptured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed on a window instance and Android only? Isn't it on Ti.App now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it came for free as it is registered on the baseactivity and that way you use it on one window if needed and don't need to make the checks yourself to see if it is active and in front (see this comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just pass the window proxy as the "source" then? That's how they are usually identified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, sounds better. The Android event will now have current window as a source. iOS still needs to update the source.
Android parity for
screenshotcapturedusing Android 14registerScreenCaptureCallback: https://developer.android.com/about/versions/14/features/screenshot-detection#javaChanges:
screenshotcapturedeventTi.App.iOS.screenshotcapturedtoTi.App.screenshotcapturedTi.App.iOS.screenshotcapturedTest:
<uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE"/>to your tiapp.xml