diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 98ce855b3d..b432cd9bd7 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -9798,3 +9798,9 @@ Sorry for the inconvenience."; "Premium.MaxStoriesMonthlyFinalText" = "You have reached the limit of **%@** stories per month."; "MediaPicker.Recents" = "Recents"; + +"Location.AddThisLocation" = "Add This Location"; +"Location.AddMyLocation" = "Add My Current Location"; +"Location.TypeCity" = "City"; +"Location.TypeStreet" = "Street"; +"Location.TypeLocation" = "Location"; diff --git a/submodules/DrawingUI/Sources/DrawingLocationEntity.swift b/submodules/DrawingUI/Sources/DrawingLocationEntity.swift index 0ff37e65fb..7fa2c8e280 100644 --- a/submodules/DrawingUI/Sources/DrawingLocationEntity.swift +++ b/submodules/DrawingUI/Sources/DrawingLocationEntity.swift @@ -224,7 +224,12 @@ public final class DrawingLocationEntityView: DrawingEntityView, UITextViewDeleg case .black, .transparent, .blur: textColor = .white case .custom: - textColor = .white + let color = self.locationEntity.color.toUIColor() + if color.lightness > 0.705 { + textColor = .black + } else { + textColor = .white + } } text.addAttribute(.foregroundColor, value: textColor, range: range) @@ -256,8 +261,15 @@ public final class DrawingLocationEntityView: DrawingEntityView, UITextViewDeleg self.backgroundView.isHidden = false self.blurredBackgroundView.isHidden = true case .custom: - self.textView.textColor = .white - self.backgroundView.backgroundColor = self.locationEntity.color.toUIColor() + let color = self.locationEntity.color.toUIColor() + let textColor: UIColor + if color.lightness > 0.705 { + textColor = .black + } else { + textColor = .white + } + self.textView.textColor = textColor + self.backgroundView.backgroundColor = color self.backgroundView.isHidden = false self.blurredBackgroundView.isHidden = true case .blur: diff --git a/submodules/LocationResources/Sources/VenueIconResources.swift b/submodules/LocationResources/Sources/VenueIconResources.swift index 2577be7779..47f1fc2d2d 100644 --- a/submodules/LocationResources/Sources/VenueIconResources.swift +++ b/submodules/LocationResources/Sources/VenueIconResources.swift @@ -134,7 +134,7 @@ public struct VenueIconArguments: TransformImageCustomArguments { } } -public func venueIcon(engine: TelegramEngine, type: String, background: Bool) -> Signal<(TransformImageArguments) -> DrawingContext?, NoError> { +public func venueIcon(engine: TelegramEngine, type: String, flag: String? = nil, background: Bool) -> Signal<(TransformImageArguments) -> DrawingContext?, NoError> { let isBuiltinIcon = ["", "home", "work"].contains(type) let data: Signal = isBuiltinIcon ? .single(nil) : venueIconData(engine: engine, resource: VenueIconResource(type: type)) return data |> map { data in diff --git a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift index 47a8545da5..1f17d5f4ba 100644 --- a/submodules/LocationUI/Sources/LocationPickerControllerNode.swift +++ b/submodules/LocationUI/Sources/LocationPickerControllerNode.swift @@ -620,10 +620,10 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM case .share: if source == .story { if let initialLocation = strongSelf.controller?.initialLocation { - title = "Add This Location" + title = presentationData.strings.Location_AddThisLocation coordinate = initialLocation } else { - title = "Add My Current Location" + title = presentationData.strings.Location_AddMyLocation } } else { title = presentationData.strings.Map_SendMyCurrentLocation @@ -633,10 +633,10 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM } if source == .story { if state.city != "" { - entries.append(.city(presentationData.theme, state.city ?? presentationData.strings.Map_Locating, "City", nil, nil, nil, coordinate, state.city, state.countryCode)) + entries.append(.city(presentationData.theme, state.city ?? presentationData.strings.Map_Locating, presentationData.strings.Location_TypeCity, nil, nil, nil, coordinate, state.city, state.countryCode)) } if state.street != "" { - entries.append(.location(presentationData.theme, state.street ?? presentationData.strings.Map_Locating, state.isStreet ? "Street" : "Location", nil, nil, nil, coordinate, state.street, nil, false)) + entries.append(.location(presentationData.theme, state.street ?? presentationData.strings.Map_Locating, state.isStreet ? presentationData.strings.Location_TypeStreet : presentationData.strings.Location_TypeLocation, nil, nil, nil, coordinate, state.street, nil, false)) } } else { entries.append(.location(presentationData.theme, title, (userLocation?.horizontalAccuracy).flatMap { presentationData.strings.Map_AccurateTo(stringForDistance(strings: presentationData.strings, distance: $0)).string } ?? presentationData.strings.Map_Locating, nil, nil, nil, coordinate, state.street, nil, true)) @@ -809,7 +809,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM streetName = "" } if streetName == "" && cityName == "" { - streetName = "Location" + streetName = presentationData.strings.Location_TypeLocation } strongSelf.updateState { state in var state = state @@ -854,7 +854,7 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM streetName = "" } if streetName == "" && cityName == "" { - streetName = "Location" + streetName = presentationData.strings.Location_TypeLocation } strongSelf.updateState { state in var state = state diff --git a/submodules/MediaPickerUI/Sources/MediaPickerTitleView.swift b/submodules/MediaPickerUI/Sources/MediaPickerTitleView.swift index de02ec5ed3..20543c5443 100644 --- a/submodules/MediaPickerUI/Sources/MediaPickerTitleView.swift +++ b/submodules/MediaPickerUI/Sources/MediaPickerTitleView.swift @@ -86,7 +86,7 @@ final class MediaPickerTitleView: UIView { self.arrowNode = ASImageNode() self.arrowNode.displaysAsynchronously = false - self.arrowNode.image = generateTintedImage(image: UIImage(bundleImageName: "Stories/SelectorArrowDown"), color: theme.rootController.navigationBar.secondaryTextColor) + self.arrowNode.image = generateTintedImage(image: UIImage(bundleImageName: "Media Editor/DownArrow"), color: theme.rootController.navigationBar.secondaryTextColor) self.arrowNode.isHidden = true self.segmentedControlNode = SegmentedControlNode(theme: SegmentedControlTheme(theme: theme), items: segments.map { SegmentedControlItem(title: $0) }, selectedIndex: selectedIndex) diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift index 7d4e1592a1..060733c7df 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemContentComponent.swift @@ -743,7 +743,7 @@ final class StoryItemContentComponent: Component { if let current = self.mediaAreasEffectView { mediaAreasEffectView = current } else { - mediaAreasEffectView = StoryItemLoadingEffectView(effectAlpha: 0.35, borderAlpha: 0.45, gradientWidth: 150.0, duration: 1.5, hasCustomBorder: false, playOnce: true) + mediaAreasEffectView = StoryItemLoadingEffectView(effectAlpha: 0.35, borderAlpha: 0.45, gradientWidth: 150.0, duration: 1.2, hasCustomBorder: false, playOnce: true) self.mediaAreasEffectView = mediaAreasEffectView self.addSubview(mediaAreasEffectView) } diff --git a/submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/Contents.json new file mode 100644 index 0000000000..c139f982d0 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "DownArrow.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/DownArrow.pdf b/submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/DownArrow.pdf new file mode 100644 index 0000000000..7e4a5f0bff --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Media Editor/DownArrow.imageset/DownArrow.pdf @@ -0,0 +1,92 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 0.000000 -1.000000 1.500000 7.822266 cm +0.000000 0.000000 0.000000 scn +-0.586899 2.409164 m +-0.911034 2.085029 -0.911034 1.559502 -0.586899 1.235367 c +-0.262763 0.911232 0.262763 0.911232 0.586899 1.235367 c +-0.586899 2.409164 l +h +4.500000 6.322266 m +5.086899 6.909164 l +4.762764 7.233299 4.237236 7.233299 3.913101 6.909164 c +4.500000 6.322266 l +h +8.413101 1.235367 m +8.737237 0.911232 9.262763 0.911232 9.586899 1.235367 c +9.911034 1.559502 9.911034 2.085029 9.586899 2.409164 c +8.413101 1.235367 l +h +0.586899 1.235367 m +5.086899 5.735367 l +3.913101 6.909164 l +-0.586899 2.409164 l +0.586899 1.235367 l +h +3.913101 5.735367 m +8.413101 1.235367 l +9.586899 2.409164 l +5.086899 6.909164 l +3.913101 5.735367 l +h +f +n +Q + +endstream +endobj + +3 0 obj + 762 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 12.000000 8.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000000852 00000 n +0000000874 00000 n +0000001046 00000 n +0000001120 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +1179 +%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift b/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift index 157d82f2c3..57efd1c1b9 100644 --- a/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageAnimatedStickerItemNode.swift @@ -1427,7 +1427,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { } } - let updatedImageFrame: CGRect + var updatedImageFrame: CGRect var contextContentFrame: CGRect if let _ = emojiString { updatedImageFrame = imageFrame @@ -1458,8 +1458,11 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { strongSelf.contextSourceNode.contentRect = contextContentFrame strongSelf.containerNode.targetNodeForActivationProgressContentRect = strongSelf.contextSourceNode.contentRect - let animationNodeFrame = updatedContentFrame.insetBy(dx: imageInset, dy: imageInset) - + var animationNodeFrame = updatedContentFrame.insetBy(dx: imageInset, dy: imageInset) + if let telegramFile, telegramFile.isPremiumSticker { + animationNodeFrame = animationNodeFrame.offsetBy(dx: 0.0, dy: 20.0) + } + var file: TelegramMediaFile? if let emojiFile = emojiFile { file = emojiFile diff --git a/submodules/TelegramUI/Sources/NavigateToChatController.swift b/submodules/TelegramUI/Sources/NavigateToChatController.swift index 36b013025e..853d11c761 100644 --- a/submodules/TelegramUI/Sources/NavigateToChatController.swift +++ b/submodules/TelegramUI/Sources/NavigateToChatController.swift @@ -117,6 +117,9 @@ public func navigateToChatControllerImpl(_ params: NavigateToChatControllerParam if let attachBotStart = params.attachBotStart { controller.presentAttachmentBot(botId: attachBotStart.botId, payload: attachBotStart.payload, justInstalled: attachBotStart.justInstalled) } + if let botAppStart = params.botAppStart, case let .peer(peer) = params.chatLocation { + controller.presentBotApp(botApp: botAppStart.botApp, botPeer: peer, payload: botAppStart.payload) + } params.setupController(controller) found = true break