diff --git a/GliaWidgets/Sources/Theme/Theme+Chat.swift b/GliaWidgets/Sources/Theme/Theme+Chat.swift index c38392400..afab366e8 100644 --- a/GliaWidgets/Sources/Theme/Theme+Chat.swift +++ b/GliaWidgets/Sources/Theme/Theme+Chat.swift @@ -350,7 +350,7 @@ extension Theme { placeholderFont: font.bodyText, placeholderColor: color.baseShade, separatorColor: color.baseShade, - backgroundColor: color.baseLight, + backgroundColor: color.baseNeutral, mediaButton: mediaButton, sendButton: sendButton, uploadList: uploadListStyle, diff --git a/GliaWidgets/Sources/View/Chat/ChatView.DefineLayout.swift b/GliaWidgets/Sources/View/Chat/ChatView.DefineLayout.swift index d5354ab18..8c12be338 100644 --- a/GliaWidgets/Sources/View/Chat/ChatView.DefineLayout.swift +++ b/GliaWidgets/Sources/View/Chat/ChatView.DefineLayout.swift @@ -96,5 +96,13 @@ extension ChatView { bringSubviewToFront(entryWidgetOverlayView) bringSubviewToFront(entryWidgetContainerView) + + constraints += [ + messageEntryBottomArea.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor), + messageEntryBottomArea.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor), + messageEntryBottomArea.topAnchor.constraint(equalTo: messageEntryView.bottomAnchor), + messageEntryBottomArea.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor) + ] + insertSubview(messageEntryBottomArea, at: 0) } } diff --git a/GliaWidgets/Sources/View/Chat/ChatView.swift b/GliaWidgets/Sources/View/Chat/ChatView.swift index 481dd0959..fa57c37f3 100644 --- a/GliaWidgets/Sources/View/Chat/ChatView.swift +++ b/GliaWidgets/Sources/View/Chat/ChatView.swift @@ -31,6 +31,15 @@ class ChatView: EngagementView { let secureMessagingBottomBannerView = SecureMessagingBottomBannerView().makeView() let sendingMessageUnavailabilityBannerView = SendingMessageUnavailableBannerView().makeView() + // Instead of modifying message entry view's layout to resize, covering bottom safe area, + // thus affecting existing layout calculations, we add additional view just for that, + // keeping background color for it reactively in sync with message entry view's one. + lazy var messageEntryBottomArea = UIView().makeView { [weak messageEntryView] area in + messageEntryView?.publisher(for: \.backgroundColor).sink { [weak area] newColor in + area?.backgroundColor = newColor + }.store(in: &cancelBag) + } + let style: ChatStyle let environment: Environment