Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
890565b
Refactor ZoomBar component to match updated design specifications
Kimblebee Oct 22, 2026
6acb4bb
Optimize ZoomBar memory usage and recomposition performance
Kimblebee Oct 22, 2026
5311050
Refactor ZoomBar active indicator to in-place appearing animation and…
Kimblebee Oct 22, 2026
a216b27
Apply Spotless formatting to ZoomBarComponents
Kimblebee Oct 22, 2026
987038a
Adopt Material theme default colors for ZoomBar indicator and expose …
Kimblebee Oct 22, 2026
717df91
Address PR review comments: defer zoom ratio read, restrict visibilit…
Kimblebee Oct 22, 2026
720f988
Merge remote-tracking branch 'origin/main' into kim/zoombar_ux_parity
Kimblebee Oct 22, 2026
244428f
Polish ZoomBar: add semantic radio button role, restrict preview visi…
Kimblebee Oct 22, 2026
ba9844d
Use explicit setter for DecimalFormat rounding mode
Kimblebee Oct 22, 2026
3a3b146
Optimize ZoomBar indicator, harden zoom pipeline, and fix lens-flip 1…
Kimblebee Oct 23, 2026
b46841a
Address PR review feedback on ZoomBar UX parity
Kimblebee Oct 26, 2026
a86d3e0
Merge remote-tracking branch 'origin/main' into kim/zoombar_ux_parity
Kimblebee Oct 26, 2026
d5c3492
Address PR review feedback on ZoomBar label, selection, and accessibi…
Kimblebee Oct 27, 2026
50eae95
Add TODO(#619) for label rotation modifier in ZoomBar
Kimblebee Oct 27, 2026
309e584
Include PR link in TODO(#619) comment in ZoomBar
Kimblebee Oct 27, 2026
5df0f99
Merge remote-tracking branch 'origin/main' into kim/zoombar_ux_parity
Kimblebee Oct 27, 2026
b10516e
Merge remote-tracking branch 'origin/main' into kim/zoombar_ux_parity
Kimblebee Oct 27, 2026
65fe495
Merge branch 'main' into kim/zoombar_ux_parity
Kimblebee Oct 28, 2026
2753a8a
Support LocalDisableAnimations for sliding indicator in ZoomBar
Kimblebee Oct 28, 2026
03a50cc
Merge branch 'main' into kim/zoombar_ux_parity
Kimblebee Oct 29, 2026
ee25199
Merge branch 'main' into kim/zoombar_ux_parity
Kimblebee Oct 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,14 @@ internal suspend fun runSingleCameraSession(
.collectLatest { zoomState ->
// TODO(b/405987189): remove checks after buggy zoomState is fixed
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
// Ignore the initial 1.0f zoomState emitted on camera bind
// unless 1.0f is the actual target zoom for this lens.
val targetZoomRatio =
(transientSettings.value ?: currentTransientSettings)
.zoomRatios[camera.cameraInfo.appLensFacing]
?: 1.0f
if (zoomState.zoomRatio != 1.0f ||
zoomState.zoomRatio == currentTransientSettings
.zoomRatios[
currentTransientSettings.primaryLensFacing
]
zoomState.zoomRatio == targetZoomRatio
) {
currentCameraState.update { old ->
old.copy(
Expand Down Expand Up @@ -1503,9 +1506,28 @@ private fun Preview.Builder.updateCameraStateWithCaptureResults(
) {
// update camerastate with zoom ratio
val newZoomRatio = result.get(CaptureResult.CONTROL_ZOOM_RATIO)
val targetZoomRatio =
transientSettings.value?.zoomRatios?.get(targetCameraInfo.appLensFacing)
?: 1.0f
val zoomState = targetCameraInfo.zoomState.value
val minZoom = zoomState?.minZoomRatio ?: 1.0f
val maxZoom = zoomState?.maxZoomRatio ?: 1.0f
val clampedTarget = targetZoomRatio.coerceIn(minZoom, maxZoom)
val isTargetEssentiallyOne = abs(clampedTarget - 1.0f) < 0.01f
currentCameraState.update { old ->
val currentZoomRatio = old.zoomRatios[targetCameraInfo.appLensFacing]
// When a lens is newly bound, initial capture results emit the hardware
// default 1.0f before cameraControl.setZoomRatio(initialZoomRatio) takes
// effect in the repeating request. Ignore those initial 1.0f frames if
// the lens is restoring a non-1.0f target zoom so the UI doesn't flash 1x.
val isInitialDefaultEmission =
currentZoomRatio == null &&
newZoomRatio != null &&
abs(newZoomRatio - 1.0f) < 0.001f &&
!isTargetEssentiallyOne
if (newZoomRatio != null &&
old.zoomRatios[targetCameraInfo.appLensFacing] != newZoomRatio
!isInitialDefaultEmission &&
currentZoomRatio != newZoomRatio
) {
Comment thread
Kimblebee marked this conversation as resolved.
Resolved
old.copy(
zoomRatios = old.zoomRatios
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import com.google.jetpackcamera.ui.components.capture.StabilizationIcon
import com.google.jetpackcamera.ui.components.capture.TestableSnackbar
import com.google.jetpackcamera.ui.components.capture.VIDEO_QUALITY_TAG
import com.google.jetpackcamera.ui.components.capture.VideoQualityIcon
import com.google.jetpackcamera.ui.components.capture.ZoomButtonRow
import com.google.jetpackcamera.ui.components.capture.ZoomBar
import com.google.jetpackcamera.ui.components.capture.ZoomStateManager
import com.google.jetpackcamera.ui.components.capture.debouncedOrientationFlow
import com.google.jetpackcamera.ui.components.capture.quicksettings.QuickSettingsScaffoldContent
Expand Down Expand Up @@ -526,7 +526,7 @@ internal fun ContentScreen(
val zoomLevelDisplayLambda = remember(zoomControlState) {
@Composable { modifier: Modifier ->
Column(modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally) {
ZoomButtonRow(
ZoomBar(
zoomControlUiState = zoomControlState.value,
onChangeZoom = { targetZoom ->
scope.launch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ private fun VerticalMaterialControls(
elapsedTimeDisplay(Modifier)

// zoom controls row
zoomControls(Modifier)
OverlapAwareStyleProvider {
zoomControls(Modifier)
}
// capture button row
Column {
Row(
Expand Down
Loading
Loading