diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index c4b58ca761..7d071155d1 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -3658,7 +3658,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { } strongSelf.onlineNode.setImage(onlineIcon, color: item.presentationData.theme.list.itemCheckColors.foregroundColor, transition: .immediate) - if isSubscription { + if isSubscription, autoremoveTimeout == nil { let starView: StarView if let current = strongSelf.starView { starView = current diff --git a/submodules/LocationUI/Sources/LocationMapHeaderNode.swift b/submodules/LocationUI/Sources/LocationMapHeaderNode.swift index 8ed12e8b16..8c72f2fa9a 100644 --- a/submodules/LocationUI/Sources/LocationMapHeaderNode.swift +++ b/submodules/LocationUI/Sources/LocationMapHeaderNode.swift @@ -183,7 +183,7 @@ public final class LocationMapHeaderNode: ASDisplayNode { let mapHeight: CGFloat = floor(layout.size.height * 1.3) + layout.intrinsicInsets.top * 2.0 let mapFrame = CGRect(x: 0.0, y: floorToScreenPixels((size.height - mapHeight + navigationBarHeight) / 2.0) + offset + floor(layout.intrinsicInsets.top * 0.5), width: size.width, height: mapHeight) transition.updateFrame(node: self.mapNode, frame: mapFrame) - self.mapNode.updateLayout(size: mapFrame.size, topPadding: 0.0) + self.mapNode.updateLayout(size: mapFrame.size, topPadding: topPadding, inset: mapFrame.origin.y * -1.0 + navigationBarHeight, transition: transition) let inset: CGFloat = 6.0 diff --git a/submodules/LocationUI/Sources/LocationMapNode.swift b/submodules/LocationUI/Sources/LocationMapNode.swift index 9025e079fd..32d0029ac9 100644 --- a/submodules/LocationUI/Sources/LocationMapNode.swift +++ b/submodules/LocationUI/Sources/LocationMapNode.swift @@ -219,6 +219,7 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget { private let pickerAnnotationContainerView: PickerAnnotationContainerView private weak var userLocationAnnotationView: MKAnnotationView? private var headingArrowView: UIImageView? + private var compassView: MKCompassButton? private weak var defaultUserLocationAnnotation: MKAnnotation? @@ -301,11 +302,15 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget { override public func didLoad() { super.didLoad() + guard let mapView = self.mapView else { + return + } + self.headingArrowView = UIImageView() self.headingArrowView?.frame = CGRect(origin: CGPoint(), size: CGSize(width: 88.0, height: 88.0)) self.headingArrowView?.image = generateHeadingArrowImage() - self.mapView?.interactiveTransitionGestureRecognizerTest = { p in + mapView.interactiveTransitionGestureRecognizerTest = { p in if p.x > 44.0 { return true } else { @@ -313,19 +318,25 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget { } } - self.mapView?.disablesInteractiveTransitionGestureRecognizerNow = { [weak self] in + mapView.disablesInteractiveTransitionGestureRecognizerNow = { [weak self] in return self?.disableHorizontalTransitionGesture == true } let delegateImpl = MKMapViewDelegateImpl(target: self) self.delegateImpl = delegateImpl - self.mapView?.delegate = delegateImpl - self.mapView?.mapType = self.mapMode.mapType - self.mapView?.isRotateEnabled = self.isRotateEnabled - self.mapView?.showsUserLocation = true - self.mapView?.showsPointsOfInterest = false - self.mapView?.customHitTest = { [weak self] point in + let compassView = MKCompassButton(mapView: mapView) + compassView.isUserInteractionEnabled = true + self.compassView = compassView + mapView.addSubview(compassView) + + mapView.delegate = delegateImpl + mapView.mapType = self.mapMode.mapType + mapView.isRotateEnabled = self.isRotateEnabled + mapView.showsUserLocation = true + mapView.showsPointsOfInterest = false + mapView.showsCompass = false + mapView.customHitTest = { [weak self] point in guard let strongSelf = self else { return false } @@ -826,7 +837,7 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget { } } - public func updateLayout(size: CGSize, topPadding: CGFloat) { + public func updateLayout(size: CGSize, topPadding: CGFloat, inset: CGFloat, transition: ContainedViewLayoutTransition) { self.hasValidLayout = true self.topPadding = topPadding @@ -837,6 +848,10 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget { pickerAnnotationView.center = CGPoint(x: self.pickerAnnotationContainerView.frame.width / 2.0, y: self.pickerAnnotationContainerView.frame.height / 2.0) } + if let compassView = self.compassView { + transition.updateFrame(view: compassView, frame: CGRect(origin: CGPoint(x: size.width - compassView.frame.width - 11.0, y: inset + 110.0 + topPadding), size: compassView.frame.size)) + } + self.applyPendingSetMapCenter() } } diff --git a/submodules/LocationUI/Sources/LocationViewControllerNode.swift b/submodules/LocationUI/Sources/LocationViewControllerNode.swift index 8a5ebd03ec..d8593c0b55 100644 --- a/submodules/LocationUI/Sources/LocationViewControllerNode.swift +++ b/submodules/LocationUI/Sources/LocationViewControllerNode.swift @@ -321,7 +321,7 @@ final class LocationViewControllerNode: ViewControllerTracingNode, CLLocationMan self.headerNode = LocationMapHeaderNode(presentationData: presentationData, toggleMapModeSelection: interaction.toggleMapModeSelection, goToUserLocation: interaction.toggleTrackingMode, setupProximityNotification: { reset in setupProximityNotificationImpl?(reset) }) - self.headerNode.mapNode.isRotateEnabled = false + //self.headerNode.mapNode.isRotateEnabled = false self.optionsNode = LocationOptionsNode(presentationData: presentationData, updateMapMode: interaction.updateMapMode) diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageGiveawayBubbleContentNode/Sources/ChatMessageGiveawayBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageGiveawayBubbleContentNode/Sources/ChatMessageGiveawayBubbleContentNode.swift index 4157012d7d..cad301d4c6 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageGiveawayBubbleContentNode/Sources/ChatMessageGiveawayBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageGiveawayBubbleContentNode/Sources/ChatMessageGiveawayBubbleContentNode.swift @@ -285,7 +285,7 @@ public class ChatMessageGiveawayBubbleContentNode: ChatMessageBubbleContentNode, } let badgeString = NSMutableAttributedString(string: badgeText, font: Font.with(size: 10.0, design: .round , weight: .bold, traits: .monospacedNumbers), textColor: badgeTextColor) if let range = badgeString.string.range(of: "⭐️") { - badgeString.addAttribute(ChatTextInputAttributes.customEmoji, value: ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: 0, file: nil, custom: .stars(tinted: true)), range: NSRange(range, in: badgeString.string)) + badgeString.addAttribute(.attachment, value: UIImage(bundleImageName: "Chat/Message/Stars")!, range: NSRange(range, in: badgeString.string)) badgeString.addAttribute(.baselineOffset, value: 1.5, range: NSRange(range, in: badgeString.string)) } diff --git a/submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/Contents.json new file mode 100644 index 0000000000..f72b66eab0 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "givstars.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/givstars.pdf b/submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/givstars.pdf new file mode 100644 index 0000000000..fa02782788 Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/givstars.pdf differ