mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various improvements
This commit is contained in:
parent
e24ce90363
commit
0d1366e5cc
@ -3658,7 +3658,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
}
|
}
|
||||||
strongSelf.onlineNode.setImage(onlineIcon, color: item.presentationData.theme.list.itemCheckColors.foregroundColor, transition: .immediate)
|
strongSelf.onlineNode.setImage(onlineIcon, color: item.presentationData.theme.list.itemCheckColors.foregroundColor, transition: .immediate)
|
||||||
|
|
||||||
if isSubscription {
|
if isSubscription, autoremoveTimeout == nil {
|
||||||
let starView: StarView
|
let starView: StarView
|
||||||
if let current = strongSelf.starView {
|
if let current = strongSelf.starView {
|
||||||
starView = current
|
starView = current
|
||||||
|
@ -183,7 +183,7 @@ public final class LocationMapHeaderNode: ASDisplayNode {
|
|||||||
let mapHeight: CGFloat = floor(layout.size.height * 1.3) + layout.intrinsicInsets.top * 2.0
|
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)
|
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)
|
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
|
let inset: CGFloat = 6.0
|
||||||
|
|
||||||
|
@ -219,6 +219,7 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget {
|
|||||||
private let pickerAnnotationContainerView: PickerAnnotationContainerView
|
private let pickerAnnotationContainerView: PickerAnnotationContainerView
|
||||||
private weak var userLocationAnnotationView: MKAnnotationView?
|
private weak var userLocationAnnotationView: MKAnnotationView?
|
||||||
private var headingArrowView: UIImageView?
|
private var headingArrowView: UIImageView?
|
||||||
|
private var compassView: MKCompassButton?
|
||||||
|
|
||||||
private weak var defaultUserLocationAnnotation: MKAnnotation?
|
private weak var defaultUserLocationAnnotation: MKAnnotation?
|
||||||
|
|
||||||
@ -301,11 +302,15 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget {
|
|||||||
override public func didLoad() {
|
override public func didLoad() {
|
||||||
super.didLoad()
|
super.didLoad()
|
||||||
|
|
||||||
|
guard let mapView = self.mapView else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
self.headingArrowView = UIImageView()
|
self.headingArrowView = UIImageView()
|
||||||
self.headingArrowView?.frame = CGRect(origin: CGPoint(), size: CGSize(width: 88.0, height: 88.0))
|
self.headingArrowView?.frame = CGRect(origin: CGPoint(), size: CGSize(width: 88.0, height: 88.0))
|
||||||
self.headingArrowView?.image = generateHeadingArrowImage()
|
self.headingArrowView?.image = generateHeadingArrowImage()
|
||||||
|
|
||||||
self.mapView?.interactiveTransitionGestureRecognizerTest = { p in
|
mapView.interactiveTransitionGestureRecognizerTest = { p in
|
||||||
if p.x > 44.0 {
|
if p.x > 44.0 {
|
||||||
return true
|
return true
|
||||||
} else {
|
} 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
|
return self?.disableHorizontalTransitionGesture == true
|
||||||
}
|
}
|
||||||
|
|
||||||
let delegateImpl = MKMapViewDelegateImpl(target: self)
|
let delegateImpl = MKMapViewDelegateImpl(target: self)
|
||||||
self.delegateImpl = delegateImpl
|
self.delegateImpl = delegateImpl
|
||||||
|
|
||||||
self.mapView?.delegate = delegateImpl
|
let compassView = MKCompassButton(mapView: mapView)
|
||||||
self.mapView?.mapType = self.mapMode.mapType
|
compassView.isUserInteractionEnabled = true
|
||||||
self.mapView?.isRotateEnabled = self.isRotateEnabled
|
self.compassView = compassView
|
||||||
self.mapView?.showsUserLocation = true
|
mapView.addSubview(compassView)
|
||||||
self.mapView?.showsPointsOfInterest = false
|
|
||||||
self.mapView?.customHitTest = { [weak self] point in
|
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 {
|
guard let strongSelf = self else {
|
||||||
return false
|
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.hasValidLayout = true
|
||||||
|
|
||||||
self.topPadding = topPadding
|
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)
|
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()
|
self.applyPendingSetMapCenter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ final class LocationViewControllerNode: ViewControllerTracingNode, CLLocationMan
|
|||||||
self.headerNode = LocationMapHeaderNode(presentationData: presentationData, toggleMapModeSelection: interaction.toggleMapModeSelection, goToUserLocation: interaction.toggleTrackingMode, setupProximityNotification: { reset in
|
self.headerNode = LocationMapHeaderNode(presentationData: presentationData, toggleMapModeSelection: interaction.toggleMapModeSelection, goToUserLocation: interaction.toggleTrackingMode, setupProximityNotification: { reset in
|
||||||
setupProximityNotificationImpl?(reset)
|
setupProximityNotificationImpl?(reset)
|
||||||
})
|
})
|
||||||
self.headerNode.mapNode.isRotateEnabled = false
|
//self.headerNode.mapNode.isRotateEnabled = false
|
||||||
|
|
||||||
self.optionsNode = LocationOptionsNode(presentationData: presentationData, updateMapMode: interaction.updateMapMode)
|
self.optionsNode = LocationOptionsNode(presentationData: presentationData, updateMapMode: interaction.updateMapMode)
|
||||||
|
|
||||||
|
@ -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)
|
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: "⭐️") {
|
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))
|
badgeString.addAttribute(.baselineOffset, value: 1.5, range: NSRange(range, in: badgeString.string))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/Contents.json
vendored
Normal file
12
submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "givstars.pdf",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/givstars.pdf
vendored
Normal file
BIN
submodules/TelegramUI/Images.xcassets/Chat/Message/Stars.imageset/givstars.pdf
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user