From b0f4ca9ad93fd54e4f4097fbbee08c09526f0327 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 12 Nov 2025 18:41:57 +0400 Subject: [PATCH] Various improvements --- .../Telegram-iOS/en.lproj/Localizable.strings | 5 ++++ ...onSequenceCountrySelectionController.swift | 3 +- .../Sources/LocationPickerController.swift | 4 +-- .../LocationPickerControllerNode.swift | 3 +- .../Sources/CameraLiveStreamComponent.swift | 6 ++-- .../Sources/CaptureControlsComponent.swift | 3 +- .../Sources/GiftAuctionBidScreen.swift | 30 +++++++++++++++++-- 7 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index e25e896157..a96e20a07f 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -15293,3 +15293,8 @@ Error: %8$@"; "Gift.Auction.Info.Missed.Text" = "If your bid doesn't win after the final drop, your Stars will be fully refunded."; "Gift.Auction.Info.Understood" = "Understood"; + +"Location.SendLocation" = "Send Location"; + +"Camera.LiveStream.Change" = "change"; +"Camera.LiveStream.StartLiveStream" = "Start Live Stream"; diff --git a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift index 017cc15f01..f2dfd41c2d 100644 --- a/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift +++ b/submodules/CountrySelectionUI/Sources/AuthorizationSequenceCountrySelectionController.swift @@ -341,8 +341,7 @@ public final class AuthorizationSequenceCountrySelectionController: ViewControll self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style if glass { - //TODO:localize - self.title = "Select Country" + self.title = strings.Login_SelectCountry } else { let navigationContentNode = AuthorizationSequenceCountrySelectionNavigationContentNode(theme: theme, strings: strings, cancel: { [weak self] in self?.dismissed?() diff --git a/submodules/LocationUI/Sources/LocationPickerController.swift b/submodules/LocationUI/Sources/LocationPickerController.swift index 1f10085c7b..434b96002e 100644 --- a/submodules/LocationUI/Sources/LocationPickerController.swift +++ b/submodules/LocationUI/Sources/LocationPickerController.swift @@ -446,9 +446,7 @@ public func storyLocationPickerController( ) -> ViewController { let presentationData = context.sharedContext.currentPresentationData.with({ $0 }).withUpdated(theme: defaultDarkColorPresentationTheme) let updatedPresentationData: (PresentationData, Signal) = (presentationData, .single(presentationData)) - let controller = AttachmentController(context: context, updatedPresentationData: updatedPresentationData, chatLocation: nil, buttons: [.standalone], initialButton: .standalone, fromMenu: false, hasTextInput: false, makeEntityInputView: { - return nil - }) + let controller = AttachmentController(context: context, updatedPresentationData: updatedPresentationData, chatLocation: nil, buttons: [.standalone], initialButton: .standalone, fromMenu: false, hasTextInput: false) controller.requestController = { _, present in let locationPickerController = LocationPickerController(context: context, updatedPresentationData: updatedPresentationData, mode: .share(peer: nil, selfPeer: nil, hasLiveLocation: false), source: .story, initialLocation: location, completion: { location, queryId, resultId, address, countryCode in completion(location, queryId, resultId, address, countryCode) diff --git a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift index f07f056ca2..fef407f8b8 100644 --- a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift +++ b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift @@ -1533,11 +1533,10 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM foreground: self.presentationData.theme.list.itemCheckColors.foregroundColor, pressedColor: self.presentationData.theme.list.itemCheckColors.fillColor.withMultipliedAlpha(0.9), ) - //TODO:localize var buttonContents: [AnyComponentWithIdentity] = [ AnyComponentWithIdentity( id: AnyHashable("label"), - component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: "Send Location", font: Font.semibold(17.0), textColor: self.presentationData.theme.list.itemCheckColors.foregroundColor, paragraphAlignment: .center)))) + component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: self.presentationData.strings.Location_SendLocation, font: Font.semibold(17.0), textColor: self.presentationData.theme.list.itemCheckColors.foregroundColor, paragraphAlignment: .center)))) ) ] diff --git a/submodules/TelegramUI/Components/CameraScreen/Sources/CameraLiveStreamComponent.swift b/submodules/TelegramUI/Components/CameraScreen/Sources/CameraLiveStreamComponent.swift index 80a6e982fa..d9d44d6857 100644 --- a/submodules/TelegramUI/Components/CameraScreen/Sources/CameraLiveStreamComponent.swift +++ b/submodules/TelegramUI/Components/CameraScreen/Sources/CameraLiveStreamComponent.swift @@ -413,12 +413,13 @@ public final class StreamAsComponent: Component { }) } + let presentationData = component.context.sharedContext.currentPresentationData.with({ $0 }) let avatarSize = CGSize(width: 32.0, height: 32.0) self.avatarNode.frame = CGRect(origin: .zero, size: avatarSize) if let peer = self.peer { self.avatarNode.setPeer( context: component.context, - theme: component.context.sharedContext.currentPresentationData.with({ $0 }).theme, + theme: presentationData.theme, peer: peer, synchronousLoad: true ) @@ -444,12 +445,11 @@ public final class StreamAsComponent: Component { var maxWidth = titleFrame.maxX if !component.isCustomTarget { - //TODO:localize let subtitleSize = self.subtitle.update( transition: .immediate, component: AnyComponent( MultilineTextComponent( - text: .plain(NSAttributedString(string: "change", font: Font.regular(11.0), textColor: UIColor(white: 1.0, alpha: 0.8), paragraphAlignment: .left)) + text: .plain(NSAttributedString(string: presentationData.strings.Camera_LiveStream_Change, font: Font.regular(11.0), textColor: UIColor(white: 1.0, alpha: 0.8), paragraphAlignment: .left)) ) ), environment: {}, diff --git a/submodules/TelegramUI/Components/CameraScreen/Sources/CaptureControlsComponent.swift b/submodules/TelegramUI/Components/CameraScreen/Sources/CaptureControlsComponent.swift index 1ea33c9d0d..d6f15d18cc 100644 --- a/submodules/TelegramUI/Components/CameraScreen/Sources/CaptureControlsComponent.swift +++ b/submodules/TelegramUI/Components/CameraScreen/Sources/CaptureControlsComponent.swift @@ -252,11 +252,10 @@ private final class ShutterButtonContentComponent: Component { } } - //TODO:localize let labelSize = self.label.update( transition: .immediate, component: AnyComponent( - Text(text: "Start Live Stream", font: Font.semibold(17.0), color: .white) + Text(text: component.strings.Camera_LiveStream_StartLiveStream, font: Font.semibold(17.0), color: .white) ), environment: {}, containerSize: availableSize diff --git a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftAuctionBidScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftAuctionBidScreen.swift index 7545f87984..24b78f2d89 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftAuctionBidScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftAuctionBidScreen.swift @@ -29,6 +29,7 @@ import BotPaymentsUI import UndoUI import GiftItemComponent import LottieComponent +import EdgeEffect private final class BadgeComponent: Component { let theme: PresentationTheme @@ -1039,6 +1040,9 @@ private final class GiftAuctionBidScreenComponent: Component { private let scrollContentView: UIView private let hierarchyTrackingNode: HierarchyTrackingNode + private let topEdgeEffectView: EdgeEffectView + private let bottomEdgeEffectView: EdgeEffectView + private var balanceOverlay = ComponentView() private let backgroundHandleView: UIImageView @@ -1115,6 +1119,13 @@ private final class GiftAuctionBidScreenComponent: Component { self.hierarchyTrackingNode = HierarchyTrackingNode() + self.topEdgeEffectView = EdgeEffectView() + self.topEdgeEffectView.clipsToBounds = true + self.topEdgeEffectView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] + self.topEdgeEffectView.layer.cornerRadius = 40.0 + + self.bottomEdgeEffectView = EdgeEffectView() + super.init(frame: frame) self.addSubview(self.dimView) @@ -2518,9 +2529,24 @@ private final class GiftAuctionBidScreenComponent: Component { containerSize: CGSize(width: availableSize.width - buttonInsets.left - buttonInsets.right, height: 54.0) ) - + let edgeEffectHeight: CGFloat = 80.0 + let edgeEffectFrame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: availableSize.width, height: edgeEffectHeight)) + transition.setFrame(view: self.topEdgeEffectView, frame: edgeEffectFrame) + self.topEdgeEffectView.update(content: environment.theme.actionSheet.opaqueItemBackgroundColor, blur: true, alpha: 1.0, rect: edgeEffectFrame, edge: .top, edgeSize: edgeEffectFrame.height, transition: transition) + if self.topEdgeEffectView.superview == nil { + self.navigationBarContainer.insertSubview(self.topEdgeEffectView, at: 0) + } var bottomPanelHeight = 13.0 + buttonInsets.bottom + actionButtonSize.height + + let bottomEdgeEffectHeight: CGFloat = bottomPanelHeight + let bottomEdgeEffectFrame = CGRect(origin: CGPoint(x: 0.0, y: availableSize.height - bottomEdgeEffectHeight), size: CGSize(width: availableSize.width, height: bottomEdgeEffectHeight)) + transition.setFrame(view: self.bottomEdgeEffectView, frame: bottomEdgeEffectFrame) + self.bottomEdgeEffectView.update(content: environment.theme.actionSheet.opaqueItemBackgroundColor, blur: true, alpha: 1.0, rect: bottomEdgeEffectFrame, edge: .bottom, edgeSize: bottomEdgeEffectFrame.height, transition: transition) + if self.bottomEdgeEffectView.superview == nil { + self.containerView.addSubview(self.bottomEdgeEffectView) + } + let actionButtonFrame = CGRect(origin: CGPoint(x: buttonInsets.left, y: availableSize.height - buttonInsets.bottom - actionButtonSize.height), size: actionButtonSize) bottomPanelHeight -= 1.0 if let actionButtonView = actionButton.view { @@ -2539,7 +2565,7 @@ private final class GiftAuctionBidScreenComponent: Component { let scrollContentHeight = max(topInset + contentHeight + containerInset, availableSize.height - containerInset) - self.scrollContentClippingView.layer.cornerRadius = 10.0 + self.scrollContentClippingView.layer.cornerRadius = 38.0 self.itemLayout = ItemLayout(containerSize: availableSize, containerInset: containerInset, containerCornerRadius: environment.deviceMetrics.screenCornerRadius, bottomInset: environment.safeInsets.bottom, topInset: topInset)