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

[TIMOB-25565] Android: Prevent auto-focus callback from taking multiple pictures #9637

Merged
merged 8 commits into from Jan 24, 2018

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Nov 29, 2017

  • Prevent auto-focus callback from taking multiple pictures (once each time of focus)
  • Remove auto-focus callback after focusing
NOTE: this only occurs on some devices, such as the Moto G4
TEST CASE
var win = Ti.UI.createWindow(),
    view = Ti.UI.createView(),
    btn = Ti.UI.createButton({
        title:'TAKE PICTURE',
        bottom: 10
    });

function showCamera () {
    Ti.Media.showCamera({
        autohide: false,
        saveToPhotoGallery: true,
        overlay: view,
        success: function (e) {
            Ti.API.info('path: ' + e.media.nativePath);
        }
    });
}

// add button to overlay
btn.addEventListener('click', function () {
    Ti.Media.takePicture();
});
view.add(btn);

// request permissions and show camera overlay
win.addEventListener('open', function () {
    if (Ti.Media.hasCameraPermissions()) {
        showCamera();
    } else {
        Ti.Media.requestCameraPermissions(function (e) {
            e.success && showCamera();
        });
    }
});

win.open();

JIRA Ticket

Copy link
Contributor

@ypbnv ypbnv left a comment

Choose a reason for hiding this comment

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

PR: Pass

@build
Copy link
Contributor

build commented Dec 1, 2017

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@garymathews
Copy link
Contributor Author

no tests as this requires user input

@build build added the android label Dec 20, 2017
@lokeshchdhry
Copy link
Contributor

FR Passed.

Success callback is fired only once on android 7.1.1 & 6.0.1. Asked the customer to check on his Moto G4 (as we do not have the device) & it works fine for him.

Studio Ver: 5.0.0.201712081732
SDK Ver: 7.1.0 local build
OS Ver: 10.13.2
Xcode Ver: Xcode 9.2
Appc NPM: 4.2.11
Appc CLI: 7.0.1
Daemon Ver: 1.0.1
Ti CLI Ver: 5.0.14
Alloy Ver: 1.10.10
Node Ver: 8.9.1
NPM Ver: 5.5.1
Java Ver: 1.8.0_101
Devices: google Pixel --- Android 7.1.1
google Nexus 5 --- Android 6.0.1
Moto G4 --- Customer device

@build build added the android label Jan 16, 2018
@lokeshchdhry lokeshchdhry merged commit bd94d84 into tidev:master Jan 24, 2018
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.

None yet

7 participants