GithubHelp home page GithubHelp logo

sdwwld / camerax Goto Github PK

View Code? Open in Web Editor NEW
99.0 99.0 18.0 7.98 MB

Android手机使用CameraX拍照,比Camera2更简洁,可以使用前置以及后置摄像头,自动对焦,以及证件照并实现剪切功能

Java 100.00%

camerax's People

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

Watchers

 avatar  avatar  avatar  avatar

camerax's Issues

崩溃

拍照完成 连续点击保存 崩溃了

刚打开相机,立刻返回,报空指针错误。

invoke virtual method 'void androidx.camera.lifecycle.ProcessCameraProvider.unbindAll()' on a null object reference
应该是下面方法的问题。

    @Override
    protected void onDestroy() {
        super.onDestroy();
        autoFocusCancel();
        cameraProvider.unbindAll();
//        if (cameraExecutor != null)
//            cameraExecutor.shutdown();
    }

调用打开时报错

调用库时一直在报这个错You need to use a Theme.AppCompat theme (or descendant) with this activity.,然后程序崩溃退出

未考虑只有一个摄像头的场景,导致一些设置时报错

我的设备是android开发板,没有内置前置后置摄像头,只有一个usb外置摄像头。因此摄像头数量为1.

setShowSwitch(true)时,切换按钮时会报错。
setFront(true)时,直接报错No available camera can be found

希望能对此场景进行异常处理,谢谢

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.