diff --git a/submodules/Components/ViewControllerComponent/Sources/ViewControllerComponent.swift b/submodules/Components/ViewControllerComponent/Sources/ViewControllerComponent.swift index e017ad6411..91c2503013 100644 --- a/submodules/Components/ViewControllerComponent/Sources/ViewControllerComponent.swift +++ b/submodules/Components/ViewControllerComponent/Sources/ViewControllerComponent.swift @@ -239,12 +239,18 @@ open class ViewControllerComponentContainer: ViewController { } } + public enum BaseNavigationColors { + case plain + case blocks + } + public var node: Node { return self.displayNode as! Node } private var presentationData: PresentationData private var theme: Theme + private let baseNavigationColors: BaseNavigationColors public private(set) var component: AnyComponent private var presentationDataDisposable: Disposable? @@ -260,10 +266,12 @@ open class ViewControllerComponentContainer: ViewController { statusBarStyle: StatusBarStyle = .default, presentationMode: PresentationMode = .default, theme: Theme = .default, - updatedPresentationData: (initial: PresentationData, signal: Signal)? = nil + updatedPresentationData: (initial: PresentationData, signal: Signal)? = nil, + baseNavigationColors: BaseNavigationColors = .plain, ) where C.EnvironmentType == ViewControllerComponentContainer.Environment { self.component = AnyComponent(component) self.theme = theme + self.baseNavigationColors = baseNavigationColors var effectiveUpdatedPresentationData: (initial: PresentationData, signal: Signal) if let updatedPresentationData { @@ -282,7 +290,7 @@ open class ViewControllerComponentContainer: ViewController { case .transparent: navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, hideBackground: true, hideBadge: false, hideSeparator: true, style: .glass) case .default: - navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, style: .glass) + navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, hideBackground: false, hideBadge: false, hideSeparator: true, style: .glass, edgeEffectColor: self.baseNavigationColors == .blocks ? self.presentationData.theme.list.itemBlocksBackgroundColor : nil) } super.init(navigationBarPresentationData: navigationBarPresentationData) @@ -297,10 +305,12 @@ open class ViewControllerComponentContainer: ViewController { statusBarStyle: StatusBarStyle = .default, presentationMode: PresentationMode = .default, theme: Theme = .default, - updatedPresentationData: (initial: PresentationData, signal: Signal) + updatedPresentationData: (initial: PresentationData, signal: Signal), + baseNavigationColors: BaseNavigationColors = .plain ) where C.EnvironmentType == ViewControllerComponentContainer.Environment { self.component = AnyComponent(component) self.theme = theme + self.baseNavigationColors = baseNavigationColors let presentationData = updatedPresentationData.initial self.presentationData = presentationData @@ -312,7 +322,7 @@ open class ViewControllerComponentContainer: ViewController { case .transparent: navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, hideBackground: true, hideBadge: false, hideSeparator: true, style: .glass) case .default: - navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, style: .glass) + navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, hideBackground: false, hideBadge: false, hideSeparator: true, style: .glass, edgeEffectColor: self.baseNavigationColors == .blocks ? self.presentationData.theme.list.itemBlocksBackgroundColor : nil) } super.init(navigationBarPresentationData: navigationBarPresentationData) @@ -360,7 +370,7 @@ open class ViewControllerComponentContainer: ViewController { case .transparent: navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, hideBackground: true, hideBadge: false, hideSeparator: true, style: .glass) case .default: - navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, style: .glass) + navigationBarPresentationData = NavigationBarPresentationData(presentationData: presentationData, hideBackground: false, hideBadge: false, hideSeparator: true, style: .glass, edgeEffectColor: strongSelf.baseNavigationColors == .blocks ? strongSelf.presentationData.theme.list.itemBlocksBackgroundColor : nil) } if let navigationBarPresentationData { strongSelf.navigationBar?.updatePresentationData(navigationBarPresentationData, transition: .immediate) diff --git a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift index 783f4e1160..49ee25c73b 100644 --- a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift @@ -3958,7 +3958,12 @@ public final class PremiumIntroScreen: ViewControllerComponentContainer { var copyLinkImpl: ((String) -> Void)? var shareLinkImpl: ((String) -> Void)? - self.overNavigationContainer = UIView() + self.overNavigationContainer = SparseContainerView() + + var baseNavigationColors: BaseNavigationColors = .plain + if case .emojiStatus = source { + baseNavigationColors = .blocks + } super.init(component: PremiumIntroScreenComponent( overNavigationContainer: self.overNavigationContainer, @@ -3985,7 +3990,7 @@ public final class PremiumIntroScreen: ViewControllerComponentContainer { shareLink: { link in shareLinkImpl?(link) } - ), navigationBarAppearance: .default, presentationMode: modal ? .modal : .default, theme: forceDark ? .dark : .default, updatedPresentationData: screenContext.updatedPresentationData) + ), navigationBarAppearance: .default, presentationMode: modal ? .modal : .default, theme: forceDark ? .dark : .default, updatedPresentationData: screenContext.updatedPresentationData, baseNavigationColors: baseNavigationColors) self._hasGlassStyle = true @@ -4065,7 +4070,7 @@ public final class PremiumIntroScreen: ViewControllerComponentContainer { } if let navigationBar = self.navigationBar { - navigationBar.view.insertSubview(self.overNavigationContainer, aboveSubview: navigationBar.backgroundView) + navigationBar.customOverBackgroundContentView.addSubview(self.overNavigationContainer) } } diff --git a/submodules/ShareController/Sources/ShareControllerNode.swift b/submodules/ShareController/Sources/ShareControllerNode.swift index 3203932381..40330e5e34 100644 --- a/submodules/ShareController/Sources/ShareControllerNode.swift +++ b/submodules/ShareController/Sources/ShareControllerNode.swift @@ -547,7 +547,7 @@ final class ShareControllerNode: ViewControllerTracingNode, ASScrollViewDelegate if showNamesValue { return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: theme.contextMenu.primaryColor) } else { - return nil + return UIImage() } }, action: { _, _ in self?.showNames.set(true) @@ -556,7 +556,7 @@ final class ShareControllerNode: ViewControllerTracingNode, ASScrollViewDelegate if !showNamesValue { return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Check"), color: theme.contextMenu.primaryColor) } else { - return nil + return UIImage() } }, action: { _, _ in self?.showNames.set(false) diff --git a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift index c712d7796c..0f9f22faa0 100644 --- a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift +++ b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift @@ -84,8 +84,8 @@ public extension NavigationBarPresentationData { self.init(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme, style: style, glassStyle: glassStyle), strings: NavigationBarStrings(presentationStrings: presentationData.strings)) } - convenience init(presentationData: PresentationData, hideBackground: Bool, hideBadge: Bool, hideSeparator: Bool = false, style: NavigationBar.Style = .legacy, glassStyle: NavigationBar.GlassStyle = .default) { - self.init(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme, hideBackground: hideBackground, hideBadge: hideBadge, hideSeparator: hideSeparator, edgeEffectColor: hideBackground ? .clear : nil, style: style, glassStyle: glassStyle), strings: NavigationBarStrings(presentationStrings: presentationData.strings)) + convenience init(presentationData: PresentationData, hideBackground: Bool, hideBadge: Bool, hideSeparator: Bool = false, style: NavigationBar.Style = .legacy, glassStyle: NavigationBar.GlassStyle = .default, edgeEffectColor: UIColor? = nil) { + self.init(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme, hideBackground: hideBackground, hideBadge: hideBadge, hideSeparator: hideSeparator, edgeEffectColor: hideBackground ? .clear : edgeEffectColor, style: style, glassStyle: glassStyle), strings: NavigationBarStrings(presentationStrings: presentationData.strings)) } convenience init(presentationTheme: PresentationTheme, presentationStrings: PresentationStrings, style: NavigationBar.Style = .legacy, glassStyle: NavigationBar.GlassStyle = .default) {