Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces adaptive layout metadata (orientation and isCompact) to PreviewOverlaySlotScope and CaptureSlotScope to support responsive UI control sizing and arrangement in different container contexts. It also adds a new CaptureSlots.kt file containing layout slot definitions, placeholder controls, RTL policies, and tokens, along with a comprehensive test suite in CaptureSlotsTest.kt. No review comments were provided for this pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces the foundational slot-table and scope contracts for adaptive capture layouts in
:ui:components:capture. By bundling capture chrome controls into an@ImmutableCaptureSlotstable, extendingPreviewOverlaySlotScopeandCaptureSlotScopewithorientationandisCompactcontainer hints, definingCaptureRtlPolicy, and providing deterministicPlaceholderCaptureSlotsscaffolding, this slice unblocks independent review and geometry testing of side rails (kim/adaptive/side-rails), multi-posture layouts (kim/adaptive/layouts), and theCaptureScaffoldorchestrator (kim/adaptive/layout-orchestrator) with zero behavioral or visual change tomain.Key Changes
OverlapAwareStyleProvider.kt,CaptureScaffold.kt):orientation: Orientation = Orientation.HorizontalandisCompact: Boolean = falsetoPreviewOverlaySlotScopeand promoted both ontoCaptureSlotScope.OverlapAwareStyleProvider,CaptureSlotScopeImpl, and staticPreviewOverlaySlotScope(...)/CaptureSlotScope(...)preview/test factories to propagateorientationandisCompactalongside viewfinder-overlap styling.CaptureSlots.kt):@Immutable internal data class CaptureSlotsbundling 13PreviewOverlaySlotScope.(Modifier) -> Unitcontrol slots plussnackBaranderrorDialog, each defaulting to{}so omitted controls collapse cleanly.OverlapAwareCaptureSlotto bindOverlapAwareStyleProvider(orientation, isCompact)around individualCaptureSlotslambdas.CaptureSlots.kt):@Immutable data class CaptureRtlPolicy(mirrorSideRails = false, mirrorCompactBottomBar = false)andLocalCaptureRtlPolicy(staticCompositionLocalOf) so camera chrome stays anchored to its physical sides by default while remaining overridable in previews and tests.CaptureSlots.kt):CaptureSlotTokens,PlaceholderControlBox,PlaceholderViewfinder, andPlaceholderCaptureSlots(default/sideRail) that transpose control dimensions forOrientation.Verticalvs.Orientation.Horizontal, respond toisCompact, and recycle canonicalTestTagsconstants.Technical Notes
CaptureSlotsonPreviewOverlaySlotScopelets spatial posture layouts provideorientation,isCompact, and live viewfinder-overlap styling without depending onCaptureScaffoldStateorZoomStateManager, whileCaptureScaffoldseamlessly liftsPreviewOverlaySlotScopeintoCaptureSlotScopeviarememberCaptureSlotScope.OverlapAwareCaptureSlotapplies caller modifiers to the outerOverlapAwareStyleProviderBoxsoboundsInWindow()measures true slot placement.PlaceholderControlBoxapplies incomingmodifierbefore.size(width, height)so parent containers can prependModifier.sizeIn(...)to clamp dimensions in condensed windows.PlaceholderCaptureSlots.sideRail(tagQuickSettingsOverlay = false)omitsQUICK_SETTINGS_BOTTOM_SHEETon the inner placeholder by default so outer Quick Settings sheet/card containers inkim/adaptive/layoutscan own that tag without duplicate-node matcher failures.Not Included Yet
CaptureScaffoldwiring and 7-mode orchestration (kim/adaptive/layout-orchestrator).kim/adaptive/side-rails,kim/adaptive/layouts).#649indicator pill,#635toggle switch,#648Quick Settings card,#644zoom bar RTL polish).kim/adaptive/layout-rotation->kim/adaptive/content-gravity).Testing
CaptureSlotsTest(:ui:components:capture:testDebugUnitTest):captureRtlPolicy_defaultsToUnmirrored_andPropagatesThroughCompositionLocal— verifies default unmirrored policy andLocalCaptureRtlPolicysubtree overrides.captureSlotScope_exposesMetadata_overlapContainerColors_andDismissCallback— verifiesorientation,isCompact,isOverViewfinder,isRecording,dismissQuickSettings(), andBLACK_60/WHITE_20container colors.captureSlots_andPlaceholders_adaptAxisAndRecycleExistingTags— verifiesPREVIEW_DISPLAYviewfinder tagging,Modifier.sizeIn(maxHeight = 40.dp)clamping on vertical zoom placeholders, andtagQuickSettingsOverlaytoggling.