mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
968e59077f
commit
5c1155d66d
@ -311,6 +311,7 @@ class LocationPinAnnotationView: MKAnnotationView {
|
|||||||
self.smallNode.image = generateSmallBackgroundImage(color: color)
|
self.smallNode.image = generateSmallBackgroundImage(color: color)
|
||||||
self.dotNode.image = generateFilledCircleImage(diameter: 6.0, color: color)
|
self.dotNode.image = generateFilledCircleImage(diameter: 6.0, color: color)
|
||||||
|
|
||||||
|
self.iconNode.isHidden = false
|
||||||
self.dotNode.isHidden = false
|
self.dotNode.isHidden = false
|
||||||
|
|
||||||
if !self.isSelected {
|
if !self.isSelected {
|
||||||
@ -354,6 +355,7 @@ class LocationPinAnnotationView: MKAnnotationView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func prepareForReuse() {
|
override func prepareForReuse() {
|
||||||
|
self.previousPeerId = nil
|
||||||
self.smallNode.isHidden = true
|
self.smallNode.isHidden = true
|
||||||
self.backgroundNode.isHidden = false
|
self.backgroundNode.isHidden = false
|
||||||
self.appeared = false
|
self.appeared = false
|
||||||
|
@ -372,10 +372,6 @@ class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewD
|
|||||||
let smallValue = smallUnitValues[selectedSmallRow]
|
let smallValue = smallUnitValues[selectedSmallRow]
|
||||||
|
|
||||||
var value = largeValue * 1000 + smallValue * 10
|
var value = largeValue * 1000 + smallValue * 10
|
||||||
if !self.usesMetricSystem {
|
|
||||||
value = Int32(Double(value) * 1.60934)
|
|
||||||
}
|
|
||||||
|
|
||||||
var formattedValue = String(format: "%0.1f", CGFloat(value) / 1000.0)
|
var formattedValue = String(format: "%0.1f", CGFloat(value) / 1000.0)
|
||||||
if smallValue == 5 {
|
if smallValue == 5 {
|
||||||
formattedValue = formattedValue.replacingOccurrences(of: ".1", with: ".05").replacingOccurrences(of: ",1", with: ",05")
|
formattedValue = formattedValue.replacingOccurrences(of: ".1", with: ".05").replacingOccurrences(of: ",1", with: ",05")
|
||||||
|
@ -255,11 +255,16 @@ final class LocationMapNode: ASDisplayNode, MKMapViewDelegate {
|
|||||||
self.mapView?.showsUserLocation = true
|
self.mapView?.showsUserLocation = true
|
||||||
self.mapView?.showsPointsOfInterest = false
|
self.mapView?.showsPointsOfInterest = false
|
||||||
self.mapView?.customHitTest = { [weak self] point in
|
self.mapView?.customHitTest = { [weak self] point in
|
||||||
guard let strongSelf = self, let annotationView = strongSelf.customUserLocationAnnotationView else {
|
guard let strongSelf = self else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if let annotationRect = annotationView.superview?.convert(annotationView.frame.insetBy(dx: -16.0, dy: -16.0), to: strongSelf.mapView), annotationRect.contains(point) {
|
if let annotationView = strongSelf.customUserLocationAnnotationView, let annotationRect = annotationView.superview?.convert(annotationView.frame.insetBy(dx: -16.0, dy: -16.0), to: strongSelf.mapView), annotationRect.contains(point) {
|
||||||
|
strongSelf.userLocationAnnotationSelected?()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if let userAnnotation = strongSelf.defaultUserLocationAnnotation, let annotationView = strongSelf.mapView?.view(for: userAnnotation), let annotationRect = annotationView.superview?.convert(annotationView.frame.insetBy(dx: -16.0, dy: -16.0), to: strongSelf.mapView), annotationRect.contains(point) {
|
||||||
strongSelf.userLocationAnnotationSelected?()
|
strongSelf.userLocationAnnotationSelected?()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -393,6 +398,7 @@ final class LocationMapNode: ASDisplayNode, MKMapViewDelegate {
|
|||||||
for view in views {
|
for view in views {
|
||||||
if view.annotation is MKUserLocation {
|
if view.annotation is MKUserLocation {
|
||||||
self.defaultUserLocationAnnotation = view.annotation
|
self.defaultUserLocationAnnotation = view.annotation
|
||||||
|
view.canShowCallout = false
|
||||||
|
|
||||||
self.userLocationAnnotationView = view
|
self.userLocationAnnotationView = view
|
||||||
if let headingArrowView = self.headingArrowView {
|
if let headingArrowView = self.headingArrowView {
|
||||||
|
@ -557,6 +557,21 @@ final class LocationViewControllerNode: ViewControllerTracingNode, CLLocationMan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.headerNode.mapNode.annotationSelected = { [weak self] annotation in
|
||||||
|
guard let strongSelf = self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if let annotation = annotation {
|
||||||
|
strongSelf.interaction.goToCoordinate(annotation.coordinate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.headerNode.mapNode.userLocationAnnotationSelected = { [weak self] in
|
||||||
|
if let strongSelf = self, let location = strongSelf.headerNode.mapNode.currentUserLocation {
|
||||||
|
strongSelf.interaction.goToCoordinate(location.coordinate)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.locationManager.manager.startUpdatingHeading()
|
self.locationManager.manager.startUpdatingHeading()
|
||||||
self.locationManager.manager.delegate = self
|
self.locationManager.manager.delegate = self
|
||||||
}
|
}
|
||||||
|
@ -829,7 +829,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
|
|||||||
wasCheck = true
|
wasCheck = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if isAudio && !isVoice {
|
if isAudio && !isVoice && !isSending {
|
||||||
state = .play
|
state = .play
|
||||||
} else {
|
} else {
|
||||||
if message.groupingKey != nil, adjustedProgress.isEqual(to: 1.0), (message.flags.contains(.Unsent) || wasCheck) {
|
if message.groupingKey != nil, adjustedProgress.isEqual(to: 1.0), (message.flags.contains(.Unsent) || wasCheck) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user