From db42d63c40de43d3eb7fd784be56746301db7bb3 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 29 Oct 2020 16:28:51 +0400 Subject: [PATCH] Add proximity alert toasts --- submodules/LocationUI/BUCK | 1 + submodules/LocationUI/BUILD | 1 + .../LocationDistancePickerScreen.swift | 30 +++++++- .../Sources/LocationViewController.swift | 77 +++++++++++++++++++ .../Animations/anim_proximity_cancelled.json | 1 + .../Animations/anim_proximity_set.json | 1 + .../Sources/UndoOverlayController.swift | 1 + .../Sources/UndoOverlayControllerNode.swift | 21 ++++- 8 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 submodules/TelegramUI/Resources/Animations/anim_proximity_cancelled.json create mode 100644 submodules/TelegramUI/Resources/Animations/anim_proximity_set.json diff --git a/submodules/LocationUI/BUCK b/submodules/LocationUI/BUCK index 47692d45f7..3424f578b2 100644 --- a/submodules/LocationUI/BUCK +++ b/submodules/LocationUI/BUCK @@ -38,6 +38,7 @@ static_library( "//submodules/LiveLocationTimerNode:LiveLocationTimerNode", "//submodules/TelegramNotices:TelegramNotices", "//submodules/TooltipUI:TooltipUI", + "//submodules/UndoUI:UndoUI", ], frameworks = [ "$SDKROOT/System/Library/Frameworks/Foundation.framework", diff --git a/submodules/LocationUI/BUILD b/submodules/LocationUI/BUILD index 8a9e523a1e..b13d234088 100644 --- a/submodules/LocationUI/BUILD +++ b/submodules/LocationUI/BUILD @@ -39,6 +39,7 @@ swift_library( "//submodules/LiveLocationTimerNode:LiveLocationTimerNode", "//submodules/TelegramNotices:TelegramNotices", "//submodules/TooltipUI:TooltipUI", + "//submodules/UndoUI:UndoUI", ], visibility = [ "//visibility:public", diff --git a/submodules/LocationUI/Sources/LocationDistancePickerScreen.swift b/submodules/LocationUI/Sources/LocationDistancePickerScreen.swift index 42d3319255..78ce35ae8e 100644 --- a/submodules/LocationUI/Sources/LocationDistancePickerScreen.swift +++ b/submodules/LocationUI/Sources/LocationDistancePickerScreen.swift @@ -195,6 +195,8 @@ class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewD private let unitLabelNode: ImmediateTextNode private let smallUnitLabelNode: ImmediateTextNode + private var pickerTimer: SwiftSignalKit.Timer? + private var containerLayout: (ContainerViewLayout, CGFloat)? private var distancesDisposable: Disposable? @@ -321,6 +323,8 @@ class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewD deinit { self.distancesDisposable?.dispose() + + self.pickerTimer?.invalidate() } func setupPickerView() { @@ -345,6 +349,18 @@ class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewD self.contentContainerNode.addSubnode(self.unitLabelNode) self.contentContainerNode.addSubnode(self.smallUnitLabelNode) + self.pickerTimer?.invalidate() + + let pickerTimer = SwiftSignalKit.Timer(timeout: 0.4, repeat: true, completion: { [weak self] in + if let strongSelf = self { + if strongSelf.update() { + strongSelf.updateDoneButtonTitle() + } + } + }, queue: Queue.mainQueue()) + self.pickerTimer = pickerTimer + pickerTimer.start() + self.updateDoneButtonTitle() } @@ -414,7 +430,8 @@ class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewD } } - fileprivate func update() { + var previousReportedValue: Int32? + fileprivate func update() -> Bool { if let pickerView = self.pickerView { let selectedLargeRow = pickerView.selectedRow(inComponent: 0) var selectedSmallRow = pickerView.selectedRow(inComponent: 1) @@ -429,7 +446,16 @@ class LocationDistancePickerScreenNode: ViewControllerTracingNode, UIScrollViewD if !self.usesMetricSystem { value = Int32(Double(value) * 1.60934) } - self.updated?(value) + + if let previousReportedValue = self.previousReportedValue, value == previousReportedValue { + return false + } else { + self.updated?(value) + self.previousReportedValue = value + return true + } + } else { + return false } } diff --git a/submodules/LocationUI/Sources/LocationViewController.swift b/submodules/LocationUI/Sources/LocationViewController.swift index 4055a4d69c..14c9f3642f 100644 --- a/submodules/LocationUI/Sources/LocationViewController.swift +++ b/submodules/LocationUI/Sources/LocationViewController.swift @@ -7,6 +7,7 @@ import SyncCore import Postbox import SwiftSignalKit import TelegramPresentationData +import TelegramStringFormatting import AccountContext import AppBundle import CoreLocation @@ -14,6 +15,7 @@ import PresentationDataUtils import OpenInExternalAppUI import ShareController import DeviceAccess +import UndoUI public class LocationViewParams { let sendLiveLocation: (TelegramMediaMap) -> Void @@ -202,6 +204,21 @@ public final class LocationViewController: ViewController { } } }) + strongSelf.present( + UndoOverlayController( + presentationData: strongSelf.presentationData, + content: .setProximityAlert( + title: strongSelf.presentationData.strings.Location_ProximityAlertCancelled, + text: "", + cancelled: true + ), + elevatedLayout: false, + action: { action in + return true + } + ), + in: .current + ) } } else { DeviceAccess.authorizeAccess(to: .location(.live), locationManager: strongSelf.locationManager, presentationData: strongSelf.presentationData, present: { c, a in @@ -254,6 +271,30 @@ public final class LocationViewController: ViewController { } } }) + + var text: String + let distanceString = shortStringForDistance(strings: strongSelf.presentationData.strings, distance: distance) + if let compactDisplayTitle = compactDisplayTitle { + text = strongSelf.presentationData.strings.Location_ProximityAlertSetText(compactDisplayTitle, distanceString).0 + } else { + text = strongSelf.presentationData.strings.Location_ProximityAlertSetTextGroup(distanceString).0 + } + + strongSelf.present( + UndoOverlayController( + presentationData: strongSelf.presentationData, + content: .setProximityAlert( + title: strongSelf.presentationData.strings.Location_ProximityAlertSetTitle, + text: text, + cancelled: false + ), + elevatedLayout: false, + action: { action in + return true + } + ), + in: .current + ) } else { strongSelf.present(textAlertController(context: strongSelf.context, title: strongSelf.presentationData.strings.Location_LiveLocationRequired_Title, text: strongSelf.presentationData.strings.Location_LiveLocationRequired_Description, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Location_LiveLocationRequired_ShareLocation, action: { completion() @@ -293,6 +334,42 @@ public final class LocationViewController: ViewController { |> deliverOnMainQueue).start(next: { coordinate in params.sendLiveLocation(TelegramMediaMap(coordinate: coordinate, liveBroadcastingTimeout: 30 * 60, proximityNotificationRadius: distance)) }) + + let _ = (strongSelf.context.account.postbox.loadedPeerWithId(strongSelf.subject.id.peerId) + |> deliverOnMainQueue).start(next: { [weak self] peer in + guard let strongSelf = self else { + return + } + + var compactDisplayTitle: String? + if let peer = peer as? TelegramUser { + compactDisplayTitle = peer.compactDisplayTitle + } + + var text: String + let distanceString = shortStringForDistance(strings: strongSelf.presentationData.strings, distance: distance) + if let compactDisplayTitle = compactDisplayTitle { + text = strongSelf.presentationData.strings.Location_ProximityAlertSetText(compactDisplayTitle, distanceString).0 + } else { + text = strongSelf.presentationData.strings.Location_ProximityAlertSetTextGroup(distanceString).0 + } + + strongSelf.present( + UndoOverlayController( + presentationData: strongSelf.presentationData, + content: .setProximityAlert( + title: strongSelf.presentationData.strings.Location_ProximityAlertSetTitle, + text: text, + cancelled: false + ), + elevatedLayout: false, + action: { action in + return true + } + ), + in: .current + ) + }) } else { let _ = (context.account.postbox.loadedPeerWithId(subject.id.peerId) |> deliverOnMainQueue).start(next: { peer in diff --git a/submodules/TelegramUI/Resources/Animations/anim_proximity_cancelled.json b/submodules/TelegramUI/Resources/Animations/anim_proximity_cancelled.json new file mode 100644 index 0000000000..1b3093a605 --- /dev/null +++ b/submodules/TelegramUI/Resources/Animations/anim_proximity_cancelled.json @@ -0,0 +1 @@ +{"v":"5.5.9","fr":60,"ip":0,"op":60,"w":96,"h":96,"nm":"muted","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"NULL SCALE","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[41.6,47.787,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.4,0.4,0.4],"y":[1,1,1]},"o":{"x":[0.3,0.3,0.3],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"i":{"x":[0.649,0.649,0.4],"y":[1,1,1]},"o":{"x":[0.326,0.326,0.167],"y":[0,0,0]},"t":18,"s":[23.467,23.467,100]},{"t":33,"s":[21.333,21.333,100]}],"ix":6}},"ao":0,"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Curve Small","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":4,"s":[83.866,49.913,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":24,"s":[95.866,49.913,0],"to":[-10.116,14.087,0],"ti":[0,0,0]},{"t":39,"s":[25.866,52.413,0]}],"ix":2},"a":{"a":0,"k":[3.866,-1.087,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":9,"s":[{"i":[[0,0],[0,-15.137],[11.695,-7.73]],"o":[[11.784,7.715],[0,15.068],[0,0]],"v":[[47.581,-35.705],[67.15,0.465],[47.741,36.53]],"c":false}]},{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":29,"s":[{"i":[[0,0],[-0.4,-16.215],[-1.537,-11.258]],"o":[[-3.127,8.976],[0.372,15.064],[0,0]],"v":[[75.081,-43.205],[71.9,-1.785],[75.991,44.53]],"c":false}]},{"t":44,"s":[{"i":[[0,0],[-0.4,-16.215],[-0.491,-11.53]],"o":[[-0.081,9.705],[0.372,15.063],[0,0]],"v":[[66.581,-42.205],[67.15,-0.035],[67.491,46.03]],"c":false}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":13.5,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Path","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.599],"y":[0]},"t":4,"s":[0]},{"t":39,"s":[50]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.599],"y":[0]},"t":4,"s":[100]},{"t":39,"s":[50]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":35,"st":4,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Curve Big","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":4,"s":[91.368,53.96,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":24,"s":[98.368,53.96,0],"to":[-6.868,14.54,0],"ti":[0,0,0]},{"t":39,"s":[15.368,58.96,0]}],"ix":2},"a":{"a":0,"k":[11.368,2.96,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":9,"s":[{"i":[[-0.132,-0.06],[0,-31.064],[26.799,-11.988]],"o":[[26.533,12.096],[0,31.257],[0,0]],"v":[[54.128,-69.979],[99.104,-0.062],[53.633,70.078]],"c":false}]},{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":29,"s":[{"i":[[0.031,-0.142],[0,-31.064],[-3.637,-12.618]],"o":[[-4.132,18.939],[0,31.257],[0,0]],"v":[[110.628,-78.479],[103.604,-0.062],[113.633,80.078]],"c":false}]},{"t":44,"s":[{"i":[[0.007,-0.145],[0,-31.064],[-1.133,-12.578]],"o":[[-1.128,22.979],[0,31.257],[0,0]],"v":[[100.628,-80.479],[100.104,-1.562],[101.133,80.078]],"c":false}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":13.5,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Path","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.599],"y":[0]},"t":4,"s":[0]},{"t":39,"s":[50]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.599],"y":[0]},"t":4,"s":[100]},{"t":39,"s":[50]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":37,"st":4,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Line","parent":6,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-6.076,0.849,0],"ix":2},"a":{"a":0,"k":[-6.069,0.342,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-98.912,-90.795],[86.775,91.48]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":16,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":4,"s":[50]},{"i":{"x":[0.657],"y":[1.743]},"o":{"x":[0.323],"y":[0]},"t":34,"s":[64]},{"i":{"x":[0.703],"y":[1]},"o":{"x":[0.317],"y":[0.13]},"t":35,"s":[63]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":42,"s":[100]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":47,"s":[95]},{"t":52,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":4,"s":[50]},{"i":{"x":[0.657],"y":[1.537]},"o":{"x":[0.323],"y":[0]},"t":34,"s":[26]},{"i":{"x":[0.703],"y":[1]},"o":{"x":[0.317],"y":[0.133]},"t":35,"s":[26]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":42,"s":[0]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":47,"s":[5]},{"t":52,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":32,"op":60,"st":4,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Body Top","parent":6,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-2.63,-48.438,0],"ix":2},"a":{"a":0,"k":[-2.63,-48.438,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":4,"s":[{"i":[[10.134,-0.006],[6.028,-4.674],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[-0.774,-9.937]],"v":[[12.217,-99.926],[-0.352,-95.252],[-62.931,-43.74],[31.463,49.03],[31.436,-82.175]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.3,"y":0},"t":31,"s":[{"i":[[10.134,-0.006],[6.028,-4.674],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[-0.774,-9.937]],"v":[[12.217,-99.926],[-0.352,-95.252],[-62.931,-43.74],[31.463,49.03],[31.436,-82.175]],"c":true}]},{"i":{"x":0.5,"y":1},"o":{"x":0.167,"y":0.167},"t":32,"s":[{"i":[[10.134,-0.006],[6.028,-4.674],[0,0],[-0.159,-0.261],[0.3,3.6]],"o":[[0,0],[0,0],[0,0],[0.21,-11.266],[-0.766,-9.617]],"v":[[12.217,-99.926],[-0.352,-95.252],[-62.71,-43.743],[30.727,48.253],[31.436,-82.175]],"c":true}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.3,"y":0},"t":34,"s":[{"i":[[10.134,-0.006],[6.028,-4.674],[0,0],[-2.594,5.159],[0.87,10.44]],"o":[[0,0],[0,0],[0,0],[0.61,-32.675],[-0.751,-9.009]],"v":[[12.217,-99.926],[-0.352,-95.252],[-62.29,-43.75],[26.35,37.2],[31.436,-82.175]],"c":true}]},{"i":{"x":0.5,"y":1},"o":{"x":0.167,"y":0.167},"t":35,"s":[{"i":[[10.134,-0.006],[6.028,-4.674],[3.707,-5.608],[-4.408,1.928],[1.535,11.265]],"o":[[0,0],[0,0],[3.606,3.378],[1.771,-39.528],[-1.147,-8.907]],"v":[[12.217,-99.926],[-0.352,-95.252],[-61.897,-44.287],[25.646,34.661],[31.436,-82.175]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":37,"s":[{"i":[[10.134,-0.006],[6.028,-4.674],[10.751,-16.264],[-7.856,-4.212],[2.799,12.832]],"o":[[0,0],[0,0],[10.458,9.798],[1.963,-25.912],[-1.901,-8.713]],"v":[[12.217,-99.926],[-0.352,-95.252],[-37.733,-63.025],[33.177,4.24],[31.436,-82.175]],"c":true}]},{"t":40,"s":[{"i":[[10.134,-0.006],[6.028,-4.674],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[-0.774,-9.937]],"v":[[12.217,-99.926],[-0.352,-95.252],[-36.8,-63.84],[31.54,3.05],[31.436,-82.175]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Body Main","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.7],"y":[1.296]},"o":{"x":[0.581],"y":[0]},"t":0,"s":[-10]},{"i":{"x":[0.71],"y":[1]},"o":{"x":[0.56],"y":[0.204]},"t":32,"s":[3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":42,"s":[-8]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":47,"s":[6]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":52,"s":[-3]},{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":57,"s":[1]},{"t":66,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.6,"y":1},"o":{"x":0.5,"y":0},"t":0,"s":[39.312,79.023,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.52,"y":1},"o":{"x":0.4,"y":0},"t":24,"s":[65.312,79.023,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.52,"y":1},"o":{"x":0.167,"y":0},"t":39,"s":[39.812,79.023,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":1},"o":{"x":0.167,"y":0},"t":47,"s":[38.312,77.023,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":1},"o":{"x":0.167,"y":0},"t":52,"s":[39.812,80.523,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":1},"o":{"x":0.167,"y":0},"t":57,"s":[38.812,78.023,0],"to":[0,0,0],"ti":[0,0,0]},{"t":66,"s":[39.312,79.023,0]}],"ix":2},"a":{"a":0,"k":[-41.688,28.023,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.4,0.4,0.4],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":4,"s":[99.5,99.5,100]},{"i":{"x":[0.6,0.6,0.6],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":24,"s":[85,85,100]},{"i":{"x":[0.699,0.699,0.5],"y":[1,1,1]},"o":{"x":[0.426,0.426,0.3],"y":[0,0,0]},"t":39,"s":[94,94,100]},{"t":66,"s":[99.5,99.5,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.5,"y":1},"o":{"x":0.5,"y":0},"t":4,"s":[{"i":[[0,0],[0,0],[0,-10.133],[0,0],[-10.133,0],[0,0],[0,0],[-6.581,7.634],[0.521,7.458],[0,0]],"o":[[0,0],[-9.936,0.768],[0,0],[0.768,9.936],[0,0],[0,0],[8.019,5.8],[0,0],[0,0],[0,0]],"v":[[-62.52,-43.8],[-97.241,-43.739],[-115,-24.533],[-114.942,25.872],[-95.736,43.631],[-60.045,43.631],[1.05,96.204],[26.913,93.159],[31.587,80.57],[31.56,48.31]],"c":true}]},{"i":{"x":0.5,"y":1},"o":{"x":0.5,"y":0},"t":24,"s":[{"i":[[0,0],[0,0],[0,-10.133],[0,0],[-10.133,0],[0,0],[0,0],[-6.581,7.634],[0.521,7.458],[0,0]],"o":[[0,0],[-9.936,0.768],[0,0],[0.768,9.936],[0,0],[0,0],[8.019,5.8],[0,0],[0,0],[0,0]],"v":[[-62.52,-43.8],[-92.241,-43.739],[-110,-24.533],[-109.942,25.872],[-90.736,43.631],[-60.045,43.631],[1.05,96.204],[26.913,93.159],[31.587,80.57],[31.56,48.31]],"c":true}]},{"i":{"x":0.5,"y":1},"o":{"x":0.3,"y":0},"t":32,"s":[{"i":[[0,0],[0,0],[0,-10.133],[0,0],[-10.133,0],[0,0],[0,0],[-6.581,7.634],[0.521,7.458],[0,0]],"o":[[0,0],[-9.936,0.768],[0,0],[0.768,9.936],[0,0],[0,0],[8.019,5.8],[0,0],[0,0],[0,0]],"v":[[-62.52,-43.8],[-92.241,-43.739],[-110,-24.533],[-109.942,25.872],[-90.736,43.631],[-60.045,43.631],[1.05,96.204],[26.913,93.159],[31.587,80.57],[31.56,48.31]],"c":true}]},{"i":{"x":0.5,"y":1},"o":{"x":0.3,"y":0},"t":35,"s":[{"i":[[0,0],[0,0],[0,-10.133],[0,0],[-10.133,0],[0,0],[0,0],[-6.581,7.634],[1.949,10.639],[0.09,22.419]],"o":[[0,0],[-9.936,0.768],[0,0],[0.768,9.936],[0,0],[0,0],[8.019,5.8],[0,0],[-1.505,-8.217],[-0.025,-6.364]],"v":[[-62.52,-43.8],[-96.629,-43.739],[-114.388,-24.533],[-114.33,25.872],[-95.124,43.631],[-60.045,43.631],[1.05,96.204],[26.913,93.159],[29.811,77.685],[25.508,36.171]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.3,"y":0},"t":38,"s":[{"i":[[0,0],[0,0],[0,-10.133],[0,0],[-10.133,0],[-7.153,0.039],[-21.359,-12.11],[-6.581,7.634],[0.521,7.459],[2.114,12.986]],"o":[[0,0],[-9.936,0.768],[0,0],[0.768,9.936],[0,0],[16.566,19.456],[7.949,4.507],[0,0],[0,0],[-11.935,-14.834]],"v":[[-62.52,-43.8],[-97.241,-43.739],[-115,-24.533],[-114.942,25.872],[-95.736,43.631],[-60.045,43.631],[1.05,96.204],[26.913,93.159],[31.587,80.57],[33.15,48.86]],"c":true}]},{"t":41,"s":[{"i":[[0,0],[0,0],[0,-10.133],[0,0],[-10.133,0],[0,0],[0,0],[-6.581,7.634],[0.521,7.458],[0,0]],"o":[[0,0],[-9.936,0.768],[0,0],[0.768,9.936],[0,0],[0,0],[8.019,5.8],[0,0],[0,0],[0,0]],"v":[[-62.52,-43.8],[-97.241,-43.739],[-115,-24.533],[-114.942,25.872],[-95.736,43.631],[-60.045,43.631],[1.05,96.204],[26.913,93.159],[31.587,80.57],[31.56,48.31]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/submodules/TelegramUI/Resources/Animations/anim_proximity_set.json b/submodules/TelegramUI/Resources/Animations/anim_proximity_set.json new file mode 100644 index 0000000000..1d0a11dacb --- /dev/null +++ b/submodules/TelegramUI/Resources/Animations/anim_proximity_set.json @@ -0,0 +1 @@ +{"v":"5.5.9","fr":60,"ip":0,"op":90,"w":96,"h":96,"nm":"unmuted","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Wibe Small","parent":4,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":31,"s":[0]},{"t":65,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.629,"y":1},"o":{"x":0.406,"y":0},"t":31,"s":[-20.893,-2.061,0],"to":[0,0,0],"ti":[0,0,0]},{"t":65,"s":[18.5,-1,0]}],"ix":2},"a":{"a":0,"k":[15.33,-0.502,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.3,"y":0},"t":31,"s":[{"i":[[0,0],[-0.009,-6.13],[-0.016,-1.35]],"o":[[-0.116,2.404],[0.013,8.945],[0,0]],"v":[[59.374,-16.1],[59.775,-0.714],[59.307,15.605]],"c":false}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":40,"s":[{"i":[[0,0],[0.165,-7.43],[1.821,-2.411]],"o":[[1.925,2.774],[-0.182,8.183],[0,0]],"v":[[57.353,-11.272],[61.714,4.401],[57.44,20.536]],"c":false}]},{"i":{"x":0.7,"y":1},"o":{"x":0.167,"y":0.167},"t":52,"s":[{"i":[[0,0],[0.441,-11.65],[4.197,-6.894]],"o":[[3.043,4.15],[-0.528,13.953],[0,0]],"v":[[57.133,-24.235],[65.05,1.97],[56.767,29.662]],"c":false}]},{"t":65,"s":[{"i":[[0,0],[0,-14.85],[10.89,-7.92]],"o":[[11.88,7.92],[0,14.85],[0,0]],"v":[[49.43,-35.642],[69.23,-0.002],[50.42,35.638]],"c":false}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.74],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":40,"s":[5]},{"t":65,"s":[13.5]}],"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Path","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":90,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Wibe Big 3","parent":4,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":14,"s":[0]},{"t":50,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.308,"y":1},"o":{"x":0.241,"y":0},"t":14,"s":[-79.5,-1,0],"to":[0,0,0],"ti":[0,0,0]},{"t":65,"s":[18.5,-1,0]}],"ix":2},"a":{"a":0,"k":[15.5,-1,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.408,"y":0},"t":14,"s":[{"i":[[0,0],[0.196,-4.879],[0,0]],"o":[[0,0],[-0.196,4.879],[0,0]],"v":[[98.453,-10.424],[98.23,-0.171],[98.083,10.599]],"c":false}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":36,"s":[{"i":[[0,0],[-0.188,-13.523],[4.2,-6.174]],"o":[[4.558,6.003],[0.198,14.222],[0,0]],"v":[[84.934,-27.524],[94.691,-0.041],[84.799,29.518]],"c":false}]},{"i":{"x":0.566,"y":1},"o":{"x":0.167,"y":0.167},"t":52,"s":[{"i":[[0,0],[-0.048,-26.287],[17.786,-12.775]],"o":[[15.591,11.854],[0.051,26.467],[0,0]],"v":[[62.952,-58.587],[91.219,-0.512],[62.917,59.097]],"c":false}]},{"t":65,"s":[{"i":[[0,0],[0,-30.69],[25.913,-12.148]],"o":[[25.566,13.088],[0,30.69],[0,0]],"v":[[55.37,-69.302],[96.177,0.208],[55.37,69.298]],"c":false}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":25,"s":[6]},{"t":65,"s":[13.5]}],"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Path","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":90,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Wibe Big","parent":4,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":31,"s":[100]},{"t":41,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.594,"y":1},"o":{"x":0.337,"y":0},"t":7,"s":[-79.5,-1,0],"to":[0,0,0],"ti":[0,0,0]},{"t":36,"s":[21.958,-0.302,0]}],"ix":2},"a":{"a":0,"k":[15.5,-1,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.861},"o":{"x":0.3,"y":0},"t":12,"s":[{"i":[[0,0],[0.196,-4.879],[0,0]],"o":[[0,0],[-0.196,4.879],[0,0]],"v":[[98.453,-10.424],[98.23,-0.171],[98.083,10.599]],"c":false}]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.139},"t":23,"s":[{"i":[[0,0],[0.05,-16.759],[6.809,-8.401]],"o":[[6.802,7.924],[-0.05,16.759],[0,0]],"v":[[71.913,-37.652],[84.817,-0.054],[71.818,37.718]],"c":false}]},{"i":{"x":0.39,"y":1},"o":{"x":0.167,"y":0.167},"t":30,"s":[{"i":[[0,0],[0.01,-27.943],[10.632,-12.007]],"o":[[12.394,11.445],[-0.01,27.943],[0,0]],"v":[[63.041,-58.706],[87.525,-1.151],[62.647,61.36]],"c":false}]},{"t":36,"s":[{"i":[[0,0],[0.495,-39.802],[16.782,-12.995]],"o":[[16.502,12.327],[-0.382,30.688],[0,0]],"v":[[62.773,-72.313],[96.177,0.208],[63.748,72.382]],"c":false}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.7],"y":[1]},"o":{"x":[0.3],"y":[0]},"t":12,"s":[6]},{"t":36,"s":[13.5]}],"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Path","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":90,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"BODY","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.4],"y":[1]},"o":{"x":[0.4],"y":[0]},"t":0,"s":[15]},{"i":{"x":[0.586],"y":[1]},"o":{"x":[0.634],"y":[0]},"t":22,"s":[-7]},{"t":65,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.488,"y":0.586},"o":{"x":0.613,"y":0},"t":0,"s":[46.795,56.499,0],"to":[-1.088,-5.406,0],"ti":[0.368,-0.034,0]},{"i":{"x":0.7,"y":1},"o":{"x":0.4,"y":0.961},"t":20,"s":[39.361,48.946,0],"to":[0.625,-0.253,0],"ti":[0,0,0]},{"i":{"x":0.4,"y":1},"o":{"x":0.4,"y":0},"t":33,"s":[40.928,50.633,0],"to":[0,0,0],"ti":[0.435,-0.007,0]},{"i":{"x":0.32,"y":1},"o":{"x":0.328,"y":0},"t":48,"s":[39.701,49.033,0],"to":[-0.435,0.007,0],"ti":[0,0,0]},{"t":65,"s":[39.115,47.966,0]}],"ix":2},"a":{"a":0,"k":[-41.65,-0.159,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.4,0.4,0.4],"y":[1,1,1]},"o":{"x":[0.4,0.4,0.4],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"i":{"x":[0.441,0.441,0.441],"y":[1,1,1]},"o":{"x":[0.32,0.32,0.32],"y":[0,0,0]},"t":16,"s":[20.907,20.907,100]},{"i":{"x":[0.5,0.5,0.5],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"t":30,"s":[19.627,19.627,100]},{"t":65,"s":[21.333,21.333,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.3,"y":0},"t":0,"s":[{"i":[[0,0],[0,0],[-4.95,0],[0,-9.9],[0,0],[0,0],[2.97,-2.97],[7.92,6.93],[0,0],[0,0],[0,9.9],[0,0],[-9.9,0]],"o":[[0,0],[2.97,-1.98],[10.89,0],[0,0],[0,0],[0,4.95],[-6.93,7.92],[0,0],[0,0],[-10.89,0],[0,0],[0,-10.89],[0,0]],"v":[[-59.47,-43.562],[-0.07,-95.042],[11.81,-99.002],[30.62,-80.192],[30.62,-2.999],[30.62,80.188],[25.67,92.068],[-1.06,94.048],[-60.46,42.568],[-95.11,42.568],[-113.92,23.758],[-113.92,-24.752],[-95.11,-43.562]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.167,"y":0.167},"t":7,"s":[{"i":[[0,0],[0,0],[-4.95,0],[0,-9.9],[0,0],[0,0],[2.97,-2.97],[7.92,6.93],[0,0],[0,0],[0,9.9],[0,0],[-9.9,0]],"o":[[0,0],[2.97,-1.98],[10.89,0],[0,0],[0,0],[0,4.95],[-6.93,7.92],[0,0],[0,0],[-10.89,0],[0,0],[0,-10.89],[0,0]],"v":[[-62.003,-43.669],[-6.517,-68.676],[5.363,-72.636],[24.173,-53.826],[24.954,-3.755],[23.316,58.255],[18.366,70.135],[-8.364,72.115],[-62.993,42.461],[-93.504,42.324],[-112.314,23.514],[-112.314,-24.996],[-93.504,-43.806]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.36,"y":0},"t":17,"s":[{"i":[[0,0],[0,0],[-4.95,0],[1.107,-9.648],[0.88,-25.278],[-0.355,-10.283],[2.97,-2.97],[7.92,6.93],[0,0],[0,0],[0,9.9],[0,0],[-9.9,0]],"o":[[0,0],[2.97,-1.98],[10.89,0],[-1.367,11.915],[-0.972,27.928],[0.156,4.513],[-6.93,7.92],[0,0],[0,0],[-10.89,0],[0,0],[0,-10.89],[0,0]],"v":[[-66.226,-43.848],[-15.18,-97.059],[-3.3,-101.019],[15.51,-82.209],[13.223,-5.246],[15.51,78.171],[10.56,90.051],[-16.17,92.031],[-67.216,42.282],[-90.826,41.917],[-109.636,23.107],[-109.636,-25.403],[-90.826,-44.213]],"c":true}]},{"i":{"x":0.7,"y":1},"o":{"x":0.479,"y":0},"t":30,"s":[{"i":[[0,0],[0,0],[-4.95,0],[0,-9.9],[0,0],[0,0],[2.97,-2.97],[7.92,6.93],[0,0],[0,0],[0,9.9],[0,0],[-9.9,0]],"o":[[0,0],[2.97,-1.98],[10.89,0],[0,0],[0,0],[0,4.95],[-6.93,7.92],[0,0],[0,0],[-10.89,0],[0,0],[0,-10.89],[0,0]],"v":[[-59.47,-43.562],[5.824,-95.267],[17.704,-99.227],[36.514,-80.417],[36.514,-3.224],[36.514,79.963],[31.564,91.843],[4.834,93.823],[-60.46,42.568],[-101.168,43.04],[-119.978,24.23],[-119.978,-24.28],[-101.168,-43.09]],"c":true}]},{"i":{"x":0.517,"y":1},"o":{"x":0.3,"y":0},"t":45,"s":[{"i":[[0,0],[0,0],[-4.95,0],[0.596,-10.874],[1.491,-29.071],[0.292,-18.58],[2.97,-2.97],[7.92,6.93],[0,0],[0,0],[0,9.9],[0,0],[-9.9,0]],"o":[[0,0],[2.97,-1.98],[10.89,0],[-0.668,12.188],[-1.842,35.92],[-0.065,4.154],[-6.93,7.92],[0,0],[0,0],[-10.89,0],[0,0],[0,-10.89],[0,0]],"v":[[-66.226,-43.848],[-15.18,-97.059],[-3.3,-101.019],[15.247,-82.228],[12.356,-5.246],[14.535,77.043],[10.56,90.051],[-16.17,92.031],[-67.216,42.282],[-95.11,42.568],[-113.92,23.758],[-113.92,-24.752],[-95.11,-43.562]],"c":true}]},{"t":65,"s":[{"i":[[0,0],[0,0],[-4.95,0],[0,-9.9],[0,0],[0,0],[2.97,-2.97],[7.92,6.93],[0,0],[0,0],[0,9.9],[0,0],[-9.9,0]],"o":[[0,0],[2.97,-1.98],[10.89,0],[0,0],[0,0],[0,4.95],[-6.93,7.92],[0,0],[0,0],[-10.89,0],[0,0],[0,-10.89],[0,0]],"v":[[-59.47,-43.562],[-0.07,-95.042],[11.81,-99.002],[30.62,-80.192],[30.62,-2.999],[30.62,80.188],[25.67,92.068],[-1.06,94.048],[-60.46,42.568],[-95.11,42.568],[-113.92,23.758],[-113.92,-24.752],[-95.11,-43.562]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Преобразовать"}],"nm":"Path-8","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/submodules/UndoUI/Sources/UndoOverlayController.swift b/submodules/UndoUI/Sources/UndoOverlayController.swift index 858a384ae9..1b593ac46c 100644 --- a/submodules/UndoUI/Sources/UndoOverlayController.swift +++ b/submodules/UndoUI/Sources/UndoOverlayController.swift @@ -21,6 +21,7 @@ public enum UndoOverlayContent { case chatAddedToFolder(chatTitle: String, folderTitle: String) case chatRemovedFromFolder(chatTitle: String, folderTitle: String) case messagesUnpinned(title: String, text: String, undo: Bool, isHidden: Bool) + case setProximityAlert(title: String, text: String, cancelled: Bool) } public enum UndoOverlayAction { diff --git a/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift b/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift index 12c9375ec2..6674aed6f0 100644 --- a/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift +++ b/submodules/UndoUI/Sources/UndoOverlayControllerNode.swift @@ -221,7 +221,7 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { } displayUndo = undo - self.originalRemainingSeconds = undo ? 5 : 5 + self.originalRemainingSeconds = 5 case let .emoji(path, text): self.iconNode = nil self.iconCheckNode = nil @@ -388,6 +388,23 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { } }) } + case let .setProximityAlert(title, text, cancelled): + self.iconNode = nil + self.iconCheckNode = nil + self.animationNode = AnimationNode(animation: cancelled ? "anim_proximity_cancelled" : "anim_proximity_set", colors: [:], scale: 0.45) + self.animatedStickerNode = nil + + let body = MarkdownAttributeSet(font: Font.regular(14.0), textColor: .white) + let bold = MarkdownAttributeSet(font: Font.semibold(14.0), textColor: .white) + let link = MarkdownAttributeSet(font: Font.regular(14.0), textColor: undoTextColor) + let attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: body, bold: bold, link: link, linkAttribute: { _ in return nil }), textAlignment: .natural) + self.titleNode.attributedText = NSAttributedString(string: title, font: Font.semibold(14.0), textColor: .white) + if !text.isEmpty { + self.textNode.attributedText = attributedText + } + + displayUndo = false + self.originalRemainingSeconds = 3 } self.remainingSeconds = self.originalRemainingSeconds @@ -416,7 +433,7 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { switch content { case .removedChat: self.panelWrapperNode.addSubnode(self.timerTextNode) - case .archivedChat, .hidArchive, .revealedArchive, .succeed, .emoji, .swipeToReply, .actionSucceeded, .stickersModified, .chatAddedToFolder, .chatRemovedFromFolder, .messagesUnpinned: + case .archivedChat, .hidArchive, .revealedArchive, .succeed, .emoji, .swipeToReply, .actionSucceeded, .stickersModified, .chatAddedToFolder, .chatRemovedFromFolder, .messagesUnpinned, .setProximityAlert: break case .dice: self.panelWrapperNode.clipsToBounds = true