rotation checking

update size

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-06-27 12:52:38 -05:00
parent 1044282c33
commit 25ebcff2d9

View File

@ -266,6 +266,15 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
containerView.bridge_isAccessibilityElementBlock = { [weak self] in self?.onClickSubscriber != nil } containerView.bridge_isAccessibilityElementBlock = { [weak self] in self?.onClickSubscriber != nil }
containerView.accessibilityHint = "Double tap to open." containerView.accessibilityHint = "Double tap to open."
containerView.accessibilityLabel = nil containerView.accessibilityLabel = nil
NotificationCenter.default
.publisher(for: UIDevice.orientationDidChangeNotification)
.sink() { [weak self] _ in
DispatchQueue.main.asyncAfter(deadline: .now() + 0.001) { [weak self] in
guard let self else { return }
setNeedsUpdate()
}
}.store(in: &subscribers)
} }
@ -423,7 +432,7 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
heightConstraint?.activate() heightConstraint?.activate()
} }
} }
private func updateContainerView() { private func updateContainerView() {
applyBackgroundEffects() applyBackgroundEffects()
@ -469,8 +478,8 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
} else { } else {
containerView.applyAlignment(distribution == .fill ? .fill : alignment) containerView.applyAlignment(distribution == .fill ? .fill : alignment)
if let superview, distribution == .fill, !isPinnedHorizontallyToSuperview() { if distribution == .fill, !isPinnedHorizontallyToSuperview(), let size = horizontalPinnedSize() {
sizeContainerView(width: superview.frame.size.width) sizeContainerView(width: size.width)
} }
} }
} }