diff --git a/submodules/PremiumUI/Resources/coin b/submodules/PremiumUI/Resources/coin new file mode 100644 index 0000000000..a4c846051d Binary files /dev/null and b/submodules/PremiumUI/Resources/coin differ diff --git a/submodules/PremiumUI/Resources/coin.scn b/submodules/PremiumUI/Resources/coin.scn deleted file mode 100644 index 8ed3add4bf..0000000000 Binary files a/submodules/PremiumUI/Resources/coin.scn and /dev/null differ diff --git a/submodules/PremiumUI/Sources/BusinessPageComponent.swift b/submodules/PremiumUI/Sources/BusinessPageComponent.swift index c89b4a0a08..72ae9e5639 100644 --- a/submodules/PremiumUI/Sources/BusinessPageComponent.swift +++ b/submodules/PremiumUI/Sources/BusinessPageComponent.swift @@ -56,7 +56,7 @@ private final class HeaderComponent: Component { let coinSize = self.coin.update( transition: .immediate, - component: AnyComponent(PremiumCoinComponent(isIntro: true, isVisible: true, hasIdleAnimations: true)), + component: AnyComponent(PremiumCoinComponent(mode: .business, isIntro: true, isVisible: true, hasIdleAnimations: true)), environment: {}, containerSize: containerSize ) diff --git a/submodules/PremiumUI/Sources/PremiumCoinComponent.swift b/submodules/PremiumUI/Sources/PremiumCoinComponent.swift index 4d8c4e0bb3..b456daf8f6 100644 --- a/submodules/PremiumUI/Sources/PremiumCoinComponent.swift +++ b/submodules/PremiumUI/Sources/PremiumCoinComponent.swift @@ -9,7 +9,7 @@ import AppBundle import LegacyComponents import PremiumStarComponent -private let sceneVersion: Int = 3 +private let sceneVersion: Int = 4 private func deg2rad(_ number: Float) -> Float { return number * .pi / 180 @@ -19,19 +19,31 @@ private func rad2deg(_ number: Float) -> Float { return number * 180.0 / .pi } -class PremiumCoinComponent: Component { +final class PremiumCoinComponent: Component { + enum Mode { + case business + case affiliate + } + + let mode: Mode let isIntro: Bool let isVisible: Bool let hasIdleAnimations: Bool - init(isIntro: Bool, isVisible: Bool, hasIdleAnimations: Bool) { + init( + mode: Mode, + isIntro: Bool, + isVisible: Bool, + hasIdleAnimations: Bool + ) { + self.mode = mode self.isIntro = isIntro self.isVisible = isVisible self.hasIdleAnimations = hasIdleAnimations } static func ==(lhs: PremiumCoinComponent, rhs: PremiumCoinComponent) -> Bool { - return lhs.isIntro == rhs.isIntro && lhs.isVisible == rhs.isVisible && lhs.hasIdleAnimations == rhs.hasIdleAnimations + return lhs.mode == rhs.mode && lhs.isIntro == rhs.isIntro && lhs.isVisible == rhs.isVisible && lhs.hasIdleAnimations == rhs.hasIdleAnimations } final class View: UIView, SCNSceneRendererDelegate, ComponentTaggedView { @@ -350,7 +362,7 @@ class PremiumCoinComponent: Component { } if let material = node.geometry?.materials.first { - if node.name == "Logos" { + if ["Business", "Affiliate", "Plane"].contains(node.name) { material.metalness.intensity = 0.1 } else { material.metalness.intensity = 0.3 @@ -501,6 +513,22 @@ class PremiumCoinComponent: Component { self.sceneView.center = CGPoint(x: availableSize.width / 2.0, y: availableSize.height / 2.0) } + let visibleLogo: String + switch component.mode { + case .business: + visibleLogo = "Business" + case .affiliate: + visibleLogo = "Affiliate" + } + + if let scene = self.sceneView.scene, let node = scene.rootNode.childNode(withName: "star", recursively: false) { + for node in node.childNodes { + if ["Business", "Affiliate"].contains(node.name) { + node.isHidden = node.name != visibleLogo + } + } + } + self.hasIdleAnimations = component.hasIdleAnimations return availableSize diff --git a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift index 42c7996161..f4ab3e4e30 100644 --- a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift @@ -3218,6 +3218,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent { if case .business = context.component.mode { header = coin.update( component: PremiumCoinComponent( + mode: .business, isIntro: isIntro, isVisible: starIsVisible, hasIdleAnimations: state.hasIdleAnimations diff --git a/submodules/TelegramUI/Components/Gifts/GiftOptionsScreen/Sources/GiftOptionsScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftOptionsScreen/Sources/GiftOptionsScreen.swift index 185247b9f4..05e83749af 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftOptionsScreen/Sources/GiftOptionsScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftOptionsScreen/Sources/GiftOptionsScreen.swift @@ -944,8 +944,9 @@ final class GiftOptionsScreenComponent: Component { self.starsItemsOrigin = contentHeight let starsOptionSize = CGSize(width: optionWidth, height: 154.0) - contentHeight += ceil(CGFloat(starGifts.count) / 3.0) * starsOptionSize.height - contentHeight += 66.0 + let optionSpacing: CGFloat = 10.0 + contentHeight += ceil(CGFloat(starGifts.count) / 3.0) * (starsOptionSize.height + optionSpacing) + contentHeight += -optionSpacing + 66.0 } contentHeight += bottomContentInset diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContainerScreen.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContainerScreen.swift index 4d26f2e715..d0e5e368a2 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContainerScreen.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryContainerScreen.swift @@ -2057,7 +2057,7 @@ public class StoryContainerScreen: ViewControllerComponentContainer { ), navigationBarAppearance: .none, theme: .dark) self.statusBar.statusBarStyle = .White - self.navigationPresentation = .flatModal + self.navigationPresentation = .standaloneFlatModal self.blocksBackgroundWhenInOverlay = true self.automaticallyControlPresentationContextLayout = false self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: [.portrait]) diff --git a/submodules/TelegramUI/Sources/SharedAccountContext.swift b/submodules/TelegramUI/Sources/SharedAccountContext.swift index e80775fe0c..a9d2f8d9df 100644 --- a/submodules/TelegramUI/Sources/SharedAccountContext.swift +++ b/submodules/TelegramUI/Sources/SharedAccountContext.swift @@ -2333,6 +2333,8 @@ public final class SharedAccountContextImpl: SharedAccountContext { sendMessageImpl?(peer) } )) + controller.navigationPresentation = .modal + let _ = combineLatest(queue: Queue.mainQueue(), controller.result, options.get()) .startStandalone(next: { [weak controller] result, options in if let (peers, _, _, _, _, _) = result, let contactPeer = peers.first, case let .peer(peer, _, _) = contactPeer, let starsContext = context.starsContext { diff --git a/submodules/WebUI/Sources/FullscreenControlsComponent.swift b/submodules/WebUI/Sources/FullscreenControlsComponent.swift index e7a693b4b9..69dbd1716a 100644 --- a/submodules/WebUI/Sources/FullscreenControlsComponent.swift +++ b/submodules/WebUI/Sources/FullscreenControlsComponent.swift @@ -170,16 +170,17 @@ final class FullscreenControlsComponent: Component { let leftBackgroundSize = CGSize(width: 30.0, height: 30.0) let rightBackgroundSize = CGSize(width: 72.0, height: 30.0) - self.leftBackgroundView.updateColor(color: UIColor(white: 0.7, alpha: 0.35), transition: transition.containedViewLayoutTransition) - self.rightBackgroundView.updateColor(color: UIColor(white: 0.7, alpha: 0.35), transition: transition.containedViewLayoutTransition) + let backgroundColor: UIColor = component.statusBarStyle == .Black ? UIColor(white: 0.7, alpha: 0.35) : UIColor(white: 0.45, alpha: 0.25) + let textColor: UIColor = component.statusBarStyle == .Black ? UIColor(rgb: 0x808080) : .white + + self.leftBackgroundView.updateColor(color: backgroundColor, transition: transition.containedViewLayoutTransition) + self.rightBackgroundView.updateColor(color: backgroundColor, transition: transition.containedViewLayoutTransition) let rightBackgroundFrame = CGRect(origin: CGPoint(x: availableSize.width - component.insets.right - sideInset - rightBackgroundSize.width, y: 0.0), size: rightBackgroundSize) self.rightBackgroundView.update(size: rightBackgroundSize, cornerRadius: rightBackgroundFrame.height / 2.0, transition: transition.containedViewLayoutTransition) transition.setFrame(view: self.rightBackgroundView, frame: rightBackgroundFrame) var isAnimatingTextTransition = false - - let textColor: UIColor = component.statusBarStyle == .Black ? UIColor(rgb: 0x808080) : .white self.moreNode.updateColor(textColor, transition: .immediate) var additionalLeftWidth: CGFloat = 0.0