Package-level declarations

Properties

Link copied to clipboard
private val PermissionState.isGranted: Boolean

Functions

Link copied to clipboard
fun CameraUseBinder(lifecycleOwner: LifecycleOwner, onUnbind: () -> Unit, onBind: () -> Unit)

Utility function that wraps a DisposableEffect and callbacks that should either cause the unbinding of the camera or trigger the re-binding of the camera in order to save resources. This contains the logic of the lifecycle stages where the camera should be un-binded (which is when the app is "minimized", in Android terms, in Lifecycle.Event.ON_PAUSE) and returned on Lifecycle.Event.ON_RESUME

Link copied to clipboard
Link copied to clipboard

This function has a lot of nested calls, but in the way it's now, it's more readable because it's more direct. Breaking it down into more util functions would make it cluttered even more, give the amount of common variables each component uses

Link copied to clipboard
Link copied to clipboard
private fun BoxWithConstraintsScope.HorizontalEdgeBars(cameraPreviewSize: Size, aligntment: Alignment)

Add bars in the sides so the background doesn't show, per example, when camera ratio == 4:3 and Gemin is enabled

Link copied to clipboard
private fun modifierAndAlignmentFor(cameraPreviewRatio: ResolutionSelector, geminiStatus: GeminiStatus): Pair<Modifier, Alignment>

Specifies the right modifier and alignment for 4_3 and 16_9 camera preview ratios when Gemini is enabled

Link copied to clipboard
private fun modifierSizeFor(cameraPreviewRatio: ResolutionSelector, geminiStatus: GeminiStatus): Modifier

Note: this is used for both the box with the camera & detection overlays and GeminiChatContainer

Link copied to clipboard
private fun startCameraAndPreviewView(cameraProvider: ProcessCameraProvider, cameraPreviewView: PreviewView, imageCaptureUseCase: ImageCapture, imageAnalysisUseCase: ImageAnalysis, lifecycleOwner: LifecycleOwner): Camera

Creates a camera PreviewView which is passed to the cameraProvider along with other UseCases (max 3), that are used with the camera