From 4bf439d5ecbc0829f287fb576bfac20bd6cd9031 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Wed, 13 Sep 2023 17:13:15 +0200 Subject: [PATCH] Fix top padding in room list when app is opened in offline mode (#1299) * Fix top padding in room list when app is opened in offline mode * Fix `avatarBloom` not passing the `bottomSoftEdgeColor` to `bloom` --- changelog.d/1297.bugfix | 1 + .../networkmonitor/api/ui/ConnectivityIndicatorView.kt | 4 +++- .../android/libraries/designsystem/components/Bloom.kt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog.d/1297.bugfix diff --git a/changelog.d/1297.bugfix b/changelog.d/1297.bugfix new file mode 100644 index 0000000000..3b7d61fd8d --- /dev/null +++ b/changelog.d/1297.bugfix @@ -0,0 +1 @@ +Fix top padding in room list when app is opened in offline mode. diff --git a/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/ConnectivityIndicatorView.kt b/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/ConnectivityIndicatorView.kt index 7c03be6a41..dd586d4576 100644 --- a/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/ConnectivityIndicatorView.kt +++ b/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/ConnectivityIndicatorView.kt @@ -109,7 +109,9 @@ fun ConnectivityIndicatorContainer( } else { WindowInsets.statusBars.asPaddingValues().calculateTopPadding() + 6.dp } - val target = remember(isOnline) { if (isOnline) 0.dp else statusBarTopPadding } + val target = remember(isIndicatorVisible.targetState, statusBarTopPadding) { + if (!isIndicatorVisible.targetState) 0.dp else statusBarTopPadding + } val animationStateOffset by animateDpAsState( targetValue = target, animationSpec = spring( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt index 2a178af000..b23c0cc2bb 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt @@ -363,6 +363,7 @@ fun Modifier.avatarBloom( blurSize = blurSize, offset = offset, clipToSize = clipToSize, + bottomSoftEdgeColor = bottomSoftEdgeColor, bottomSoftEdgeHeight = bottomSoftEdgeHeight, bottomSoftEdgeAlpha = bottomSoftEdgeAlpha, alpha = alpha,