diff --git a/TelegramUI.xcodeproj/project.pbxproj b/TelegramUI.xcodeproj/project.pbxproj index 1d20a5e502..a6a042cebd 100644 --- a/TelegramUI.xcodeproj/project.pbxproj +++ b/TelegramUI.xcodeproj/project.pbxproj @@ -184,6 +184,7 @@ 09F85BA521E7821500D73170 /* ThemeGridSelectionPanelNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F85BA421E7821500D73170 /* ThemeGridSelectionPanelNode.swift */; }; 09F85BA721E7DA5F00D73170 /* BlurredImageNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F85BA621E7DA5F00D73170 /* BlurredImageNode.swift */; }; 09FE756D2153F5F900A3120F /* CallRouteActionSheetItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09FE756C2153F5F900A3120F /* CallRouteActionSheetItem.swift */; }; + 09FFBCD1227B7F9900C33B4B /* anim_archiveswipe.json in Resources */ = {isa = PBXBuildFile; fileRef = 09FFBCCF227B7F9000C33B4B /* anim_archiveswipe.json */; }; 9F06830921A404AB001D8EDB /* NotificationExceptionControllerNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F06830821A404AB001D8EDB /* NotificationExceptionControllerNode.swift */; }; 9F06830B21A404C4001D8EDB /* NotificationExceptionSettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F06830A21A404C4001D8EDB /* NotificationExceptionSettingsController.swift */; }; D000CABA21EE130D0011B15D /* MapResourceToAvatarSizes.swift in Sources */ = {isa = PBXBuildFile; fileRef = D000CAB921EE130D0011B15D /* MapResourceToAvatarSizes.swift */; }; @@ -1372,6 +1373,7 @@ 09F85BA421E7821500D73170 /* ThemeGridSelectionPanelNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeGridSelectionPanelNode.swift; sourceTree = ""; }; 09F85BA621E7DA5F00D73170 /* BlurredImageNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurredImageNode.swift; sourceTree = ""; }; 09FE756C2153F5F900A3120F /* CallRouteActionSheetItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallRouteActionSheetItem.swift; sourceTree = ""; }; + 09FFBCCF227B7F9000C33B4B /* anim_archiveswipe.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = anim_archiveswipe.json; sourceTree = ""; }; 9F06830821A404AB001D8EDB /* NotificationExceptionControllerNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationExceptionControllerNode.swift; sourceTree = ""; }; 9F06830A21A404C4001D8EDB /* NotificationExceptionSettingsController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationExceptionSettingsController.swift; sourceTree = ""; }; D000CAB921EE130D0011B15D /* MapResourceToAvatarSizes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapResourceToAvatarSizes.swift; sourceTree = ""; }; @@ -2526,6 +2528,7 @@ 09310D13213BC5DE0020033A /* Animations */ = { isa = PBXGroup; children = ( + 09FFBCCF227B7F9000C33B4B /* anim_archiveswipe.json */, 094735182277483B00EA2312 /* anim_infotip.json */, 094735072275D72000EA2312 /* anim_archive.json */, 094735092275D72000EA2312 /* anim_delete.json */, @@ -5253,6 +5256,7 @@ D0E9BA961F056F4C00F079A4 /* stp_card_applepay@3x.png in Resources */, D0F9720F1FFE4BD5002595C8 /* notification.caf in Resources */, 09310D33213ED5FC0020033A /* anim_group.json in Resources */, + 09FFBCD1227B7F9900C33B4B /* anim_archiveswipe.json in Resources */, 094735162275D72100EA2312 /* anim_unmute.json in Resources */, 094735102275D72100EA2312 /* anim_read.json in Resources */, D0E9BA9A1F056F4C00F079A4 /* stp_card_cvc@3x.png in Resources */, diff --git a/TelegramUI/ChatListController.swift b/TelegramUI/ChatListController.swift index dc8398dab8..87ae1128f8 100644 --- a/TelegramUI/ChatListController.swift +++ b/TelegramUI/ChatListController.swift @@ -471,7 +471,7 @@ public class ChatListController: TelegramController, KeyShortcutResponder, UIVie } }), in: .current) } else { - strongSelf.present(UndoOverlayController(context: strongSelf.context, content: .hidArchive(title: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedTitle, text: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedText, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in + strongSelf.present(UndoOverlayController(context: strongSelf.context, content: .revealedArchive(title: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedTitle, text: strongSelf.presentationData.strings.ChatList_UndoArchiveRevealedText, undo: false), elevatedLayout: false, animateInAsReplacement: true, action: { _ in }), in: .current) } }) diff --git a/TelegramUI/Resources/Animations/anim_archiveswipe.json b/TelegramUI/Resources/Animations/anim_archiveswipe.json new file mode 100644 index 0000000000..4a49433153 --- /dev/null +++ b/TelegramUI/Resources/Animations/anim_archiveswipe.json @@ -0,0 +1 @@ +{"v":"5.5.1","fr":60,"ip":0,"op":120,"w":36,"h":48,"nm":"icswipe 5","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Archiveicon","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":60,"s":[18]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":75,"s":[18]},{"t":90,"s":[18]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":60,"s":[37.333]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":75,"s":[22.375]},{"t":90,"s":[23.5]}],"ix":4}},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":60,"s":[5.333,5.333,100]},{"t":75,"s":[16.667,16.667,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0.87,0],[0,0],[0,0.86]],"o":[[0,0],[0,0],[0,0.86],[0,0],[-0.87,0],[0,0]],"v":[[-9.5,-4],[9.5,-4],[9.5,8.44],[7.92,10],[-7.92,10],[-9.5,8.44]],"c":true},"ix":2},"nm":"contour1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.9,0],[0,0],[0,-0.92],[0,0],[0,0],[0,0]],"o":[[0,0],[0.9,0],[0,0],[0,0],[0,0],[0,-0.92]],"v":[[-8.88,-10],[8.88,-10],[10.5,-8.33],[10.5,-5],[-10.5,-5],[-10.5,-8.33]],"c":true},"ix":2},"nm":"contour2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,0],[0,-0.55],[-0.55,0],[0,0],[0,0.55],[0.55,0]],"o":[[-0.55,0],[0,0.55],[0,0],[0.55,0],[0,-0.55],[0,0]],"v":[[-3,-1.5],[-4,-0.5],[-3,0.5],[3,0.5],[4,-0.5],[3,-1.5]],"c":true},"ix":2},"nm":"contour3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"unite","mn":"ADBE Vector Filter - Merge","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","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":[600,600],"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":"Transform"}],"nm":"Shape","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":60,"op":120,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Oval","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":30,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.331,"y":1},"o":{"x":0.333,"y":0},"t":30,"s":[18,17.333,0],"to":[0,3.333,0],"ti":[0,-3.333,0]},{"t":60,"s":[18,37.333,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":10,"s":[12.5,12.5,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":30,"s":[16.667,16.667,100]},{"t":60,"s":[8.333,8.333,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[16,16],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"contour","mn":"ADBE Vector Shape - Ellipse","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","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":[600,600],"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":"Transform"}],"nm":"Oval","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":3,"ty":4,"nm":"Oval 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[20]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":15,"s":[20]},{"t":35,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[18,17.333,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.398,0.398,0.593],"y":[1,1,-22.251]},"o":{"x":[0.202,0.202,0.175],"y":[0.15,0.15,10.582]},"t":0,"s":[0,0,100]},{"t":20,"s":[30,30,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[16,16],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"contour","mn":"ADBE Vector Shape - Ellipse","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","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":[600,600],"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":"Transform"}],"nm":"Oval 2","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":120,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Track","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.297],"y":[0]},"t":30,"s":[20]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":48,"s":[20]},{"t":60,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[18,27.333,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[16.667,16.667,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.336,"y":1},"o":{"x":0.333,"y":0},"t":30,"s":[{"i":[[0,-4.418],[0,0],[4.418,0],[0,4.418],[0,0],[-4.418,0]],"o":[[0,0],[0,4.418],[-4.418,0],[0,0],[0,-4.418],[4.418,0]],"v":[[8,-10],[8,-10],[0,-2],[-8,-10],[-8,-10],[0,-18]],"c":true}]},{"t":60,"s":[{"i":[[0,-4.418],[0,0],[4.418,0],[0,4.418],[0,0],[-4.418,0]],"o":[[0,0],[0,4.418],[-4.418,0],[0,0],[0,-4.418],[4.418,0]],"v":[[8,-6.667],[8,10],[0,18],[-8,10],[-8,-6.667],[0,-14.667]],"c":true}]}],"ix":2},"nm":"contour","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","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":[600,600],"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":"Transform"}],"nm":"Rectangle","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":30,"op":120,"st":0,"bm":0}],"markers":[]} diff --git a/TelegramUI/UndoOverlayController.swift b/TelegramUI/UndoOverlayController.swift index afc4cc3730..750f660c05 100644 --- a/TelegramUI/UndoOverlayController.swift +++ b/TelegramUI/UndoOverlayController.swift @@ -7,6 +7,7 @@ public enum UndoOverlayContent { case removedChat(text: String) case archivedChat(peerId: PeerId, title: String, text: String, undo: Bool) case hidArchive(title: String, text: String, undo: Bool) + case revealedArchive(title: String, text: String, undo: Bool) } public final class UndoOverlayController: ViewController { diff --git a/TelegramUI/UndoOverlayControllerNode.swift b/TelegramUI/UndoOverlayControllerNode.swift index c2fd0f06f0..70e625e06e 100644 --- a/TelegramUI/UndoOverlayControllerNode.swift +++ b/TelegramUI/UndoOverlayControllerNode.swift @@ -80,16 +80,16 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { displayUndo = undo self.originalRemainingSeconds = 5 case let .hidArchive(title, text, undo): - if undo { - self.iconNode = ASImageNode() - self.iconNode?.displayWithoutProcessing = true - self.iconNode?.displaysAsynchronously = false - self.iconNode?.image = UIImage(bundleImageName: "Chat List/HidArchiveUndoIcon") - self.animationNode = nil - } else { - self.iconNode = nil - self.animationNode = AnimationNode(animation: "anim_infotip", colors: ["info1.info1.stroke": self.animationBackgroundColor, "info2.info2.Fill": self.animationBackgroundColor], scale: 1.0) - } + self.iconNode = nil + self.animationNode = AnimationNode(animation: "anim_archiveswipe", colors: ["info1.info1.stroke": self.animationBackgroundColor, "info2.info2.Fill": self.animationBackgroundColor], scale: 1.0) + self.iconCheckNode = nil + self.titleNode.attributedText = NSAttributedString(string: title, font: Font.semibold(14.0), textColor: .white) + self.textNode.attributedText = NSAttributedString(string: text, font: Font.regular(14.0), textColor: .white) + displayUndo = undo + self.originalRemainingSeconds = 3 + case let .revealedArchive(title, text, undo): + self.iconNode = nil + self.animationNode = AnimationNode(animation: "anim_infotip", colors: ["info1.info1.stroke": self.animationBackgroundColor, "info2.info2.Fill": self.animationBackgroundColor], scale: 1.0) self.iconCheckNode = nil self.titleNode.attributedText = NSAttributedString(string: title, font: Font.semibold(14.0), textColor: .white) self.textNode.attributedText = NSAttributedString(string: text, font: Font.regular(14.0), textColor: .white) @@ -126,7 +126,7 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode { case .removedChat: self.panelWrapperNode.addSubnode(self.timerTextNode) self.panelWrapperNode.addSubnode(self.statusNode) - case .archivedChat, .hidArchive: + case .archivedChat, .hidArchive, .revealedArchive: break } self.iconNode.flatMap(self.panelWrapperNode.addSubnode)