RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 405 forks source link

Updata Camera Configuration in JAVA not working #183

Closed monowar1993 closed 6 years ago

monowar1993 commented 6 years ago

What am I trying to achieve or the steps to reproduce?

I have been trying to update camera configuration. But it was not updating when I used JAVA codes. But working fine with kotlin. Tested on you Sample app also.

How did I initialize FA?

Cameraconfiguration = CameraConfiguration.builder()
                .focusMode(firstAvailable(continuousFocusPicture(), autoFocus(), fixed()))
                //.flash(firstAvailable(autoFlash(), torch(), off(), on()))
                .flash(off())
                .previewResolution(highestResolution())
                .previewFpsRange(highestFps())
                .photoResolution(highestResolution())
                .jpegQuality(highestQuality())
                .antiBandingMode(auto())
                .sensorSensitivity(highestSensorSensitivity())
                .build();

Fotoapparat fotoapparat = new Fotoapparat(getActivity(), binding.cameraView, binding.focusView, back(),
ScaleType.CenterCrop, configuration, e -> {
            e.printStackTrace();
            return null;
        }, loggers(logcat(), fileLogger(getActivity())));

and update using fotoapparat.updateConfiguration(UpdateConfiguration.builder().flash(on()).build()); this seems not to be working. As the parameters are not updated. I tried to change the photoResolution() also. But parameters are not updated. They are same as the way I initialized them. but bellow is working fine fotoapparat.updateConfiguration(configuration.builder().flash(on()).build());

What did I expect?

I expected that fotoapparat.updateConfiguration(UpdateConfiguration.builder().flash(on()).build()); this code would work perfectly on JAVA as it is working fine in kotlin.

Context:

Many thanks for making such a good Camera Library

Diolor commented 6 years ago

Thanks for reporting this! Will be fixed in the next release