Skip to content

Preview rotated when app isn't in natural orientation - Android API 21+ / CameraX #144

@Murilo-Perrone

Description

@Murilo-Perrone

Whenever the view is rotated, preview image must rotate accordingly. Since that's not happening, we get a rotated preview window:
pic2

Experments in Fancycamera component with preview.setRotation(rotation: Int) were noneffective. This is actually a naive code problem, as mentioned in this stackoverflow topic. As explained in Husayn Hakeem's blog post, the recommended solution is to use PreviewView class from CameraX (see the implementation). Question is how to do that in a nativescript plugin?

NativeScript does not have a surface view, so the solution may to through programmatic binding of a child view. Possibly through NativeScript's PlaceHolder element, which allows the adding any native widget to the application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions