diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift index 0622220dcdaa..617ecc5120cd 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift @@ -13,6 +13,32 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable { } } + // This is public so it can be accessed from the BloggingPromptsFeatureDescriptionView. + private(set) lazy var cardFrameView: BlogDashboardCardFrameView = { + let frameView = BlogDashboardCardFrameView() + frameView.translatesAutoresizingMaskIntoConstraints = false + frameView.title = Strings.cardFrameTitle + frameView.icon = Style.frameIconImage + + // NOTE: Remove the logic for iOS 13 once we drop that version. + if #available (iOS 14.0, *) { + // assign an empty closure so the button appears. + frameView.onEllipsisButtonTap = {} + frameView.ellipsisButton.showsMenuAsPrimaryAction = true + frameView.ellipsisButton.menu = contextMenu + } else { + // Show a fallback implementation using `MenuSheetViewController`. + // iOS 13 doesn't support showing UIMenu programmatically. + frameView.onEllipsisButtonTap = { [weak self] in + self?.showMenuSheet() + } + } + + return frameView + }() + + // MARK: - Private Properties + /// When set to true, a "default" version of the card is displayed. That is: /// - `maxAvatarCount` number of avatars. /// - `maxAvatarCount` answer count. @@ -25,8 +51,6 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable { } } - // MARK: - Private Properties - // Used to present the menu sheet for contextual menu. // NOTE: Remove this once we drop support for iOS 13. private weak var presenterViewController: BlogDashboardViewController? = nil @@ -39,29 +63,6 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable { return stackView }() - private lazy var cardFrameView: BlogDashboardCardFrameView = { - let frameView = BlogDashboardCardFrameView() - frameView.translatesAutoresizingMaskIntoConstraints = false - frameView.title = Strings.cardFrameTitle - frameView.icon = Style.frameIconImage - - // NOTE: Remove the logic for iOS 13 once we drop that version. - if #available (iOS 14.0, *) { - // assign an empty closure so the button appears. - frameView.onEllipsisButtonTap = {} - frameView.ellipsisButton.showsMenuAsPrimaryAction = true - frameView.ellipsisButton.menu = contextMenu - } else { - // Show a fallback implementation using `MenuSheetViewController`. - // iOS 13 doesn't support showing UIMenu programmatically. - frameView.onEllipsisButtonTap = { [weak self] in - self?.showMenuSheet() - } - } - - return frameView - }() - // MARK: Top row views private lazy var promptLabel: UILabel = { diff --git a/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.swift b/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.swift index 02aa5347db42..efe2499d71d0 100644 --- a/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.swift +++ b/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.swift @@ -28,15 +28,17 @@ private extension BloggingPromptsFeatureDescriptionView { func configurePromptCard() { let promptCard = DashboardPromptsCardCell() promptCard.configureForExampleDisplay() - promptCard.translatesAutoresizingMaskIntoConstraints = false - promptCard.layer.cornerRadius = Style.cardCornerRadius - promptCard.layer.shadowOffset = Style.cardShadowOffset - promptCard.layer.shadowOpacity = Style.cardShadowOpacity - promptCard.layer.shadowRadius = Style.cardShadowRadius + // The DashboardPromptsCardCell doesn't resize dynamically when used in this context. + // So use its cardFrameView instead. + promptCard.cardFrameView.translatesAutoresizingMaskIntoConstraints = false + promptCard.cardFrameView.layer.cornerRadius = Style.cardCornerRadius + promptCard.cardFrameView.layer.shadowOffset = Style.cardShadowOffset + promptCard.cardFrameView.layer.shadowOpacity = Style.cardShadowOpacity + promptCard.cardFrameView.layer.shadowRadius = Style.cardShadowRadius - promptCardView.addSubview(promptCard) - promptCardView.pinSubviewToSafeArea(promptCard) + promptCardView.addSubview(promptCard.cardFrameView) + promptCardView.pinSubviewToAllEdges(promptCard.cardFrameView) } func configureDescription() { diff --git a/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.xib b/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.xib index 63dfc17cd737..c51b8e1ce7d2 100644 --- a/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.xib +++ b/WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.xib @@ -16,20 +16,20 @@ - + - + - + @@ -40,11 +40,11 @@ + - - + diff --git a/WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/CollapsableHeaderViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/CollapsableHeaderViewController.swift index 787ca2ba9359..b327349a642f 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/CollapsableHeaderViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/CollapsableHeaderViewController.swift @@ -508,6 +508,7 @@ class CollapsableHeaderViewController: UIViewController, NoResultsViewHost { func configureVerticalButtonView() { usesVerticalActionButtons = true + footerView.backgroundColor = .systemBackground footerHeightContraint.constant = footerHeight selectedStateButtonsContainer.axis = .vertical @@ -520,6 +521,7 @@ class CollapsableHeaderViewController: UIViewController, NoResultsViewHost { visualEffects.forEach { (visualEffect) in visualEffect.isHidden = true } + navigationController?.navigationBar.backgroundColor = .systemBackground } /// In scenarios where the content offset before content changes doesn't align with the available space after the content changes then the offset can be lost. In