doWithRotation

fun <R> CameraXCompatibleModel.doWithRotation(rotation: Int, function: () -> R): R

Convenience function to execute arbitrary code with a preliminary updated target rotation. After the code is executed, the target rotation is restored to its original value.

Parameters

rotation

target rotation to be set for the duration of the code execution

function

arbitrary code to be executed