-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(android): adding androidback property to showCamera #11270
Conversation
|
Fixes TIMOB-25633
34ba46c
to
234464e
Compare
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.
Code changes look ok.
I updated the commit message and the outdated since
value in the doc change.
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.
FR Passed: Camera does not close automatically unless Ti.Media.hideCamera();
is used. Also able to use the androidback
property.
Test case (alloy app):
index.js:
_.delay(function() {
Titanium.Media.showCamera({
overlay: Ti.UI.createView(),
androidback: function() {
// go back in stack history etc or
console.log("android back");
//Ti.Media.hideCamera(); // won't close the camera unless you use this
}
});
}, 4000);
$.index.open();
index.xml
<Alloy>
<Window class="container">
<ImageView id="img"></ImageView>
</Window>
</Alloy>
Every time back button is pressed the following is logged (unless Ti.Media.hideCamera();
is uncommented)
[INFO] �� � android back
Test Environment
MacOS Catalina: 10.15.5 Beta
Xcode: 11.4
Java Version: 1.8.0_131
Android NDK: 21.1.6273396-beta2
Node.js: 10.16.3
""NPM":"5.0.0-1","CLI":"8.0.0-master.10""
Pixel XL 10.0
JIRA: https://jira.appcelerator.org/browse/TIMOB-25633
Updating this PR #9697 for @AppWerft
This PR will add
androidback
toshowCamera()
on Android so you can use the phones back button inoverlay
mode. You have to take care ofhideCamera()
yourself inside the callback.Credit goes to @AppWerft for working on the original PR