Loading packages/SystemUI/src/com/android/systemui/screencapture/record/largescreen/ui/compose/RegionBox.kt +48 −41 Original line number Diff line number Diff line Loading @@ -461,7 +461,7 @@ fun RegionBox( // button [RegionDimensionsPill]'s size, which is only known after measurement. SubcomposeLayout { constraints -> // First, measure the pill [RegionDimensionsPill] to get its actual height. val dimensionPillPlaceable = val dimensionPillMeasurables = subcompose("dimensionPill") { val pillVerticalSpacingDp = 16.dp RegionDimensionsPill( Loading @@ -469,8 +469,7 @@ fun RegionBox( heightPx = currentRect.height.roundToInt(), modifier = Modifier.layout { measurable, _ -> val pillInnerPlaceable = measurable.measure(Constraints()) val pillInnerPlaceable = measurable.measure(Constraints()) val pillVerticalSpacingPx = with(density) { pillVerticalSpacingDp.toPx() } // Center the pill horizontally relative to the region Loading Loading @@ -500,11 +499,19 @@ fun RegionBox( }, ) } .first() .measure(constraints) val dimensionPillPlaceable = if ( state.dragMode == DragMode.RESIZING || state.dragMode == DragMode.DRAWING ) { dimensionPillMeasurables.first().measure(constraints) } else { null } val dimensionPillHeightDp = with(density) { dimensionPillPlaceable.height.toDp() } dimensionPillPlaceable?.let { with(density) { it.height.toDp() } } ?: 0.dp // To determine the button's placement, we first need to know its size. We // subcompose the button once just to measure it. Loading Loading @@ -676,7 +683,7 @@ fun RegionBox( // SubcomposeLayout to the correct on-screen position, ensuring all // elements move as a single, synchronized unit. selectionBoxPlaceable.placeRelative(0, 0) dimensionPillPlaceable.placeRelative(0, 0) dimensionPillPlaceable?.placeRelative(0, 0) captureButtonPlaceable.placeRelative(0, 0) } } Loading Loading
packages/SystemUI/src/com/android/systemui/screencapture/record/largescreen/ui/compose/RegionBox.kt +48 −41 Original line number Diff line number Diff line Loading @@ -461,7 +461,7 @@ fun RegionBox( // button [RegionDimensionsPill]'s size, which is only known after measurement. SubcomposeLayout { constraints -> // First, measure the pill [RegionDimensionsPill] to get its actual height. val dimensionPillPlaceable = val dimensionPillMeasurables = subcompose("dimensionPill") { val pillVerticalSpacingDp = 16.dp RegionDimensionsPill( Loading @@ -469,8 +469,7 @@ fun RegionBox( heightPx = currentRect.height.roundToInt(), modifier = Modifier.layout { measurable, _ -> val pillInnerPlaceable = measurable.measure(Constraints()) val pillInnerPlaceable = measurable.measure(Constraints()) val pillVerticalSpacingPx = with(density) { pillVerticalSpacingDp.toPx() } // Center the pill horizontally relative to the region Loading Loading @@ -500,11 +499,19 @@ fun RegionBox( }, ) } .first() .measure(constraints) val dimensionPillPlaceable = if ( state.dragMode == DragMode.RESIZING || state.dragMode == DragMode.DRAWING ) { dimensionPillMeasurables.first().measure(constraints) } else { null } val dimensionPillHeightDp = with(density) { dimensionPillPlaceable.height.toDp() } dimensionPillPlaceable?.let { with(density) { it.height.toDp() } } ?: 0.dp // To determine the button's placement, we first need to know its size. We // subcompose the button once just to measure it. Loading Loading @@ -676,7 +683,7 @@ fun RegionBox( // SubcomposeLayout to the correct on-screen position, ensuring all // elements move as a single, synchronized unit. selectionBoxPlaceable.placeRelative(0, 0) dimensionPillPlaceable.placeRelative(0, 0) dimensionPillPlaceable?.placeRelative(0, 0) captureButtonPlaceable.placeRelative(0, 0) } } Loading