diff --git a/GliaWidgets/Sources/Component/Bubble/BubbleView.swift b/GliaWidgets/Sources/Component/Bubble/BubbleView.swift index 6eccc7bc9..1f5d4bf27 100644 --- a/GliaWidgets/Sources/Component/Bubble/BubbleView.swift +++ b/GliaWidgets/Sources/Component/Bubble/BubbleView.swift @@ -64,7 +64,8 @@ class BubbleView: BaseView { func showOnHoldView() { onHoldView.removeFromSuperview() - + // In case of badge-view being shown + // place on-hold view under it. if let badgeView { insertSubview(onHoldView, belowSubview: badgeView) } else { @@ -147,7 +148,9 @@ class BubbleView: BaseView { private func setView(_ view: UIView) { subviews.first?.removeFromSuperview() view.isUserInteractionEnabled = false - + // Insert view at the zero index + // to be under other views, like on-hold + // and unread-count views. insertSubview(view, at: 0) view.layoutInSuperview().activate() } diff --git a/GliaWidgets/Sources/Component/Bubble/BubbleWindow.swift b/GliaWidgets/Sources/Component/Bubble/BubbleWindow.swift index 56c9fcf45..4848ece7f 100644 --- a/GliaWidgets/Sources/Component/Bubble/BubbleWindow.swift +++ b/GliaWidgets/Sources/Component/Bubble/BubbleWindow.swift @@ -107,6 +107,10 @@ private class BubbleViewController: UIViewController { right: edgeInset ) ) + // Once `bubbleView` is added to view hierarchy, + // we re-render it's `isVisitorOnHold` state, + // to properly display it. Otherwise it may + // not show up due to invalid ('zero') size. let isOnHold = bubbleView.isVisitorOnHold bubbleView.isVisitorOnHold = isOnHold }