From 4251ee2c1b931c83f35625f6818c89bcc3c99e3e Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 9 Jun 2022 20:18:00 +0400 Subject: [PATCH] Various fixes --- Telegram/Telegram-iOS/en.lproj/Localizable.strings | 1 + .../Source/Navigation/NavigationController.swift | 1 - .../Sources/ChannelVisibilityController.swift | 14 +++++++++++++- .../PremiumUI/Sources/PremiumIntroScreen.swift | 4 ++-- .../PremiumUI/Sources/PremiumStarComponent.swift | 7 ++++++- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index c827175c20..0f820d369f 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -7558,6 +7558,7 @@ Sorry for the inconvenience."; "Chat.MultipleTypingMore" = "%@ and %@ others"; "Group.Username.RemoveExistingUsernamesOrExtendInfo" = "You have reserved too many public links. Try revoking a link from an older group or channel, or upgrade to **Telegram Premium** to double the limit to **%@** public links."; +"Group.Username.RemoveExistingUsernamesNoPremiumInfo" = "You have reserved too many public links. Try revoking the link from an older group or channel. We are working to let you increase this limit in the future."; "Group.Username.RemoveExistingUsernamesFinalInfo" = "You have reserved too many public links. Try revoking the link from an older group or channel, or create a private one instead."; "OldChannels.TooManyCommunitiesText" = "You are a member of **%@** groups and channels. Please leave some before joining a new one or upgrade to **Telegram Premium** to double the limit to **%@** groups and channels."; diff --git a/submodules/Display/Source/Navigation/NavigationController.swift b/submodules/Display/Source/Navigation/NavigationController.swift index baa8364763..eaacde87bd 100644 --- a/submodules/Display/Source/Navigation/NavigationController.swift +++ b/submodules/Display/Source/Navigation/NavigationController.swift @@ -910,7 +910,6 @@ open class NavigationController: UINavigationController, ContainableController, visibleRootModalDismissProgress = effectiveRootModalDismissProgress additionalModalFrameProgress = 1.0 - topModalDismissProgress } else { -// effectiveRootModalDismissProgress = ((topModalIsFlat && !topFlatModalHasProgress) || isLandscape) ? 1.0 : topModalDismissProgress effectiveRootModalDismissProgress = topModalDismissProgress visibleRootModalDismissProgress = effectiveRootModalDismissProgress additionalModalFrameProgress = 0.0 diff --git a/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift b/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift index 91b0cbab22..7734dc5774 100644 --- a/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift @@ -730,7 +730,19 @@ private func channelVisibilityControllerEntries(presentationData: PresentationDa if case .revokeNames = mode { let count = Int32(publicChannelsToRevoke?.count ?? 0) - entries.append(.linksLimitInfo(presentationData.theme, presentationData.strings.Group_Username_RemoveExistingUsernamesOrExtendInfo("\(premiumLimits.maxPublicLinksCount)").string, count, limits.maxPublicLinksCount, premiumLimits.maxPublicLinksCount, isPremiumDisabled)) + + let text: String + if count >= premiumLimits.maxPublicLinksCount { + text = presentationData.strings.Group_Username_RemoveExistingUsernamesFinalInfo + } else { + if isPremiumDisabled { + text = presentationData.strings.Group_Username_RemoveExistingUsernamesNoPremiumInfo + } else { + text = presentationData.strings.Group_Username_RemoveExistingUsernamesOrExtendInfo("\(premiumLimits.maxPublicLinksCount)").string + } + } + + entries.append(.linksLimitInfo(presentationData.theme, text, count, limits.maxPublicLinksCount, premiumLimits.maxPublicLinksCount, isPremiumDisabled)) if let publicChannelsToRevoke = publicChannelsToRevoke { var index: Int32 = 0 diff --git a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift index a4321c24a8..313505e395 100644 --- a/submodules/PremiumUI/Sources/PremiumIntroScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumIntroScreen.swift @@ -1624,7 +1624,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent { titleScale = 1.0 - fraction * 0.36 if state.otherPeerName != nil { - titleAlpha = min(1.0, fraction * 1.5) + titleAlpha = min(1.0, fraction * 1.1) } else { titleAlpha = 1.0 } @@ -1658,7 +1658,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent { context.add(secondaryTitle .position(CGPoint(x: context.availableSize.width / 2.0, y: max(topInset + 160.0 - titleOffset, environment.statusBarHeight + (environment.navigationHeight - environment.statusBarHeight) / 2.0))) .scale(titleScale) - .opacity(1.0 - titleAlpha) + .opacity(max(0.0, 1.0 - titleAlpha * 1.8)) ) if state.isPremium == true { diff --git a/submodules/PremiumUI/Sources/PremiumStarComponent.swift b/submodules/PremiumUI/Sources/PremiumStarComponent.swift index 9f5532e27b..505fef2f4c 100644 --- a/submodules/PremiumUI/Sources/PremiumStarComponent.swift +++ b/submodules/PremiumUI/Sources/PremiumStarComponent.swift @@ -281,9 +281,11 @@ class PremiumStarComponent: Component { } private func maybeAnimateIn() { - guard let scene = self.sceneView.scene, let node = scene.rootNode.childNode(withName: "star", recursively: false), let animateFrom = self.animateFrom, let containerView = self.containerView else { + guard let scene = self.sceneView.scene, let node = scene.rootNode.childNode(withName: "star", recursively: false), let animateFrom = self.animateFrom, var containerView = self.containerView else { return } + + containerView = containerView.subviews[2].subviews[1] if let animationColor = self.animationColor { let newNode = node.clone() @@ -323,6 +325,9 @@ class PremiumStarComponent: Component { self.sceneView.layer.animatePosition(from: sourcePosition, to: targetPosition, duration: 1.0, timingFunction: kCAMediaTimingFunctionSpring, completion: { _ in self.addSubview(self.sceneView) self.sceneView.center = initialPosition + }) + + Queue.mainQueue().after(0.4, { animateFrom.alpha = 1.0 })