camera viewfinder

  
Standalone Composable and View based Viewfinder for Camera"

This table lists all the artifacts in the androidx.camera-viewfinder group.

Artifact Stable Release Release Candidate Beta Release Alpha Release
viewfinder-compose - - - 1.4.0-alpha11
viewfinder-core - - - 1.4.0-alpha11
viewfinder-view - - - 1.4.0-alpha11
This library was last updated on: December 11, 2024

Declaring dependencies

To add a dependency on camera-viewfinder, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

Groovy

dependencies {
    // Use to implement camera viewfinders
    
    implementation "androidx.camera.viewfinder:viewfinder-view:1.4.0-alpha11"
    implementation "androidx.camera.viewfinder:viewfinder-compose:1.4.0-alpha11"
    implementation "androidx.camera.viewfinder:viewfinder-core:1.4.0-alpha11"

}

Kotlin

dependencies {
    // Use to implement camera viewfinders
    implementation("androidx.camera.viewfinder:viewfinder-view:1.4.0-alpha11")
    implementation("androidx.camera.viewfinder:viewfinder-core:1.4.0-alpha11")
    implementation("androidx.camera.viewfinder:viewfinder-compose:1.4.0-alpha11")


}

For more information about dependencies, see Add build dependencies.

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.4

Version 1.4.0-alpha11

December 11, 2024

androidx.camera.viewfinder:viewfinder-compose:1.4.0-alpha11, androidx.camera.viewfinder:viewfinder-core:1.4.0-alpha11, and androidx.camera.viewfinder:viewfinder-view:1.4.0-alpha11 are released. Version 1.4.0-alpha11 contains these commits.

API Changes

  • viewfinder-core classes have been moved into packages that are consistent with the library they belong to. (I431c6)
  • CameraViewfinder.ScaleType has been moved to viewfinder-core so it can be reused with compose (I87ef1)
  • Deprecated CameraViewfinder classes are removed. Please use the new APIs which provide equivalent functionality. (I6e59a)

Version 1.4.0-alpha10

October 30, 2024

androidx.camera.viewfinder:viewfinder-compose:1.4.0-alpha10, androidx.camera.viewfinder:viewfinder-core:1.4.0-alpha10, and androidx.camera.viewfinder:viewfinder-view:1.4.0-alpha10 are released. Version 1.4.0-alpha10 contains these commits.

Version 1.4.0-alpha09

October 2, 2024

androidx.camera.viewfinder:viewfinder-compose:1.4.0-alpha09, androidx.camera.viewfinder:viewfinder-core:1.4.0-alpha09, and androidx.camera.viewfinder:viewfinder-view:1.4.0-alpha09 are released. Version 1.4.0-alpha09 contains these commits.

Version 1.4.0-alpha08

September 4, 2024

androidx.camera.viewfinder:viewfinder-compose:1.4.0-alpha08, androidx.camera.viewfinder:viewfinder-core:1.4.0-alpha08, and androidx.camera.viewfinder:viewfinder-view:1.4.0-alpha08 are released. Version 1.4.0-alpha08 contains these commits.

New Features

With the update to 1.4.0-alpha08, the CameraX Viewfinder artifact has been moved to its own library group. This change is necessary to improve the modularity and maintainability of the CameraX library.

If you were previously depending on androidx.camera:camera-viewfinder, androidx.camera:camera-viewfinder-compose or androidx.camera:camera-viewfinder-core, you will need to transition your dependencies to the following:

  • androidx.camera:camera-viewfinder -> androidx.camera.viewfinder:viewfinder-view
  • androidx.camera:camera-viewfinder-compose -> androidx.camera.viewfinder:viewfinder-compose
  • androidx.camera:camera-viewfinder-core -> androidx.camera.viewfinder:viewfinder-core

No code changes should be needed to make this transition. The old Viewfinder maven coordinates will no longer receive updates.

Additionally, if you are using Compose with CameraX, a new Compose-first library is now available in alpha: androidx.camera:camera-compose. This provides the CameraXViewfinder composable, which is a compose-idiomatic Viewfinder that adapts CameraX’s SurfaceRequest to Compose, similar to how PreviewView works for views.