From 2de92a1101b73675d23b869ad051385284d346e9 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 24 Jun 2026 19:39:45 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../ds2/topnavigation/TangemTopNavigation.kt | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/core/ui/src/main/java/com/tangem/core/ui/ds2/topnavigation/TangemTopNavigation.kt b/core/ui/src/main/java/com/tangem/core/ui/ds2/topnavigation/TangemTopNavigation.kt index 14c26f0864..9473717202 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/ds2/topnavigation/TangemTopNavigation.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/ds2/topnavigation/TangemTopNavigation.kt @@ -96,16 +96,15 @@ fun TangemTopNavigation( end = 16.dp, ), content = { - // Each optional slot caches its last non-null content so the spring exit transition - // still has something to render after the caller flips it back to `null`. val displayedStart = rememberLastNonNull(startButton) - AnimatedVisibility( - modifier = Modifier.layoutId(SlotId.Start), - visible = startButton != null, - enter = slotEnter, - exit = slotExit, - ) { - displayedStart?.invoke() + Box(modifier = Modifier.layoutId(SlotId.Start)) { + AnimatedVisibility( + visible = startButton != null, + enter = slotEnter, + exit = slotExit, + ) { + displayedStart?.invoke() + } } Column( @@ -121,30 +120,32 @@ fun TangemTopNavigation( } val displayedGroup = rememberLastNonNull(endButtonsGroup) - AnimatedVisibility( - modifier = Modifier.layoutId(SlotId.Group), - visible = endButtonsGroup != null, - enter = slotEnter, - exit = slotExit, - ) { - displayedGroup?.let { group -> - TangemSurface(isMaterial = true, shape = CircleShape) { - Row( - horizontalArrangement = Arrangement.spacedBy(4.dp), - content = group, - ) + Box(modifier = Modifier.layoutId(SlotId.Group)) { + AnimatedVisibility( + visible = endButtonsGroup != null, + enter = slotEnter, + exit = slotExit, + ) { + displayedGroup?.let { group -> + TangemSurface(isMaterial = true, shape = CircleShape) { + Row( + horizontalArrangement = Arrangement.spacedBy(4.dp), + content = group, + ) + } } } } val displayedEnd = rememberLastNonNull(endButton) - AnimatedVisibility( - modifier = Modifier.layoutId(SlotId.End), - visible = endButton != null, - enter = slotEnter, - exit = slotExit, - ) { - displayedEnd?.invoke() + Box(modifier = Modifier.layoutId(SlotId.End)) { + AnimatedVisibility( + visible = endButton != null, + enter = slotEnter, + exit = slotExit, + ) { + displayedEnd?.invoke() + } } }, ) { measurables, constraints ->