CameraKit / camerakit-android

Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
https://camerakit.io
MIT License
5.37k stars 879 forks source link

Pinch to zoom is not working #42

Closed 911shanky closed 6 years ago

911shanky commented 7 years ago

It seems like "Pinch to Zoom" is not working.

Calling camera.setZoom(CameraKit.Constants.ZOOM_PINCH); doesn't work.

Can you resolve this issue quickly.

Moonbloom commented 7 years ago

This is not implemented yet, so there is nothing to "resolve".

If you read the README, you'll see:

Coming soon: Built-in pinch to zoom.

The code to enable the option is in the lib, but the functionality is not there yet.

android-dataticket commented 7 years ago

having huge client demand for this feature, hope it gets implemented soon

android-dataticket commented 7 years ago

i added pinch to zoom, pull #72

veeranath commented 7 years ago

Hi sir i am using this version of the library com.flurgle:camerakit:0.9.17 is pinch zoom is intergated as tried it .Its not working sir

veeranath commented 7 years ago

@android-dataticket i had tried your pull request but pinch to zoom is not working

samuelhehe commented 7 years ago

@android-dataticket i had tried your pull request but pinch to zoom is not working

adamwlarson commented 7 years ago

I took @android-dataticket pull request and integrated into my fork, I had to do a few things to get it working such as passing on the onTouchEvent, I also switched over to a gesture scale. It isn't working perfectly yet, but it is close. I am using jitpack and have a release tagged https://github.com/adamwlarson/CameraKit-Android/releases/tag/1.0.4

android-dataticket commented 7 years ago

sorry I've sorta abandoned this thread @adamwlarson - I made the pinch to zoom pull request and then had to make some more adjustments to get it to work and never updated the PR

looks like you figured it out, i think the creator of this library has abandoned it.. i gave up.

i have a working fork that i use in my app and haven't updated it in months, it gives me some memory issues here and there but it works for the most part, i wish this library was a little more up-kept by the creator but oh well, he's a busy young man i guess

KalpeshJadvani commented 7 years ago

any one to solved this problem plz tell me i was finding from long time

abhisheksingapore commented 7 years ago

Has anyone solved this issue, yet? Pinch to zoom is critical to my app and everything else about this fits my app well except the lack of zoom

android-dataticket commented 7 years ago

@abhisheksingapore @KalpeshJadvani I've updated the pull request with some changes that I made afterwards which work for my application, please note the commented areas which indicates code removal

aravindhkumar23 commented 7 years ago

@android-dataticket please confirm when can i get the pinch to zoom feature?

austinkettner commented 7 years ago

@android-dataticket Can you reOpen the PR? @aravindhkumar23 this is something we are working on, you can expect it in the next week.

android-dataticket commented 7 years ago

@austinkettner i am not that great of a programmer and what i've done is forked and tweaked to work with only my application.. for instance consider the following: in my PR, i remove DisplayOrientationDetector - some may need this, but i did not in my PR, i removed the handleFocus(event, params) method call, it gave issues when touching the screen to pinch i also add some quirky try catches and thread sleeps, but if you really want me to do a fresh PR, i will fork a new copy and upload the files that i've changed

austinkettner commented 7 years ago

@android-dataticket No worries! Thanks for the clarity, we are actually working on a solution to this today internally, so no PR needed! Really appreciate your willingness to help though! =)

aravindhkumar23 commented 7 years ago

Hi @austinkettner any updates regarding pinch to zoom feature? or any workaround to get it done? i have been waiting for this feature to be implemented in one of my project..

austinkettner commented 7 years ago

@aravindhkumar23 We actually just pushed this in the release/0.13.0 branch (https://github.com/wonderkiln/CameraKit-Android/tree/release/0.13.0), check it out via compile 'com.wonderkiln:camerakit:0.13.0-Snapshot'

aravindhkumar23 commented 7 years ago

when i use compile 'com.wonderkiln:camerakit:0.13.0-Snapshot' i get error msg when building gradle

Failed to resolve: com.wonderkiln:camerakit:0.13.0-Snapshot

when i use compile 'com.wonderkiln:camerakit:0.12.0' the gradle builds successfully but i face issue in using listener events

cannot find symbol class CameraListener

my app build.gradle is here

android {
    compileSdkVersion 27
    buildToolsVersion '27'
    defaultConfig {
        applicationId "com.smthing.nothing"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        dataBinding {
            enabled = true
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:27.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:27.0.0'
    compile 'com.github.yalantis:ucrop:2.2.1'
    compile 'com.wonderkiln:camerakit:0.12.0'
}

--i'am a newbie in android app development can u guys help me to solve this

austinkettner commented 7 years ago

There is a temporary issue with Bintray current preventing the builds from being accessible, you can use compile 'com.flurgle:camerakit:0.13.0-Snapshot' in the meantime. @aravindhkumar23

aravindhkumar23 commented 7 years ago

@austinkettner compile 'com.flurgle:camerakit:0.13.0-Snapshot' for zoom works but crashes on capture image #240 with log

Process: com.xx.yy, PID: 16519
                                                                      java.lang.NullPointerException
                                                                          at com.wonderkiln.camerakit.CameraKitImage.getBitmap(CameraKitImage.java:20)
                                                                          at com.xx.yy.InitCameraActivity$4.onImage(InitCameraActivity.java:155)
                                                                          at com.wonderkiln.camerakit.EventDispatcher$1.run(EventDispatcher.java:42)
                                                                          at android.os.Handler.handleCallback(Handler.java:733)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                          at android.os.Looper.loop(Looper.java:136)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5095)
                                                                          at java.lang.reflect.Method.invokeNative(Native Method)
                                                                          at java.lang.reflect.Method.invoke(Method.java:515)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
                                                                          at dalvik.system.NativeStart.main(Native Method)
emersoncloud commented 6 years ago

Pinch to zoom and capture image have been resolved in 1.0.0. Closing this issue.