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

I have implemented updateConfiguration but the screen is not refreshing. #412

Open
eosr14 opened this issue Dec 29, 2020 · 0 comments
Open

Comments

@eosr14
Copy link

eosr14 commented Dec 29, 2020

Hello.
I am implementing a camera using Fotoapparat.
I want to change the iso, exposure, focus, and ImageRatio settings through updateConfiguration settings, but it doesn't work.
Please help me.

How did you initialize FA?

      binding?.let { binding ->
            fotoApparatCamera = Fotoapparat(
                    context = this@MainActivity,
                    view = binding.cvMainCamera,
                    focusView = binding.fvMainFocus,
                    logger = loggers(logcat()),
                    lensPosition = activeCamera.lensPosition,
                    cameraConfiguration = activeCamera.configuration,
                    cameraErrorCallback = {
                        Toast.makeText(
                                this@MainActivity,
                                "cameraErrorMessage: $it",
                                Toast.LENGTH_SHORT
                        ).show()
                        Log.e(TAG, "Camera Error : $it")
                    }
            )
        }

What did you expect?

    override fun onStart() {
        super.onStart()

        if (isPermissionsGranted) {
            fotoApparatCamera?.start()
            adjustViewsVisibility()
        }
    }

    override fun onStop() {
        super.onStop()

        if (isPermissionsGranted) {
            fotoApparatCamera?.stop()
        }
    } 
        is OnClickCameraIsoEvent -> {
                                    fotoApparatCamera?.updateConfiguration(
                                            UpdateConfiguration(
                                                    sensorSensitivity = manualSensorSensitivity(it.iso)
                                            )
                                    )
                                }

       is OnClickCameraExposureEvent -> {
                                    fotoApparatCamera?.updateConfiguration(
                                            UpdateConfiguration
                                                    .builder()
                                                    .exposureCompensation { it.exposure }
                                                    .build()
                                    )
                                }


          is OnClickCameraFocusEvent -> {
                                    fotoApparatCamera?.updateConfiguration(
                                            UpdateConfiguration
                                                    .builder()
                                                    .focusMode {
                                                        when (it.cameraFocusMode) {
                                                            CameraFocusMode.FIXED -> FocusMode.Fixed
                                                            CameraFocusMode.INFINITY -> FocusMode.Infinity
                                                            CameraFocusMode.MACRO -> FocusMode.Macro
                                                            CameraFocusMode.AUTO -> FocusMode.Auto
                                                            CameraFocusMode.CONTINUOUS_FOCUS_PICTURE -> FocusMode.ContinuousFocusPicture
                                                            CameraFocusMode.CONTINUOUS_FOCUS_VIDEO -> FocusMode.ContinuousFocusVideo
                                                            CameraFocusMode.EDOF -> FocusMode.Edof
                                                        }
                                                    }
                                                    .build()
                                    )
                                }

I implemented updateConfiguration, but the screen is not refreshing.
Help me

Context:

  • FA version: 2.7.0
  • Devices/APIs affected: samsung galaxy note 10 / OS 10
  • any other relevant information:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant