improve preview alignment

- center the PreviewView between the top action icons and the bottom mode switcher view for 4:3, 3:2 (video mode - SD) and 1:1 resolutions, when not full screen
This commit is contained in:
darthpaul
2022-11-25 07:52:10 +00:00
parent c901a3f88e
commit 47bc591035
5 changed files with 27 additions and 3 deletions

View File

@ -162,6 +162,8 @@ class CameraXPreview(
MySize(selectedQuality.width, selectedQuality.height)
}
listener.adjustPreviewView(resolution.requiresCentering())
val isFullSize = resolution.isFullScreen
previewView.scaleType = if (isFullSize) ScaleType.FILL_CENTER else ScaleType.FIT_CENTER
val rotation = previewView.display.rotation