diff --git a/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@2x.png b/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@2x.png index 214210146c..da97589fe9 100644 Binary files a/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@2x.png and b/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@2x.png differ diff --git a/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@3x.png b/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@3x.png index 5d21ccfc00..ab43767395 100644 Binary files a/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@3x.png and b/Images.xcassets/Settings/PasscodeFaceId.imageset/faceid@3x.png differ diff --git a/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@2x.png b/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@2x.png index 73c9bca8bb..bbe19e0203 100644 Binary files a/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@2x.png and b/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@2x.png differ diff --git a/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@3x.png b/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@3x.png index 0136c0157b..8f50a473cb 100644 Binary files a/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@3x.png and b/Images.xcassets/Settings/PasscodeIntroIcon.imageset/PasscodePlaceholderIcon@3x.png differ diff --git a/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@2x.png b/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@2x.png index b8e8f15e20..7046d67d01 100644 Binary files a/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@2x.png and b/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@2x.png differ diff --git a/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@3x.png b/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@3x.png index ebad5d4a72..e2f9113a71 100644 Binary files a/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@3x.png and b/Images.xcassets/Settings/PasscodeTouchId.imageset/touchid@3x.png differ diff --git a/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@2x.png b/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@2x.png index e47006e63e..c9cd47a84c 100644 Binary files a/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@2x.png and b/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@2x.png differ diff --git a/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@3x.png b/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@3x.png index 393a9de85e..8ce614090f 100644 Binary files a/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@3x.png and b/Images.xcassets/Settings/PasswordIntroIcon.imageset/PasswordPlaceholderIcon@3x.png differ diff --git a/TelegramUI.xcodeproj/project.pbxproj b/TelegramUI.xcodeproj/project.pbxproj index ec5c240dd6..ff9173e1b5 100644 --- a/TelegramUI.xcodeproj/project.pbxproj +++ b/TelegramUI.xcodeproj/project.pbxproj @@ -154,7 +154,7 @@ 09F2159A2263E62900AEDF6D /* PasscodeEntryController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F215992263E62900AEDF6D /* PasscodeEntryController.swift */; }; 09F2159C2263E63200AEDF6D /* PasscodeEntryControllerNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F2159B2263E63200AEDF6D /* PasscodeEntryControllerNode.swift */; }; 09F215A022649BCB00AEDF6D /* PasscodeEntryInputFieldNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F2159F22649BCB00AEDF6D /* PasscodeEntryInputFieldNode.swift */; }; - 09F215A422649C2200AEDF6D /* PasscodeEntryTitleNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F215A322649C2200AEDF6D /* PasscodeEntryTitleNode.swift */; }; + 09F215A422649C2200AEDF6D /* PasscodeEntryLabelNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F215A322649C2200AEDF6D /* PasscodeEntryLabelNode.swift */; }; 09F215A622649C3000AEDF6D /* PasscodeLockIconNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F215A522649C3000AEDF6D /* PasscodeLockIconNode.swift */; }; 09F215A822649C7900AEDF6D /* PasscodeEntryKeyboardNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F215A722649C7900AEDF6D /* PasscodeEntryKeyboardNode.swift */; }; 09F215AB2264ABA600AEDF6D /* PasscodeBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F215AA2264ABA600AEDF6D /* PasscodeBackground.swift */; }; @@ -1336,7 +1336,7 @@ 09F215992263E62900AEDF6D /* PasscodeEntryController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryController.swift; sourceTree = ""; }; 09F2159B2263E63200AEDF6D /* PasscodeEntryControllerNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryControllerNode.swift; sourceTree = ""; }; 09F2159F22649BCB00AEDF6D /* PasscodeEntryInputFieldNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryInputFieldNode.swift; sourceTree = ""; }; - 09F215A322649C2200AEDF6D /* PasscodeEntryTitleNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryTitleNode.swift; sourceTree = ""; }; + 09F215A322649C2200AEDF6D /* PasscodeEntryLabelNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryLabelNode.swift; sourceTree = ""; }; 09F215A522649C3000AEDF6D /* PasscodeLockIconNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeLockIconNode.swift; sourceTree = ""; }; 09F215A722649C7900AEDF6D /* PasscodeEntryKeyboardNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryKeyboardNode.swift; sourceTree = ""; }; 09F215AA2264ABA600AEDF6D /* PasscodeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeBackground.swift; sourceTree = ""; }; @@ -2731,7 +2731,7 @@ 09F2159B2263E63200AEDF6D /* PasscodeEntryControllerNode.swift */, 09F215A722649C7900AEDF6D /* PasscodeEntryKeyboardNode.swift */, 09F2159F22649BCB00AEDF6D /* PasscodeEntryInputFieldNode.swift */, - 09F215A322649C2200AEDF6D /* PasscodeEntryTitleNode.swift */, + 09F215A322649C2200AEDF6D /* PasscodeEntryLabelNode.swift */, 09F215A522649C3000AEDF6D /* PasscodeLockIconNode.swift */, 09F215AC2264DC4500AEDF6D /* PasscodeSetupController.swift */, 09DE2F242269B7E80045E975 /* PasscodeSetupControllerNode.swift */, @@ -6134,7 +6134,7 @@ D099D74F1EEFEE6A00A3128C /* GameControllerNode.swift in Sources */, D0943AF61FDAAE7E001522CC /* MultipleAvatarsNode.swift in Sources */, D0EC6E2B1EB9F58900EBF1C3 /* ComposeController.swift in Sources */, - 09F215A422649C2200AEDF6D /* PasscodeEntryTitleNode.swift in Sources */, + 09F215A422649C2200AEDF6D /* PasscodeEntryLabelNode.swift in Sources */, D099D74D1EEFEE1500A3128C /* GameController.swift in Sources */, 09749BCF21F236F2008FDDE9 /* ModernCheckNode.swift in Sources */, D0EC6E2C1EB9F58900EBF1C3 /* ComposeControllerNode.swift in Sources */, diff --git a/TelegramUI/ChatMessageActionButtonsNode.swift b/TelegramUI/ChatMessageActionButtonsNode.swift index a51ab7c4fc..fde439917e 100644 --- a/TelegramUI/ChatMessageActionButtonsNode.swift +++ b/TelegramUI/ChatMessageActionButtonsNode.swift @@ -72,36 +72,8 @@ private final class ChatMessageActionButtonNode: ASDisplayNode { let titleLayout = TextNode.asyncLayout(maybeNode?.titleNode) return { context, theme, strings, message, button, constrainedWidth, position in - let sideInset: CGFloat = 8.0 - let minimumSideInset: CGFloat = 4.0 - let incoming = message.effectivelyIncoming(context.account.peerId) - - var title = button.title - if case .payment = button.action { - for media in message.media { - if let invoice = media as? TelegramMediaInvoice { - if invoice.receiptMessageId != nil { - title = strings.Message_ReplyActionButtonShowReceipt - } - } - } - } - - let (titleSize, titleApply) = titleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: title, font: titleFont, textColor: incoming ? bubbleVariableColor(variableColor: theme.theme.chat.bubble.actionButtonsIncomingTextColor, wallpaper: theme.wallpaper) : bubbleVariableColor(variableColor: theme.theme.chat.bubble.actionButtonsOutgoingTextColor, wallpaper: theme.wallpaper)), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(44.0, constrainedWidth - minimumSideInset - minimumSideInset), height: CGFloat.greatestFiniteMagnitude), alignment: .center, cutout: nil, insets: UIEdgeInsets(top: 1.0, left: 0.0, bottom: 1.0, right: 0.0))) - let graphics = PresentationResourcesChat.additionalGraphics(theme.theme, wallpaper: theme.wallpaper) - let backgroundImage: UIImage? - switch position { - case .middle: - backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingMiddleImage : graphics.chatBubbleActionButtonOutgoingMiddleImage - case .bottomLeft: - backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingBottomLeftImage : graphics.chatBubbleActionButtonOutgoingBottomLeftImage - case .bottomRight: - backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingBottomRightImage : graphics.chatBubbleActionButtonOutgoingBottomRightImage - case .bottomSingle: - backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingBottomSingleImage : graphics.chatBubbleActionButtonOutgoingBottomSingleImage - } let iconImage: UIImage? switch button.action { @@ -119,6 +91,34 @@ private final class ChatMessageActionButtonNode: ASDisplayNode { iconImage = nil } + let sideInset: CGFloat = 8.0 + let minimumSideInset: CGFloat = 4.0 + (iconImage?.size.width ?? 0.0) + + var title = button.title + if case .payment = button.action { + for media in message.media { + if let invoice = media as? TelegramMediaInvoice { + if invoice.receiptMessageId != nil { + title = strings.Message_ReplyActionButtonShowReceipt + } + } + } + } + + let (titleSize, titleApply) = titleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: title, font: titleFont, textColor: incoming ? bubbleVariableColor(variableColor: theme.theme.chat.bubble.actionButtonsIncomingTextColor, wallpaper: theme.wallpaper) : bubbleVariableColor(variableColor: theme.theme.chat.bubble.actionButtonsOutgoingTextColor, wallpaper: theme.wallpaper)), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(44.0, constrainedWidth - minimumSideInset - minimumSideInset), height: CGFloat.greatestFiniteMagnitude), alignment: .center, cutout: nil, insets: UIEdgeInsets(top: 1.0, left: 0.0, bottom: 1.0, right: 0.0))) + + let backgroundImage: UIImage? + switch position { + case .middle: + backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingMiddleImage : graphics.chatBubbleActionButtonOutgoingMiddleImage + case .bottomLeft: + backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingBottomLeftImage : graphics.chatBubbleActionButtonOutgoingBottomLeftImage + case .bottomRight: + backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingBottomRightImage : graphics.chatBubbleActionButtonOutgoingBottomRightImage + case .bottomSingle: + backgroundImage = incoming ? graphics.chatBubbleActionButtonIncomingBottomSingleImage : graphics.chatBubbleActionButtonOutgoingBottomSingleImage + } + return (titleSize.size.width + sideInset + sideInset, { width in return (CGSize(width: width, height: 42.0), { let node: ChatMessageActionButtonNode diff --git a/TelegramUI/DefaultDarkAccentPresentationTheme.swift b/TelegramUI/DefaultDarkAccentPresentationTheme.swift index cea71a76f2..e05ee2df5b 100644 --- a/TelegramUI/DefaultDarkAccentPresentationTheme.swift +++ b/TelegramUI/DefaultDarkAccentPresentationTheme.swift @@ -142,7 +142,8 @@ private let chatList = PresentationThemeChatList( verifiedIconFillColor: accentColor, verifiedIconForegroundColor: .white, secretIconColor: secretColor, - neutralAvatarColor: UIColor(rgb: 0xDBF5FF, alpha: 0.4) + neutralAvatarColor: UIColor(rgb: 0xDBF5FF, alpha: 0.4), + onlineDotColor: UIColor(rgb: 0x4cc91f) ) private let bubble = PresentationThemeChatBubble( diff --git a/TelegramUI/DefaultDarkPresentationTheme.swift b/TelegramUI/DefaultDarkPresentationTheme.swift index 1e39a31af9..bcb13722f9 100644 --- a/TelegramUI/DefaultDarkPresentationTheme.swift +++ b/TelegramUI/DefaultDarkPresentationTheme.swift @@ -142,7 +142,8 @@ private let chatList = PresentationThemeChatList( verifiedIconFillColor: accentColor, verifiedIconForegroundColor: .white, secretIconColor: secretColor, - neutralAvatarColor: UIColor(rgb: 0x666666) + neutralAvatarColor: UIColor(rgb: 0x666666), + onlineDotColor: UIColor(rgb: 0x4cc91f) ) private let bubble = PresentationThemeChatBubble( diff --git a/TelegramUI/DefaultPresentationTheme.swift b/TelegramUI/DefaultPresentationTheme.swift index a89bcd5502..661f609dd1 100644 --- a/TelegramUI/DefaultPresentationTheme.swift +++ b/TelegramUI/DefaultPresentationTheme.swift @@ -142,7 +142,8 @@ private func makeDefaultPresentationTheme(accentColor: UIColor, serviceBackgroun verifiedIconFillColor: accentColor, verifiedIconForegroundColor: .white, secretIconColor: secretColor, - neutralAvatarColor: UIColor(rgb: 0xb6b6ba) + neutralAvatarColor: UIColor(rgb: 0xb6b6ba), + onlineDotColor: UIColor(rgb: 0x4cc91f) ) let chatListDay = PresentationThemeChatList( @@ -174,7 +175,8 @@ private func makeDefaultPresentationTheme(accentColor: UIColor, serviceBackgroun verifiedIconFillColor: accentColor, verifiedIconForegroundColor: .white, secretIconColor: secretColor, - neutralAvatarColor: UIColor(rgb: 0xb6b6ba) + neutralAvatarColor: UIColor(rgb: 0xb6b6ba), + onlineDotColor: UIColor(rgb: 0x4cc91f) ) let bubble = PresentationThemeChatBubble( diff --git a/TelegramUI/EmojiUtils.swift b/TelegramUI/EmojiUtils.swift index e9699e3765..dcf2729342 100644 --- a/TelegramUI/EmojiUtils.swift +++ b/TelegramUI/EmojiUtils.swift @@ -1,14 +1,22 @@ import Foundation -import UIKit +import CoreText extension UnicodeScalar { var isEmoji: Bool { switch value { - case 0x3030, 0x00AE, 0x00A9, // Special Characters - 0x1D000 ... 0x1F77F, // Emoticons - 0x2100 ... 0x27BF, // Misc symbols and Dingbats - 0xFE00 ... 0xFE0F, // Variation Selectors - 0x1F900 ... 0x1F9FF: // Supplemental Symbols and Pictographs + case 0x1F600...0x1F64F, // Emoticons + 0x1F300...0x1F5FF, // Misc Symbols and Pictographs + 0x1F680...0x1F6FF, // Transport and Map + 0x1F1E6...0x1F1FF, // Regional country flags + 0x2600...0x26FF, // Misc symbols + 0x2700...0x27BF, // Dingbats + 0xE0020...0xE007F, // Tags + 0xFE00...0xFE0F, // Variation Selectors + 0x1F900...0x1F9FF, // Supplemental Symbols and Pictographs + 127000...127600, // Various asian characters + 65024...65039, // Variation selector + 9100...9300, // Misc items + 8400...8447: // Combining Diacritical Marks for Symbols return true default: return false @@ -40,11 +48,13 @@ extension String { } var containsEmoji: Bool { - return !unicodeScalars.filter { $0.isEmoji }.isEmpty + return unicodeScalars.contains { $0.isEmoji } } var containsOnlyEmoji: Bool { - return unicodeScalars.first(where: { !$0.isEmoji && !$0.isZeroWidthJoiner }) == nil + return !isEmpty && !unicodeScalars.contains(where: { + !$0.isEmoji && !$0.isZeroWidthJoiner + }) } // The next tricks are mostly to demonstrate how tricky it can be to determine emoji's diff --git a/TelegramUI/FetchCachedRepresentations.swift b/TelegramUI/FetchCachedRepresentations.swift index f0556668b5..f97b0d9ce2 100644 --- a/TelegramUI/FetchCachedRepresentations.swift +++ b/TelegramUI/FetchCachedRepresentations.swift @@ -690,20 +690,23 @@ private func fetchLargeEmojiRepresentation(account: Account, resource: MediaReso var emojiSize = nsString.size(withAttributes: stringAttributes) emojiSize = CGSize(width: ceil(emojiSize.width) + 2.0, height: ceil(emojiSize.height) + 2.0) - let image = generateImage(emojiSize, contextGenerator: { size, context in + let context = DrawingContext(size: emojiSize, clear: true) + context.withFlippedContext { context in + let size = emojiSize let bounds = CGRect(origin: CGPoint(), size: size) context.clear(CGRect(origin: CGPoint(), size: size)) context.textMatrix = .identity - + let path = CGMutablePath() path.addRect(bounds) let string = NSAttributedString(string: resource.emoji, font: font, textColor: .black) let framesetter = CTFramesetterCreateWithAttributedString(string as CFAttributedString) let frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, string.length), path, nil) CTFrameDraw(frame, context) - })! + } + let image = context.generateImage()! let borderImage = generateTintedImage(image: image, color: .white)! let lineWidth: CGFloat = 1.0 diff --git a/TelegramUI/PasscodeEntryControllerNode.swift b/TelegramUI/PasscodeEntryControllerNode.swift index aeb97526c9..287e9d41e0 100644 --- a/TelegramUI/PasscodeEntryControllerNode.swift +++ b/TelegramUI/PasscodeEntryControllerNode.swift @@ -20,9 +20,9 @@ final class PasscodeEntryControllerNode: ASDisplayNode { private let backgroundNode: ASImageNode private let iconNode: PasscodeLockIconNode - private let titleNode: PasscodeEntryTitleNode + private let titleNode: PasscodeEntryLabelNode private let inputFieldNode: PasscodeEntryInputFieldNode - private let subtitleNode: ASTextNode + private let subtitleNode: PasscodeEntryLabelNode private let keyboardNode: PasscodeEntryKeyboardNode private let deleteButtonNode: HighlightableButtonNode private let biometricButtonNode: HighlightableButtonNode @@ -46,9 +46,9 @@ final class PasscodeEntryControllerNode: ASDisplayNode { self.backgroundNode = ASImageNode() self.iconNode = PasscodeLockIconNode() - self.titleNode = PasscodeEntryTitleNode() + self.titleNode = PasscodeEntryLabelNode() self.inputFieldNode = PasscodeEntryInputFieldNode(color: .white, fieldType: passcodeType, keyboardAppearance: .dark, useCustomNumpad: true) - self.subtitleNode = ASTextNode() + self.subtitleNode = PasscodeEntryLabelNode() self.keyboardNode = PasscodeEntryKeyboardNode() self.deleteButtonNode = HighlightableButtonNode() self.biometricButtonNode = HighlightableButtonNode() @@ -61,6 +61,7 @@ final class PasscodeEntryControllerNode: ASDisplayNode { }) self.backgroundColor = .clear + self.iconNode.unlockedColor = theme.rootController.navigationBar.primaryTextColor self.keyboardNode.charactedEntered = { [weak self] character in self?.inputFieldNode.append(character) @@ -84,6 +85,7 @@ final class PasscodeEntryControllerNode: ASDisplayNode { self.addSubnode(self.iconNode) self.addSubnode(self.titleNode) self.addSubnode(self.inputFieldNode) + self.addSubnode(self.subtitleNode) self.addSubnode(self.keyboardNode) self.addSubnode(self.deleteButtonNode) self.addSubnode(self.biometricButtonNode) @@ -256,6 +258,5 @@ final class PasscodeEntryControllerNode: ASDisplayNode { } transition.updateFrame(node: self.biometricButtonNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - biometricIcon.size.width) / 2.0), y: biometricY), size: biometricIcon.size)) } - } } diff --git a/TelegramUI/PasscodeEntryTitleNode.swift b/TelegramUI/PasscodeEntryLabelNode.swift similarity index 90% rename from TelegramUI/PasscodeEntryTitleNode.swift rename to TelegramUI/PasscodeEntryLabelNode.swift index c2236987b3..b982d9023b 100644 --- a/TelegramUI/PasscodeEntryTitleNode.swift +++ b/TelegramUI/PasscodeEntryLabelNode.swift @@ -8,7 +8,7 @@ enum PasscodeEntryTitleAnimation { case crossFade } -final class PasscodeEntryTitleNode: ASDisplayNode { +final class PasscodeEntryLabelNode: ASDisplayNode { private let wrapperNode: ASDisplayNode private let textNode: ASTextNode @@ -78,10 +78,10 @@ final class PasscodeEntryTitleNode: ASDisplayNode { func updateLayout(layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) -> CGSize { self.validLayout = layout - let titleSize = self.textNode.measure(layout.size) - let titleFrame = CGRect(x: floor((layout.size.width - titleSize.width) / 2.0), y: 0.0, width: titleSize.width, height: titleSize.height) - transition.updateFrame(node: self.wrapperNode, frame: titleFrame) - transition.updateFrame(node: self.textNode, frame: CGRect(origin: CGPoint(), size: titleSize)) + let textSize = self.textNode.measure(layout.size) + let textFrame = CGRect(x: floor((layout.size.width - textSize.width) / 2.0), y: 0.0, width: textSize.width, height: textSize.height) + transition.updateFrame(node: self.wrapperNode, frame: textFrame) + transition.updateFrame(node: self.textNode, frame: CGRect(origin: CGPoint(), size: textSize)) return CGSize(width: layout.size.width, height: 25.0) } diff --git a/TelegramUI/PasscodeLockIconNode.swift b/TelegramUI/PasscodeLockIconNode.swift index 02bdf81307..fc7db5ebeb 100644 --- a/TelegramUI/PasscodeLockIconNode.swift +++ b/TelegramUI/PasscodeLockIconNode.swift @@ -20,6 +20,12 @@ private final class PasscodeLockIconNodeParameters: NSObject { } final class PasscodeLockIconNode: ASDisplayNode { + var unlockedColor: UIColor = .black { + didSet { + self.setNeedsDisplay() + } + } + private var effectiveProgress: CGFloat = 1.0 { didSet { self.setNeedsDisplay() @@ -58,7 +64,7 @@ final class PasscodeLockIconNode: ASDisplayNode { } override func drawParameters(forAsyncLayer layer: _ASDisplayLayer) -> NSObjectProtocol? { - return PasscodeLockIconNodeParameters(unlockedColor: .black, lockedColor: .white, progress: self.effectiveProgress, fromScale: self.fromScale) + return PasscodeLockIconNodeParameters(unlockedColor: self.unlockedColor, lockedColor: .white, progress: self.effectiveProgress, fromScale: self.fromScale) } @objc override class func draw(_ bounds: CGRect, withParameters parameters: Any?, isCancelled: () -> Bool, isRasterizing: Bool) { diff --git a/TelegramUI/PasscodeSetupController.swift b/TelegramUI/PasscodeSetupController.swift index 4ca685012b..24d9162be1 100644 --- a/TelegramUI/PasscodeSetupController.swift +++ b/TelegramUI/PasscodeSetupController.swift @@ -55,6 +55,7 @@ final class PasscodeSetupController: ViewController { let controller = ActionSheetController(presentationTheme: strongSelf.presentationData.theme) let dismissAction: () -> Void = { [weak controller] in + self?.controllerNode.activateInput() controller?.dismissAnimated() } diff --git a/TelegramUI/PresentationResourcesChatList.swift b/TelegramUI/PresentationResourcesChatList.swift index c9af803012..2c0d28a6b8 100644 --- a/TelegramUI/PresentationResourcesChatList.swift +++ b/TelegramUI/PresentationResourcesChatList.swift @@ -150,7 +150,7 @@ struct PresentationResourcesChatList { } context.fillEllipse(in: bounds) - context.setFillColor(theme.chatList.secretIconColor.cgColor) + context.setFillColor(theme.chatList.onlineDotColor.cgColor) context.fillEllipse(in: bounds.insetBy(dx: 2.0, dy: 2.0)) }) }) diff --git a/TelegramUI/PresentationTheme.swift b/TelegramUI/PresentationTheme.swift index a21e565509..cbabe61dfa 100644 --- a/TelegramUI/PresentationTheme.swift +++ b/TelegramUI/PresentationTheme.swift @@ -376,8 +376,9 @@ public final class PresentationThemeChatList { public let verifiedIconForegroundColor: UIColor public let secretIconColor: UIColor public let neutralAvatarColor: UIColor + public let onlineDotColor: UIColor - init(backgroundColor: UIColor, itemSeparatorColor: UIColor, itemBackgroundColor: UIColor, pinnedItemBackgroundColor: UIColor, itemHighlightedBackgroundColor: UIColor, itemSelectedBackgroundColor: UIColor, titleColor: UIColor, secretTitleColor: UIColor, dateTextColor: UIColor, authorNameColor: UIColor, messageTextColor: UIColor, messageDraftTextColor: UIColor, checkmarkColor: UIColor, pendingIndicatorColor: UIColor, muteIconColor: UIColor, unreadBadgeActiveBackgroundColor: UIColor, unreadBadgeActiveTextColor: UIColor, unreadBadgeInactiveBackgroundColor: UIColor, unreadBadgeInactiveTextColor: UIColor, pinnedBadgeColor: UIColor, pinnedSearchBarColor: UIColor, regularSearchBarColor: UIColor, sectionHeaderFillColor: UIColor, sectionHeaderTextColor: UIColor, searchBarKeyboardColor: PresentationThemeKeyboardColor, verifiedIconFillColor: UIColor, verifiedIconForegroundColor: UIColor, secretIconColor: UIColor, neutralAvatarColor: UIColor) { + init(backgroundColor: UIColor, itemSeparatorColor: UIColor, itemBackgroundColor: UIColor, pinnedItemBackgroundColor: UIColor, itemHighlightedBackgroundColor: UIColor, itemSelectedBackgroundColor: UIColor, titleColor: UIColor, secretTitleColor: UIColor, dateTextColor: UIColor, authorNameColor: UIColor, messageTextColor: UIColor, messageDraftTextColor: UIColor, checkmarkColor: UIColor, pendingIndicatorColor: UIColor, muteIconColor: UIColor, unreadBadgeActiveBackgroundColor: UIColor, unreadBadgeActiveTextColor: UIColor, unreadBadgeInactiveBackgroundColor: UIColor, unreadBadgeInactiveTextColor: UIColor, pinnedBadgeColor: UIColor, pinnedSearchBarColor: UIColor, regularSearchBarColor: UIColor, sectionHeaderFillColor: UIColor, sectionHeaderTextColor: UIColor, searchBarKeyboardColor: PresentationThemeKeyboardColor, verifiedIconFillColor: UIColor, verifiedIconForegroundColor: UIColor, secretIconColor: UIColor, neutralAvatarColor: UIColor, onlineDotColor: UIColor) { self.backgroundColor = backgroundColor self.itemSeparatorColor = itemSeparatorColor self.itemBackgroundColor = itemBackgroundColor @@ -407,6 +408,7 @@ public final class PresentationThemeChatList { self.verifiedIconForegroundColor = verifiedIconForegroundColor self.secretIconColor = secretIconColor self.neutralAvatarColor = neutralAvatarColor + self.onlineDotColor = onlineDotColor } } diff --git a/TelegramUI/PrivacyAndSecurityController.swift b/TelegramUI/PrivacyAndSecurityController.swift index 49ca2263ab..3bb969ada8 100644 --- a/TelegramUI/PrivacyAndSecurityController.swift +++ b/TelegramUI/PrivacyAndSecurityController.swift @@ -548,7 +548,7 @@ public func privacyAndSecurityController(context: AccountContext, initialSetting } }) }, openTwoStepVerification: { - pushControllerImpl?(twoStepVerificationUnlockSettingsController(context: context, mode: .access)) + pushControllerImpl?(twoStepVerificationUnlockSettingsController(context: context, mode: .access(intro: true, data: nil))) }, openActiveSessions: { pushControllerImpl?(recentSessionsController(context: context)) }, setupAccountAutoremove: { diff --git a/TelegramUI/PrivacyIntroController.swift b/TelegramUI/PrivacyIntroController.swift index 969140eadf..5e120499fc 100644 --- a/TelegramUI/PrivacyIntroController.swift +++ b/TelegramUI/PrivacyIntroController.swift @@ -12,9 +12,18 @@ enum PrivacyIntroControllerMode { func icon(theme: PresentationTheme) -> UIImage? { switch self { case .passcode: - return UIImage(bundleImageName: "Settings/PasscodeIntroIcon") + return generateTintedImage(image: UIImage(bundleImageName: "Settings/PasscodeIntroIcon"), color: theme.list.freeTextColor) case .twoStepVerification: - return UIImage(bundleImageName: "Settings/PasswordIntroIcon") + return generateTintedImage(image: UIImage(bundleImageName: "Settings/PasswordIntroIcon"), color: theme.list.freeTextColor) + } + } + + func controllerTitle(strings: PresentationStrings) -> String { + switch self { + case .passcode: + return strings.PasscodeSettings_Title + case .twoStepVerification: + return strings.PrivacySettings_TwoStepAuth } } @@ -55,9 +64,18 @@ enum PrivacyIntroControllerMode { } } +final public class PrivacyIntroControllerPresentationArguments { + let fadeIn: Bool + + public init(fadeIn: Bool = false) { + self.fadeIn = fadeIn + } +} + final class PrivacyIntroController: ViewController { private let context: AccountContext private let mode: PrivacyIntroControllerMode + private let arguments: PrivacyIntroControllerPresentationArguments private let proceedAction: () -> Void private var controllerNode: PrivacyIntroControllerNode { @@ -67,9 +85,10 @@ final class PrivacyIntroController: ViewController { private var presentationData: PresentationData private var presentationDataDisposable: Disposable? - init(context: AccountContext, mode: PrivacyIntroControllerMode, proceedAction: @escaping () -> Void) { + init(context: AccountContext, mode: PrivacyIntroControllerMode, arguments: PrivacyIntroControllerPresentationArguments = PrivacyIntroControllerPresentationArguments(), proceedAction: @escaping () -> Void) { self.context = context self.mode = mode + self.arguments = arguments self.proceedAction = proceedAction self.presentationData = context.sharedContext.currentPresentationData.with { $0 } @@ -78,21 +97,21 @@ final class PrivacyIntroController: ViewController { self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBar.style.style - self.title = self.mode.title(strings: self.presentationData.strings) + self.title = self.mode.controllerTitle(strings: self.presentationData.strings) self.presentationDataDisposable = (context.sharedContext.presentationData - |> deliverOnMainQueue).start(next: { [weak self] presentationData in - if let strongSelf = self { - let previousTheme = strongSelf.presentationData.theme - let previousStrings = strongSelf.presentationData.strings - - strongSelf.presentationData = presentationData - - if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings { - strongSelf.updateThemeAndStrings() - } + |> deliverOnMainQueue).start(next: { [weak self] presentationData in + if let strongSelf = self { + let previousTheme = strongSelf.presentationData.theme + let previousStrings = strongSelf.presentationData.strings + + strongSelf.presentationData = presentationData + + if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings { + strongSelf.updateThemeAndStrings() } - }) + } + }) } required public init(coder aDecoder: NSCoder) { @@ -115,6 +134,13 @@ final class PrivacyIntroController: ViewController { self.displayNodeDidLoad() } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + if self.arguments.fadeIn { + self.controllerNode.animateIn() + } + } + override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) { super.containerLayoutUpdated(layout, transition: transition) diff --git a/TelegramUI/PrivacyIntroControllerNode.swift b/TelegramUI/PrivacyIntroControllerNode.swift index 7bc7c71bf2..f1ed517daf 100644 --- a/TelegramUI/PrivacyIntroControllerNode.swift +++ b/TelegramUI/PrivacyIntroControllerNode.swift @@ -42,7 +42,7 @@ final class PrivacyIntroControllerNode: ViewControllerTracingNode { private let buttonTextNode: ASTextNode private let noticeNode: ASTextNode - private var validLayout: ContainerViewLayout? + private var validLayout: (ContainerViewLayout, CGFloat)? init(context: AccountContext, mode: PrivacyIntroControllerMode, proceedAction: @escaping () -> Void) { self.context = context @@ -101,45 +101,61 @@ final class PrivacyIntroControllerNode: ViewControllerTracingNode { self.buttonBackgroundNode.image = generateButtonImage(backgroundColor: presentationData.theme.list.itemBlocksBackgroundColor, borderColor: presentationData.theme.list.itemBlocksSeparatorColor, highlightColor: nil) self.buttonHighlightedBackgroundNode.image = generateButtonImage(backgroundColor: presentationData.theme.list.itemBlocksBackgroundColor, borderColor: presentationData.theme.list.itemBlocksSeparatorColor, highlightColor: presentationData.theme.list.itemHighlightedBackgroundColor) - if let validLayout = self.validLayout { - self.containerLayoutUpdated(validLayout, navigationBarHeight: 0.0, transition: .immediate) + if let (layout, navigationBarHeight) = self.validLayout { + self.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .immediate) } } func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { - self.validLayout = layout + self.validLayout = (layout, navigationBarHeight) - if let iconSize = self.iconNode.image?.size { - transition.updateFrame(node: self.iconNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - iconSize.width) / 2.0), y: 151.0), size: iconSize)) + var insets = layout.insets(options: [.statusBar]) + insets.top += navigationBarHeight + + var iconSize = CGSize() + if let size = self.iconNode.image?.size { + iconSize = size var iconAlpha: CGFloat = 1.0 if case .compact = layout.metrics.widthClass, layout.size.width > layout.size.height { iconAlpha = 0.0 + iconSize = CGSize() } transition.updateAlpha(node: self.iconNode, alpha: iconAlpha) } let inset: CGFloat = 30.0 - let titleSize = self.titleNode.measure(CGSize(width: layout.size.width - inset * 2.0, height: CGFloat.greatestFiniteMagnitude)) - transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - titleSize.width) / 2.0), y: 409.0), size: titleSize)) - let textSize = self.textNode.measure(CGSize(width: layout.size.width - inset * 2.0, height: CGFloat.greatestFiniteMagnitude)) - transition.updateFrame(node: self.textNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - textSize.width) / 2.0), y: 441.0), size: textSize)) - let noticeSize = self.noticeNode.measure(CGSize(width: layout.size.width - inset * 2.0, height: CGFloat.greatestFiniteMagnitude)) - transition.updateFrame(node: self.noticeNode, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - noticeSize.width) / 2.0), y: 610.0), size: noticeSize)) - let buttonFrame = CGRect(x: 0.0, y: 530.0, width: layout.size.width, height: 44.0) - transition.updateFrame(node: self.buttonNode, frame: buttonFrame) - transition.updateFrame(node: self.buttonBackgroundNode, frame: buttonFrame) - transition.updateFrame(node: self.buttonHighlightedBackgroundNode, frame: buttonFrame) + let items: [AuthorizationLayoutItem] = [ + AuthorizationLayoutItem(node: self.iconNode, size: iconSize, spacingBefore: AuthorizationLayoutItemSpacing(weight: 0.0, maxValue: 0.0), spacingAfter: AuthorizationLayoutItemSpacing(weight: 0.0, maxValue: 0.0)), + AuthorizationLayoutItem(node: self.titleNode, size: titleSize, spacingBefore: AuthorizationLayoutItemSpacing(weight: 20.0, maxValue: 30.0), spacingAfter: AuthorizationLayoutItemSpacing(weight: 0.0, maxValue: 0.0)), + AuthorizationLayoutItem(node: self.textNode, size: textSize, spacingBefore: AuthorizationLayoutItemSpacing(weight: 16.0, maxValue: 16.0), spacingAfter: AuthorizationLayoutItemSpacing(weight: 0.0, maxValue: 0.0)), + AuthorizationLayoutItem(node: self.buttonNode, size: CGSize(width: layout.size.width, height: 44.0), spacingBefore: AuthorizationLayoutItemSpacing(weight: 40.0, maxValue: 40.0), spacingAfter: AuthorizationLayoutItemSpacing(weight: 0.0, maxValue: 0.0)), + AuthorizationLayoutItem(node: self.noticeNode, size: noticeSize, spacingBefore: AuthorizationLayoutItemSpacing(weight: 44.0, maxValue: 44.0), spacingAfter: AuthorizationLayoutItemSpacing(weight: 20.0, maxValue: 40.0)) + ] + + let _ = layoutAuthorizationItems(bounds: CGRect(origin: CGPoint(x: 0.0, y: insets.top), size: CGSize(width: layout.size.width, height: layout.size.height - insets.top - insets.bottom - 10.0)), items: items, transition: transition, failIfDoesNotFit: false) + + transition.updateFrame(node: self.buttonBackgroundNode, frame: self.buttonNode.frame) + transition.updateFrame(node: self.buttonHighlightedBackgroundNode, frame: self.buttonNode.frame) let buttonTextSize = self.buttonTextNode.measure(layout.size) - let buttonTextFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - buttonTextSize.width) / 2.0), y: floor(buttonFrame.center.y - buttonTextSize.height / 2.0)), size: buttonTextSize) + let buttonTextFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - buttonTextSize.width) / 2.0), y: floor(self.buttonNode.frame.center.y - buttonTextSize.height / 2.0)), size: buttonTextSize) transition.updateFrame(node: self.buttonTextNode, frame: buttonTextFrame) } + func animateIn() { + self.iconNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3) + self.titleNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3) + self.textNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3) + self.buttonBackgroundNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3) + self.buttonTextNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3) + self.noticeNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3) + } + @objc func buttonPressed() { self.proceedAction() } diff --git a/TelegramUI/Resources/Animations/anim_archive.json b/TelegramUI/Resources/Animations/anim_archive.json index b99caaf1f2..60e7f65d6c 100644 --- a/TelegramUI/Resources/Animations/anim_archive.json +++ b/TelegramUI/Resources/Animations/anim_archive.json @@ -1 +1 @@ -{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Archive","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":7,"s":[0,4,0],"to":[0,1.333,0],"ti":[0,-0.524,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,12,0],"to":[0,0.524,0],"ti":[0,0.81,0]},{"t":20,"s":[0,7.143,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.6],[0,0],[0,0],[0.41,0.45],[-0.46,0.4],[0,0],[-0.42,-0.37],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.6],[-0.61,0],[0,0],[0,0],[-0.45,0.41],[-0.4,-0.45],[0,0],[0.42,-0.37],[0,0],[0.45,0.4],[-0.4,0.45],[0,0]],"v":[[1.103,-1.818],[1.103,4.282],[0.003,5.382],[-1.097,4.282],[-1.097,-1.818],[-2.937,-0.178],[-4.487,-0.258],[-4.397,-1.808],[-0.737,-5.098],[0.733,-5.098],[4.403,-1.808],[4.483,-0.258],[2.933,-0.178]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.29019600153,0.752941012383,0.345097988844,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,82.5,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.167,0.167,0.167],"y":[0.167,0.167,24.444]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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.86,0],[0,0],[-0.55,-0.65],[0,0],[0,-0.7],[0,0],[1.82,0],[0,0],[0,1.82],[0,0],[-0.45,0.53]],"o":[[0.55,-0.65],[0,0],[0.86,0],[0,0],[0.45,0.53],[0,0],[0,1.82],[0,0],[-1.82,0],[0,0],[0,-0.7],[0,0]],"v":[[-8.35,-11.57],[-6.12,-12.6],[6.12,-12.6],[8.35,-11.57],[11.4,-7.98],[12.1,-6.08],[12.1,9.3],[8.8,12.6],[-8.8,12.6],[-12.1,9.3],[-12.1,-6.08],[-11.4,-7.98]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,-0.09],[-0.21,0],[0,0],[-0.06,0.05],[0.13,0.15],[0,0],[0.21,0],[0,0],[0.14,-0.16],[0,0]],"o":[[0,0.2],[0,0],[0.09,0],[0.15,-0.14],[0,0],[-0.14,-0.16],[0,0],[-0.22,0],[0,0],[-0.06,0.07]],"v":[[-8.879,-7.49],[-8.509,-7.12],[8.511,-7.12],[8.751,-7.21],[8.791,-7.73],[6.681,-10.15],[6.131,-10.4],[-6.129,-10.4],[-6.689,-10.15],[-8.789,-7.73]],"c":true},"ix":2},"nm":"Контур 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Объединить контуры 1","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":"Заливка 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":[300,300],"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":"Shape","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file +{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Archive","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":0,"s":[0,4,0],"to":[0,1,0],"ti":[0,-0.524,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,10,0],"to":[0,0.524,0],"ti":[0,0.476,0]},{"t":20,"s":[0,7.143,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.6],[0,0],[0,0],[0.41,0.45],[-0.46,0.4],[0,0],[-0.42,-0.37],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.6],[-0.61,0],[0,0],[0,0],[-0.45,0.41],[-0.4,-0.45],[0,0],[0.42,-0.37],[0,0],[0.45,0.4],[-0.4,0.45],[0,0]],"v":[[1.103,-1.818],[1.103,4.282],[0.003,5.382],[-1.097,4.282],[-1.097,-1.818],[-2.937,-0.178],[-4.487,-0.258],[-4.397,-1.808],[-0.737,-5.098],[0.733,-5.098],[4.403,-1.808],[4.483,-0.258],[2.933,-0.178]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.29019600153,0.752941012383,0.345097988844,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,82.5,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.167,0.167,0.167],"y":[0.167,0.167,24.444]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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.86,0],[0,0],[-0.55,-0.65],[0,0],[0,-0.7],[0,0],[1.82,0],[0,0],[0,1.82],[0,0],[-0.45,0.53]],"o":[[0.55,-0.65],[0,0],[0.86,0],[0,0],[0.45,0.53],[0,0],[0,1.82],[0,0],[-1.82,0],[0,0],[0,-0.7],[0,0]],"v":[[-8.35,-11.57],[-6.12,-12.6],[6.12,-12.6],[8.35,-11.57],[11.4,-7.98],[12.1,-6.08],[12.1,9.3],[8.8,12.6],[-8.8,12.6],[-12.1,9.3],[-12.1,-6.08],[-11.4,-7.98]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,-0.09],[-0.21,0],[0,0],[-0.06,0.05],[0.13,0.15],[0,0],[0.21,0],[0,0],[0.14,-0.16],[0,0]],"o":[[0,0.2],[0,0],[0.09,0],[0.15,-0.14],[0,0],[-0.14,-0.16],[0,0],[-0.22,0],[0,0],[-0.06,0.07]],"v":[[-8.879,-7.49],[-8.509,-7.12],[8.511,-7.12],[8.751,-7.21],[8.791,-7.73],[6.681,-10.15],[6.131,-10.4],[-6.129,-10.4],[-6.689,-10.15],[-8.789,-7.73]],"c":true},"ix":2},"nm":"Контур 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Объединить контуры 1","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":"Заливка 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":[300,300],"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":"Shape","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/TelegramUI/Resources/Animations/anim_hide.json b/TelegramUI/Resources/Animations/anim_hide.json index 74962b5c22..ca212d44ee 100644 --- a/TelegramUI/Resources/Animations/anim_hide.json +++ b/TelegramUI/Resources/Animations/anim_hide.json @@ -1 +1 @@ -{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Hide","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path 4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,79.5,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.167,0.167,0.167],"y":[0.167,0.167,0]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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":[[-11,0],[11,0]],"c":false},"ix":2},"nm":"Контур 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":2.2,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Обводка 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":[300,300],"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 4","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Path","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,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],[0,0],[0,0],[0.57,0],[0.06,-0.56],[0,0],[0,0],[0,0],[-0.56,0],[-0.07,0.56]],"o":[[0,0],[0,0],[0,0],[-0.06,-0.56],[-0.57,0],[0,0],[0,0],[0,0],[0.07,0.56],[0.56,0],[0,0]],"v":[[1.09,-3.5],[12,-3.5],[12,3.5],[1.1,3.5],[0,2.5],[-1.1,3.5],[-12,3.5],[-12,-3.5],[-1.09,-3.5],[0,-2.5],[1.09,-3.5]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.741176470588,0.741176470588,0.760784313725,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Path","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.667,"y":1},"o":{"x":0.167,"y":0.167},"t":5,"s":[0,6,0],"to":[0,-3.5,0],"ti":[0,0.5,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,-15,0],"to":[0,-0.5,0],"ti":[0,-3,0]},{"t":20,"s":[0,3,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.61],[0,0],[0,0],[0.41,0.45],[-0.45,0.41],[0,0],[-0.42,-0.39],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.61],[-0.61,0],[0,0],[0,0],[-0.44,0.41],[-0.41,-0.45],[0,0],[0.42,-0.39],[0,0],[0.44,0.41],[-0.41,0.45],[0,0]],"v":[[1.103,-8],[1.103,10.5],[0.003,11.6],[-1.097,10.5],[-1.097,-8],[-3.927,-5.4],[-5.477,-5.47],[-5.407,-7.02],[-0.747,-11.31],[0.743,-11.31],[5.413,-7.02],[5.473,-5.47],[3.923,-5.4]],"c":true},"ix":2},"nm":"Контур 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":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file +{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Hide","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path 4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,79.5,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.167,0.167,0.167],"y":[0.167,0.167,0]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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":[[-11,0],[11,0]],"c":false},"ix":2},"nm":"Контур 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":2.2,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Обводка 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":[300,300],"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 4","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Path","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,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],[0,0],[0,0],[0.57,0],[0.06,-0.56],[0,0],[0,0],[0,0],[-0.56,0],[-0.07,0.56]],"o":[[0,0],[0,0],[0,0],[-0.06,-0.56],[-0.57,0],[0,0],[0,0],[0,0],[0.07,0.56],[0.56,0],[0,0]],"v":[[1.09,-3.5],[12,-3.5],[12,3.5],[1.1,3.5],[0,2.5],[-1.1,3.5],[-12,3.5],[-12,-3.5],[-1.09,-3.5],[0,-2.5],[1.09,-3.5]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.741176470588,0.741176470588,0.760784313725,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Path","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.667,"y":1},"o":{"x":0.167,"y":0.167},"t":0,"s":[0,-4,0],"to":[0,-0.167,0],"ti":[0,-1.167,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,-5,0],"to":[0,1.167,0],"ti":[0,-1.333,0]},{"t":20,"s":[0,3,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.61],[0,0],[0,0],[0.41,0.45],[-0.45,0.41],[0,0],[-0.42,-0.39],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.61],[-0.61,0],[0,0],[0,0],[-0.44,0.41],[-0.41,-0.45],[0,0],[0.42,-0.39],[0,0],[0.44,0.41],[-0.41,0.45],[0,0]],"v":[[1.103,-8],[1.103,10.5],[0.003,11.6],[-1.097,10.5],[-1.097,-8],[-3.927,-5.4],[-5.477,-5.47],[-5.407,-7.02],[-0.747,-11.31],[0.743,-11.31],[5.413,-7.02],[5.473,-5.47],[3.923,-5.4]],"c":true},"ix":2},"nm":"Контур 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":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/TelegramUI/Resources/Animations/anim_unarchive.json b/TelegramUI/Resources/Animations/anim_unarchive.json index 3b4061fb2a..b8566e356f 100644 --- a/TelegramUI/Resources/Animations/anim_unarchive.json +++ b/TelegramUI/Resources/Animations/anim_unarchive.json @@ -1 +1 @@ -{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Unrchive","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":5,"s":[0,10,0],"to":[0,-1.333,0],"ti":[0,0.476,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,2,0],"to":[0,-0.476,0],"ti":[0,-0.857,0]},{"t":20,"s":[0,7.143,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.6],[0,0],[0,0],[0.41,0.45],[-0.46,0.4],[0,0],[-0.42,-0.37],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.6],[-0.61,0],[0,0],[0,0],[-0.45,0.41],[-0.4,-0.45],[0,0],[0.42,-0.37],[0,0],[0.45,0.4],[-0.4,0.45],[0,0]],"v":[[1.103,-1.818],[1.103,4.282],[0.003,5.382],[-1.097,4.282],[-1.097,-1.818],[-2.937,-0.178],[-4.487,-0.258],[-4.397,-1.808],[-0.737,-5.098],[0.733,-5.098],[4.403,-1.808],[4.483,-0.258],[2.933,-0.178]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.29019600153,0.752941012383,0.345097988844,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,82.5,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.167,0.167,0.167],"y":[0.167,0.167,24.444]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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.86,0],[0,0],[-0.55,-0.65],[0,0],[0,-0.7],[0,0],[1.82,0],[0,0],[0,1.82],[0,0],[-0.45,0.53]],"o":[[0.55,-0.65],[0,0],[0.86,0],[0,0],[0.45,0.53],[0,0],[0,1.82],[0,0],[-1.82,0],[0,0],[0,-0.7],[0,0]],"v":[[-8.35,-11.57],[-6.12,-12.6],[6.12,-12.6],[8.35,-11.57],[11.4,-7.98],[12.1,-6.08],[12.1,9.3],[8.8,12.6],[-8.8,12.6],[-12.1,9.3],[-12.1,-6.08],[-11.4,-7.98]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,-0.09],[-0.21,0],[0,0],[-0.06,0.05],[0.13,0.15],[0,0],[0.21,0],[0,0],[0.14,-0.16],[0,0]],"o":[[0,0.2],[0,0],[0.09,0],[0.15,-0.14],[0,0],[-0.14,-0.16],[0,0],[-0.22,0],[0,0],[-0.06,0.07]],"v":[[-8.879,-7.49],[-8.509,-7.12],[8.511,-7.12],[8.751,-7.21],[8.791,-7.73],[6.681,-10.15],[6.131,-10.4],[-6.129,-10.4],[-6.689,-10.15],[-8.789,-7.73]],"c":true},"ix":2},"nm":"Контур 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Объединить контуры 1","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":"Заливка 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":[300,300],"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":"Shape","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file +{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Unrchive","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path","parent":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":0,"s":[0,10,0],"to":[0,-1,0],"ti":[0,0.476,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,4,0],"to":[0,-0.476,0],"ti":[0,-0.524,0]},{"t":20,"s":[0,7.143,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.6],[0,0],[0,0],[0.41,0.45],[-0.46,0.4],[0,0],[-0.42,-0.37],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.6],[-0.61,0],[0,0],[0,0],[-0.45,0.41],[-0.4,-0.45],[0,0],[0.42,-0.37],[0,0],[0.45,0.4],[-0.4,0.45],[0,0]],"v":[[1.103,-1.818],[1.103,4.282],[0.003,5.382],[-1.097,4.282],[-1.097,-1.818],[-2.937,-0.178],[-4.487,-0.258],[-4.397,-1.808],[-0.737,-5.098],[0.733,-5.098],[4.403,-1.808],[4.483,-0.258],[2.933,-0.178]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.29019600153,0.752941012383,0.345097988844,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,82.5,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.167,0.167,0.167],"y":[0.167,0.167,24.444]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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.86,0],[0,0],[-0.55,-0.65],[0,0],[0,-0.7],[0,0],[1.82,0],[0,0],[0,1.82],[0,0],[-0.45,0.53]],"o":[[0.55,-0.65],[0,0],[0.86,0],[0,0],[0.45,0.53],[0,0],[0,1.82],[0,0],[-1.82,0],[0,0],[0,-0.7],[0,0]],"v":[[-8.35,-11.57],[-6.12,-12.6],[6.12,-12.6],[8.35,-11.57],[11.4,-7.98],[12.1,-6.08],[12.1,9.3],[8.8,12.6],[-8.8,12.6],[-12.1,9.3],[-12.1,-6.08],[-11.4,-7.98]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,-0.09],[-0.21,0],[0,0],[-0.06,0.05],[0.13,0.15],[0,0],[0.21,0],[0,0],[0.14,-0.16],[0,0]],"o":[[0,0.2],[0,0],[0.09,0],[0.15,-0.14],[0,0],[-0.14,-0.16],[0,0],[-0.22,0],[0,0],[-0.06,0.07]],"v":[[-8.879,-7.49],[-8.509,-7.12],[8.511,-7.12],[8.751,-7.21],[8.791,-7.73],[6.681,-10.15],[6.131,-10.4],[-6.129,-10.4],[-6.689,-10.15],[-8.789,-7.73]],"c":true},"ix":2},"nm":"Контур 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Объединить контуры 1","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":"Заливка 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":[300,300],"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":"Shape","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/TelegramUI/Resources/Animations/anim_unhide.json b/TelegramUI/Resources/Animations/anim_unhide.json index 6cb8b76305..786cdf7b43 100644 --- a/TelegramUI/Resources/Animations/anim_unhide.json +++ b/TelegramUI/Resources/Animations/anim_unhide.json @@ -1 +1 @@ -{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Unhide","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path 4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,79.5,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.167,0.167,0.167],"y":[0.167,0.167,0]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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":[[-11,0],[11,0]],"c":false},"ix":2},"nm":"Контур 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":2.2,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Обводка 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":[300,300],"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 4","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Path","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,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],[0,0],[0,0],[0.57,0],[0.06,-0.56],[0,0],[0,0],[0,0],[-0.56,0],[-0.07,0.56]],"o":[[0,0],[0,0],[0,0],[-0.06,-0.56],[-0.57,0],[0,0],[0,0],[0,0],[0.07,0.56],[0.56,0],[0,0]],"v":[[1.09,-3.5],[12,-3.5],[12,3.5],[1.1,3.5],[0,2.5],[-1.1,3.5],[-12,3.5],[-12,-3.5],[-1.09,-3.5],[0,-2.5],[1.09,-3.5]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.741176470588,0.741176470588,0.760784313725,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Path","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.667,"y":1},"o":{"x":0.167,"y":0.167},"t":5,"s":[0,-6,0],"to":[0,-1.561,0],"ti":[0,3.931,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,15,0],"to":[0,-2.786,0],"ti":[0,3,0]},{"t":20,"s":[0,-3,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.61],[0,0],[0,0],[0.41,0.45],[-0.45,0.41],[0,0],[-0.42,-0.39],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.61],[-0.61,0],[0,0],[0,0],[-0.44,0.41],[-0.41,-0.45],[0,0],[0.42,-0.39],[0,0],[0.44,0.41],[-0.41,0.45],[0,0]],"v":[[1.103,-8],[1.103,10.5],[0.003,11.6],[-1.097,10.5],[-1.097,-8],[-3.927,-5.4],[-5.477,-5.47],[-5.407,-7.02],[-0.747,-11.31],[0.743,-11.31],[5.413,-7.02],[5.473,-5.47],[3.923,-5.4]],"c":true},"ix":2},"nm":"Контур 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":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file +{"v":"5.5.1","fr":60,"ip":0,"op":30,"w":228,"h":228,"nm":"Unhide","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path 4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[114,79.5,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.167,0.167,0.167],"y":[0.167,0.167,0]},"t":0,"s":[0,0,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":15,"s":[110,110,100]},{"t":20,"s":[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":[[-11,0],[11,0]],"c":false},"ix":2},"nm":"Контур 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":2.2,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Обводка 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":[300,300],"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 4","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Path","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,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],[0,0],[0,0],[0.57,0],[0.06,-0.56],[0,0],[0,0],[0,0],[-0.56,0],[-0.07,0.56]],"o":[[0,0],[0,0],[0,0],[-0.06,-0.56],[-0.57,0],[0,0],[0,0],[0,0],[0.07,0.56],[0.56,0],[0,0]],"v":[[1.09,-3.5],[12,-3.5],[12,3.5],[1.1,3.5],[0,2.5],[-1.1,3.5],[-12,3.5],[-12,-3.5],[-1.09,-3.5],[0,-2.5],[1.09,-3.5]],"c":true},"ix":2},"nm":"Контур 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.741176470588,0.741176470588,0.760784313725,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Path","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.667,"y":1},"o":{"x":0.167,"y":0.167},"t":0,"s":[0,4,0],"to":[0,-1.561,0],"ti":[0,3.931,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":15,"s":[0,5,0],"to":[0,-2.786,0],"ti":[0,1.333,0]},{"t":20,"s":[0,-3,0]}],"ix":2},"a":{"a":0,"k":[0,0,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],[0.6,0],[0,0.61],[0,0],[0,0],[0.41,0.45],[-0.45,0.41],[0,0],[-0.42,-0.39],[0,0],[0.41,-0.45],[0.45,0.41]],"o":[[0,0],[0,0.61],[-0.61,0],[0,0],[0,0],[-0.44,0.41],[-0.41,-0.45],[0,0],[0.42,-0.39],[0,0],[0.44,0.41],[-0.41,0.45],[0,0]],"v":[[1.103,-8],[1.103,10.5],[0.003,11.6],[-1.097,10.5],[-1.097,-8],[-3.927,-5.4],[-5.477,-5.47],[-5.407,-7.02],[-0.747,-11.31],[0.743,-11.31],[5.413,-7.02],[5.473,-5.47],[3.923,-5.4]],"c":true},"ix":2},"nm":"Контур 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":"Заливка 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":[300,300],"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}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/TelegramUI/SettingsSearchableItems.swift b/TelegramUI/SettingsSearchableItems.swift index 806f5cd235..c4d1f9eeb7 100644 --- a/TelegramUI/SettingsSearchableItems.swift +++ b/TelegramUI/SettingsSearchableItems.swift @@ -522,7 +522,7 @@ private func privacySearchableItems(context: AccountContext, privacySettings: Ac }) }), SettingsSearchableItem(id: .privacy(8), title: strings.PrivacySettings_TwoStepAuth, alternate: synonyms(strings.SettingsSearch_Synonyms_Privacy_TwoStepAuth), icon: icon, breadcrumbs: [strings.Settings_PrivacySettings], present: { context, _, present in - present(.push, twoStepVerificationUnlockSettingsController(context: context, mode: .access)) + present(.push, twoStepVerificationUnlockSettingsController(context: context, mode: .access(intro: true, data: nil))) }), SettingsSearchableItem(id: .privacy(9), title: strings.PrivacySettings_AuthSessions, alternate: synonyms(strings.SettingsSearch_Synonyms_Privacy_AuthSessions), icon: icon, breadcrumbs: [strings.Settings_PrivacySettings], present: { context, _, present in present(.push, recentSessionsController(context: context)) diff --git a/TelegramUI/SetupTwoStepVerificationContentNode.swift b/TelegramUI/SetupTwoStepVerificationContentNode.swift index ba0d8eb224..6a9643762b 100644 --- a/TelegramUI/SetupTwoStepVerificationContentNode.swift +++ b/TelegramUI/SetupTwoStepVerificationContentNode.swift @@ -15,6 +15,7 @@ struct SetupTwoStepVerificationContentAction { } final class SetupTwoStepVerificationContentNode: ASDisplayNode, UITextFieldDelegate { + private var theme: PresentationTheme let kind: SetupTwoStepVerificationStateKind private let leftAction: SetupTwoStepVerificationContentAction? private let rightAction: SetupTwoStepVerificationContentAction? @@ -32,27 +33,31 @@ final class SetupTwoStepVerificationContentNode: ASDisplayNode, UITextFieldDeleg private var clearOnce: Bool = false init(theme: PresentationTheme, kind: SetupTwoStepVerificationStateKind, title: String, subtitle: String, inputType: SetupTwoStepVerificationInputType, placeholder: String, text: String, isPassword: Bool, textUpdated: @escaping (String) -> Void, returnPressed: @escaping () -> Void, leftAction: SetupTwoStepVerificationContentAction?, rightAction: SetupTwoStepVerificationContentAction?) { + self.theme = theme + self.kind = kind self.leftAction = leftAction self.rightAction = rightAction self.textUpdated = textUpdated self.returnPressed = returnPressed - self.kind = kind self.titleNode = ImmediateTextNode() self.titleNode.maximumNumberOfLines = 0 self.titleNode.displaysAsynchronously = false self.titleNode.textAlignment = .center self.titleNode.attributedText = NSAttributedString(string: title, font: Font.light(30.0), textColor: theme.list.itemPrimaryTextColor, paragraphAlignment: .center) + self.subtitleNode = ImmediateTextNode() self.subtitleNode.maximumNumberOfLines = 0 self.subtitleNode.displaysAsynchronously = false self.subtitleNode.textAlignment = .center self.subtitleNode.attributedText = NSAttributedString(string: subtitle, font: Font.regular(16.0), textColor: theme.list.itemPrimaryTextColor, paragraphAlignment: .center) + self.inputNode = TextFieldNode() self.inputNode.textField.textColor = theme.list.itemPrimaryTextColor self.inputNode.textField.font = Font.regular(22.0) self.inputNode.textField.attributedPlaceholder = NSAttributedString(string: placeholder, font: Font.regular(22.0), textColor: theme.list.itemPlaceholderTextColor) self.inputNode.textField.textAlignment = .center + self.inputNode.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance switch inputType { case .password: self.inputNode.textField.isSecureTextEntry = true @@ -112,6 +117,12 @@ final class SetupTwoStepVerificationContentNode: ASDisplayNode, UITextFieldDeleg } } + func updatePresentationData(_ presentationData: PresentationData) { + self.theme = presentationData.theme + self.inputNode.textField.keyboardAppearance = self.theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.inputSeparator.backgroundColor = self.theme.list.itemPlainSeparatorColor + } + func updateIsEnabled(_ isEnabled: Bool) { self.isEnabled = isEnabled self.leftActionButton.isEnabled = isEnabled diff --git a/TelegramUI/SetupTwoStepVerificationController.swift b/TelegramUI/SetupTwoStepVerificationController.swift index bd60d72b45..4ed8757be4 100644 --- a/TelegramUI/SetupTwoStepVerificationController.swift +++ b/TelegramUI/SetupTwoStepVerificationController.swift @@ -77,7 +77,7 @@ class SetupTwoStepVerificationController: ViewController { if let presentationArguments = self.presentationArguments as? ViewControllerPresentationArguments, !self.didPlayPresentationAnimation { self.didPlayPresentationAnimation = true if case .modalSheet = presentationArguments.presentationAnimation { - self.controllerNode.animateIn() + self.controllerNode.animateIn(completion: presentationArguments.completion) } } } diff --git a/TelegramUI/SetupTwoStepVerificationControllerNode.swift b/TelegramUI/SetupTwoStepVerificationControllerNode.swift index b3124ee513..ff5d9e767c 100644 --- a/TelegramUI/SetupTwoStepVerificationControllerNode.swift +++ b/TelegramUI/SetupTwoStepVerificationControllerNode.swift @@ -193,10 +193,13 @@ final class SetupTwoStepVerificationControllerNode: ViewControllerTracingNode { func updatePresentationData(_ presentationData: PresentationData) { self.presentationData = presentationData self.backgroundColor = self.presentationData.theme.list.plainBackgroundColor + self.contentNode?.updatePresentationData(presentationData) } - func animateIn() { - self.layer.animatePosition(from: CGPoint(x: self.layer.position.x, y: self.layer.position.y + self.layer.bounds.size.height), to: self.layer.position, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring) + func animateIn(completion: (() -> Void)? = nil) { + self.layer.animatePosition(from: CGPoint(x: self.layer.position.x, y: self.layer.position.y + self.layer.bounds.size.height), to: self.layer.position, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring, completion: { _ in + completion?() + }) } func animateOut(completion: (() -> Void)? = nil) { diff --git a/TelegramUI/TwoStepVerificationUnlockController.swift b/TelegramUI/TwoStepVerificationUnlockController.swift index 1f60eb7515..6d5cc93589 100644 --- a/TelegramUI/TwoStepVerificationUnlockController.swift +++ b/TelegramUI/TwoStepVerificationUnlockController.swift @@ -216,31 +216,31 @@ private func twoStepVerificationUnlockSettingsControllerEntries(presentationData } enum TwoStepVerificationUnlockSettingsControllerMode { - case access + case access(intro: Bool, data: Signal?) case manage(password: String, email: String, pendingEmail: TwoStepVerificationPendingEmail?, hasSecureValues: Bool) } -private struct PendingEmailState { +struct TwoStepVerificationPendingEmailState { let password: String? let email: TwoStepVerificationPendingEmail } -private enum TwoStepVeriticationAccessConfiguration { - case notSet(pendingEmail: PendingEmailState?) +enum TwoStepVerificationAccessConfiguration { + case notSet(pendingEmail: TwoStepVerificationPendingEmailState?) case set(hint: String, hasRecoveryEmail: Bool, hasSecureValues: Bool) init(configuration: TwoStepVerificationConfiguration, password: String?) { switch configuration { case let .notSet(pendingEmail): - self = .notSet(pendingEmail: pendingEmail.flatMap({ PendingEmailState(password: password, email: $0) })) + self = .notSet(pendingEmail: pendingEmail.flatMap({ TwoStepVerificationPendingEmailState(password: password, email: $0) })) case let .set(hint, hasRecoveryEmail, _, hasSecureValues): self = .set(hint: hint, hasRecoveryEmail: hasRecoveryEmail, hasSecureValues: hasSecureValues) } } } -private enum TwoStepVerificationUnlockSettingsControllerData { - case access(configuration: TwoStepVeriticationAccessConfiguration?) +enum TwoStepVerificationUnlockSettingsControllerData { + case access(configuration: TwoStepVerificationAccessConfiguration?) case manage(password: String, emailSet: Bool, pendingEmail: TwoStepVerificationPendingEmail?, hasSecureValues: Bool) } @@ -253,7 +253,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: statePromise.set(stateValue.modify { f($0) }) } - var replaceControllerImpl: ((ViewController) -> Void)? + var replaceControllerImpl: ((ViewController, Bool) -> Void)? var presentControllerImpl: ((ViewController, ViewControllerPresentationArguments?) -> Void)? let actionsDisposable = DisposableSet() @@ -268,11 +268,17 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: actionsDisposable.add(setupResultDisposable) let dataPromise = Promise() + let remoteDataPromise = Promise() switch mode { - case .access: - dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.access(configuration: nil)) - |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVeriticationAccessConfiguration(configuration: $0, password: nil)) })) + case let .access(_, data): + if let data = data { + dataPromise.set(data) + } else { + dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.access(configuration: nil)) + |> then(remoteDataPromise.get())) + remoteDataPromise.set(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVerificationAccessConfiguration(configuration: $0, password: nil)) }) + } case let .manage(password, email, pendingEmail, hasSecureValues): dataPromise.set(.single(.manage(password: password, emailSet: !email.isEmpty, pendingEmail: pendingEmail, hasSecureValues: hasSecureValues))) } @@ -281,7 +287,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: let _ = (dataPromise.get() |> take(1) |> deliverOnMainQueue).start(next: { data in - var pendingEmailData: PendingEmailState? + var pendingEmailData: TwoStepVerificationPendingEmailState? switch data { case let .access(configuration): guard let configuration = configuration else { @@ -295,7 +301,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: } case let .manage(password, _, pendingEmail, _): if let pendingEmail = pendingEmail { - pendingEmailData = PendingEmailState(password: password, email: pendingEmail) + pendingEmailData = TwoStepVerificationPendingEmailState(password: password, email: pendingEmail) } } if let pendingEmail = pendingEmailData { @@ -358,7 +364,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.manage(password: password, emailSet: true, pendingEmail: nil, hasSecureValues: false))) } else { dataPromise.set(.single(.access(configuration: nil)) - |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVeriticationAccessConfiguration(configuration: $0, password: pendingEmail.password)) })) + |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVerificationAccessConfiguration(configuration: $0, password: pendingEmail.password)) })) } case let .manage(manage): dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.manage(password: manage.password, emailSet: true, pendingEmail: nil, hasSecureValues: manage.hasSecureValues))) @@ -416,7 +422,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: return state } - replaceControllerImpl?(twoStepVerificationUnlockSettingsController(context: context, mode: .manage(password: password, email: settings.email, pendingEmail: pendingEmail, hasSecureValues: settings.secureSecret != nil))) + replaceControllerImpl?(twoStepVerificationUnlockSettingsController(context: context, mode: .manage(password: password, email: settings.email, pendingEmail: pendingEmail, hasSecureValues: settings.secureSecret != nil)), true) }, error: { error in updateState { state in var state = state @@ -509,7 +515,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: case .noPassword: dataPromise.set(.single(.access(configuration: .notSet(pendingEmail: nil)))) case let .awaitingEmailConfirmation(password, pattern, codeLength): - dataPromise.set(.single(.access(configuration: .notSet(pendingEmail: PendingEmailState(password: password, email: TwoStepVerificationPendingEmail(pattern: pattern, codeLength: codeLength)))))) + dataPromise.set(.single(.access(configuration: .notSet(pendingEmail: TwoStepVerificationPendingEmailState(password: password, email: TwoStepVerificationPendingEmail(pattern: pattern, codeLength: codeLength)))))) case let .passwordSet(password, hasRecoveryEmail, hasSecureValues): if let password = password { dataPromise.set(.single(.manage(password: password, emailSet: hasRecoveryEmail, pendingEmail: nil, hasSecureValues: hasSecureValues))) @@ -517,14 +523,19 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .genericSuccess(presentationData.strings.TwoStepAuth_EnabledSuccess, false)), nil) } else { dataPromise.set(.single(.access(configuration: nil)) - |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVeriticationAccessConfiguration(configuration: $0, password: password)) })) + |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVerificationAccessConfiguration(configuration: $0, password: password)) })) } } if shouldDismiss { controller.dismiss() } }) - presentControllerImpl?(controller, ViewControllerPresentationArguments(presentationAnimation: .modalSheet)) + presentControllerImpl?(controller, ViewControllerPresentationArguments(presentationAnimation: .modalSheet, completion: { + if case let .access(intro, _) = mode, intro { + let controller = twoStepVerificationUnlockSettingsController(context: context, mode: .access(intro: false, data: dataPromise.get())) + replaceControllerImpl?(controller, false) + } + })) case .set: break } @@ -544,7 +555,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .genericSuccess(presentationData.strings.TwoStepAuth_PasswordChangeSuccess, false)), nil) } else { dataPromise.set(.single(.access(configuration: nil)) - |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVeriticationAccessConfiguration(configuration: $0, password: password)) })) + |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVerificationAccessConfiguration(configuration: $0, password: password)) })) } } if shouldDismiss { @@ -636,7 +647,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, strings: presentationData.strings, type: .genericSuccess(emailSet ? presentationData.strings.TwoStepAuth_EmailChangeSuccess : presentationData.strings.TwoStepAuth_EmailAddSuccess, false)), nil) } else { dataPromise.set(.single(.access(configuration: nil)) - |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVeriticationAccessConfiguration(configuration: $0, password: password)) })) + |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVerificationAccessConfiguration(configuration: $0, password: password)) })) } } if shouldDismiss { @@ -723,7 +734,7 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: dataPromise.set(.single(data)) } else { dataPromise.set(.single(.access(configuration: nil)) - |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVeriticationAccessConfiguration(configuration: $0, password: password)) })) + |> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVerificationAccessConfiguration(configuration: $0, password: password)) })) } } if shouldDismiss { @@ -757,7 +768,6 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: checkEmailConfirmation() }) } - break case .set: rightNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Next), style: .bold, enabled: true, action: { arguments.checkPassword() @@ -786,12 +796,12 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: return (controllerState, (listState, arguments)) } |> afterDisposed { - actionsDisposable.dispose() + actionsDisposable.dispose() } let controller = ItemListController(context: context, state: signal) - replaceControllerImpl = { [weak controller] c in - (controller?.navigationController as? NavigationController)?.replaceTopController(c, animated: true) + replaceControllerImpl = { [weak controller] c, animated in + (controller?.navigationController as? NavigationController)?.replaceTopController(c, animated: animated) } presentControllerImpl = { [weak controller] c, p in if let controller = controller { @@ -822,5 +832,26 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: initialFocusImpl?() } + if case let .access(intro, _) = mode, intro { + actionsDisposable.add((remoteDataPromise.get() + |> take(1) + |> deliverOnMainQueue).start(next: { data in + if case let .access(configuration) = data, let config = configuration, case let .notSet(pendingEmail) = config, pendingEmail == nil { + let controller = PrivacyIntroController(context: context, mode: .twoStepVerification, arguments: PrivacyIntroControllerPresentationArguments(fadeIn: true), proceedAction: { + arguments.openSetupPassword() + }) + replaceControllerImpl?(controller, false) + replaceControllerImpl = { [weak controller] c, animated in + (controller?.navigationController as? NavigationController)?.replaceTopController(c, animated: animated) + } + presentControllerImpl = { [weak controller] c, p in + if let controller = controller { + controller.present(c, in: .window(.root), with: p) + } + } + } + })) + } + return controller } diff --git a/third-party/RMIntro/core/animations.c b/third-party/RMIntro/core/animations.c index f38708d9f9..135b896bda 100644 --- a/third-party/RMIntro/core/animations.c +++ b/third-party/RMIntro/core/animations.c @@ -22,6 +22,7 @@ static const vec4 black_color = {0,0,0, 1.0f}; static const vec4 white_color = {1,1,1, 1.0f}; + /* static const vec4 red_color = {1,0,0, 1.0f}; static const vec4 green_color = {0,1,0, 1.0f}; @@ -77,9 +78,6 @@ static mat4x4 ribbons_layer; static int test_texture[6]; -static void position_table_in_scene(); -static void position_object_in_scene(float x, float y, float z); - static TexturedShape ic_bubble_dot, ic_bubble, ic_cam_lens, ic_cam, ic_pencil, ic_pin, ic_smile_eye, ic_smile, ic_videocam; static int ic_bubble_dot_texture, ic_bubble_texture, ic_cam_lens_texture, ic_cam_texture, ic_pencil_texture, ic_pin_texture, ic_smile_eye_texture, ic_smile_texture, ic_videocam_texture; @@ -96,8 +94,6 @@ static int private_door_texture, private_screw_texture, private_keyhole_body_tex static TexturedShape private_door, private_screw, private_keyhole_body; static Shape private_stroke; -static Shape start_button; - static const float r1 = 58.5; static const float r2 = 70; @@ -121,9 +117,6 @@ static int direct; static int frame_width; -static int need_pages = 0; - - static int i; static int current_page, prev_page; @@ -139,21 +132,12 @@ static float time_local = 0; static int pagination_y, button_y; -static int ui_pagination_dot_texture; -static TexturedShape pagination_dot; - static float knot_delays[4]; static float offset_y; -void set_need_pages(int a) -{ - need_pages=a; -} - - void set_page(int page) { @@ -257,13 +241,6 @@ void set_private_textures(int a_private_door, int a_private_screw) private_screw_texture = a_private_screw; } - -void set_ui_textures(int a_pagination_dot) -{ - ui_pagination_dot_texture = a_pagination_dot; -} - - float t(float start_value, float end_value, float start_time, float duration, timing_type type) { if (time>start_time+duration) { @@ -439,14 +416,8 @@ set_y_offset_objects(-100*k*0); void on_surface_created() { - setup_shaders(); - vec4 start_button_col = {44/255.,165/255.,224/255., 1.}; - start_button = create_rounded_rectangle(CSizeMake(172, 44), 2, 3, start_button_col); - start_button.params.anchor.y = - 22; - - mask1 = create_rounded_rectangle(CSizeMake(60, 60), 0, 16, black_color); @@ -577,17 +548,6 @@ void on_surface_created() { vec4 cloud_color = {42/255., 180/255., 247/255., 1}; cloud_bg = create_rectangle(CSizeMake(160*2, 160*2), cloud_color); - - - - if (need_pages == 1) { - for (i=0; i<6; i++) { - test[i] = create_textured_rectangle(CSizeMake(320, 114), test_texture[i]); - test[i].params.anchor.y = -114/2; - } - pagination_dot = create_textured_rectangle(CSizeMake(8, 8), ui_pagination_dot_texture); - } - } @@ -616,7 +576,7 @@ static inline void mat4x4_plain(mat4x4 M, int width, int height) static inline void mat4x4_stars(mat4x4 m, float y_fov_in_degrees, float aspect, float n, float f, int width, int height) { - int is_iOS = need_pages ? 0 : 1; + int is_iOS = 1; if (height >= width) { float k = (float)width/(float)height; @@ -671,7 +631,6 @@ static inline void mat4x4_stars(mat4x4 m, float y_fov_in_degrees, float aspect, } mat4x4_translate_independed(m, 0, - 2*y_offset_absolute/(float)height + 4*scale_factor/(float)height, 0); - } @@ -701,29 +660,10 @@ void on_surface_changed(int a_width_px, int a_height_px, float a_scale_factor, i set_y_offset_objects(offset_y); y_offset_absolute = a1; -/* - char str[150]; - sprintf(str, "offset_y = %d", offset_y); - DEBUG_LOG_WRITE_D("fps",str); -*/ - -//mat4x4_perspective(stars_matrix, 45, (float) width / (float) height, 1, 1000); mat4x4_stars(stars_matrix, 45, 1, -1000, 0, (int)((float)a_width_px/a_scale_factor), (int)((float)a_height_px/a_scale_factor)); - //mat4x4_translate_independed(stars_matrix, 0, a1*main_matrix[1][1]/((float)a_height_px/a_scale_factor), 0); - - if (need_pages) { - //mat4x4_translate_independed(stars_matrix, 0, 7./stars_matrix[3][3], 0); - } - - } - - - - - void rglNormalDraw() { glDisable(GL_DEPTH_TEST); @@ -750,18 +690,14 @@ void rglNormalDrawThroughMask() glDepthMask(0); } - - void mat4x4_scaled(mat4x4 matrix, float s) { mat4x4_identity(matrix); mat4x4_scale_aniso(matrix, matrix, s, s, s); } - void mat4x4_layer(mat4x4 matrix, LayerParams params, float s, float r) { - float a=main_matrix[1][1]; tt++; @@ -788,10 +724,6 @@ void mat4x4_layer(mat4x4 matrix, LayerParams params, float s, float r) mat4x4_mul(model_matrix, scaled, tmp); - - - - mat4x4 rotate; mat4x4_dup(rotate, id); @@ -845,22 +777,12 @@ float speedometer_sin() return sin(sin(time*1000*.15*0.08+speedometer)*M_PI)*5; } - - - - - double ms0_anim, time_anim; int fps_anim; int count_anim_fps; - - static float speedometer_scroll_offset=0, free_scroll_offset=0, private_scroll_offset=0; - - - double anim_pencil_stage_duration, anim_pencil_start_time, anim_pencil_start_all_time, anim_pencil_start_all_end_time; int anim_pencil_stage; @@ -895,15 +817,12 @@ static int anim_pencil_period; float pin_sin(float a) { - //printf("bsin>%f\n", a); - //printf("pin_sin>%f\n", a); if (a > M_PI*2*anim_pin_start_period && a < M_PI*2*anim_pin_end_period) { return sin(a*.1); } if (a > M_PI*2*(anim_pin_end_period)) { - //printf("PIN\n"); - int p = 1;//irand(10, 20)/5; + int p = 1; anim_pin_start_period = anim_pin_end_period + p; anim_pin_end_period = anim_pin_end_period + p + 1; } @@ -945,9 +864,9 @@ static void reset_ic() anim_pencil_start_all_end_time = 0; anim_cam_next_time = time_local + 0; anim_smile_stage = 0; - anim_smile_blink_one = 0;//-21456; + anim_smile_blink_one = 0; anim_pencil_stage = 0; - anim_bubble_dots_end_period = 4;//duration_const*10; + anim_bubble_dots_end_period = 4; anim_pencil_period = 1; } @@ -1589,7 +1508,7 @@ void on_draw_frame() { float private_back_k = .8; - glClearColor(backgroundColor[0], backgroundColor[0], backgroundColor[0], 1); + glClearColor(backgroundColor[0], backgroundColor[1], backgroundColor[2], 1); glClear(GL_COLOR_BUFFER_BIT); /* @@ -2213,7 +2132,16 @@ void on_draw_frame() { float scale = t(1, 2, 0, duration_const, EaseIn); powerful_mask.params.scale = xyzMake(scale, scale, 1); - draw_textured_shape(&powerful_mask, main_matrix, backgroundColor[1] < 0.5 ? DARK : LIGHT); + texture_program_type shape_texture_type; + if (backgroundColor[1] < 0.01) { + shape_texture_type = DARK; + } else if (backgroundColor[1] > 0.99) { + shape_texture_type = LIGHT; + } else { + shape_texture_type = DARK_BLUE; + } + + draw_textured_shape(&powerful_mask, main_matrix, shape_texture_type); ribbonLayer.rotation = free_scroll_offset + t_reversed(360, 360+(45+30), 0, duration_const, EaseOut); ribbonLayer.position.y = t_reversed(0, -8, 0, duration_const*.8, EaseOut); @@ -2326,9 +2254,18 @@ void on_draw_frame() { rglNormalDraw(); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + texture_program_type shape_texture_type; + if (backgroundColor[1] < 0.01) { + shape_texture_type = DARK; + } else if (backgroundColor[1] > 0.99) { + shape_texture_type = LIGHT; + } else { + shape_texture_type = DARK_BLUE; + } + float scale = t(2, 1, 0, duration_const, EaseOut); powerful_mask.params.scale = xyzMake(scale, scale, 1); - draw_textured_shape(&powerful_mask, main_matrix, backgroundColor[1] < 0.5 ? DARK : LIGHT); + draw_textured_shape(&powerful_mask, main_matrix, shape_texture_type); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -2415,9 +2352,18 @@ void on_draw_frame() { rglNormalDraw(); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + texture_program_type shape_texture_type; + if (backgroundColor[1] < 0.01) { + shape_texture_type = DARK; + } else if (backgroundColor[1] > 0.99) { + shape_texture_type = LIGHT; + } else { + shape_texture_type = DARK_BLUE; + } + float scale = t(2, 1, 0, duration_const, EaseOut); powerful_mask.params.scale = xyzMake(scale, scale, 1); - draw_textured_shape(&powerful_mask, main_matrix, backgroundColor[1] < 0.5 ? DARK : LIGHT); + draw_textured_shape(&powerful_mask, main_matrix, shape_texture_type); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -2562,7 +2508,16 @@ void on_draw_frame() { if (time < duration_const*.4) { cloud_cover.params.position.y=t_reversed(118/2+50, 118/2, duration_const*.8*private_back_k, duration_const*private_back_k, EaseOut); - draw_colored_shape(&cloud_cover, main_matrix, backgroundColor[1] < 0.5 ? black_color : white_color); + if (backgroundColor[1] < 0.01) { + vec4 color = {0.0,0.0,0.0,1.0}; + draw_colored_shape(&cloud_cover, main_matrix, color); + } else if (backgroundColor[1] > 0.99) { + vec4 color = {1.0,1.0,1.0,1.0}; + draw_colored_shape(&cloud_cover, main_matrix, color); + } else { + vec4 color = {0.09,0.133,0.176, 1.0f}; + draw_colored_shape(&cloud_cover, main_matrix, color); + } } draw_safe(0, t(0,1,duration_const*private_back_k*.0, duration_const*private_back_k, Linear), t(0, 1, 0, duration_const, Linear)); @@ -2602,49 +2557,17 @@ void on_draw_frame() { cloud_cover.params.position.y = t(118/2+50, 118/2, 0, duration_const, EaseOut); - draw_colored_shape(&cloud_cover, main_matrix, backgroundColor[1] < 0.5 ? black_color : white_color); - } - - - - - - if (need_pages) - { - rglNormalDraw(); - - glDisable(GL_BLEND); - int q_pages_rendered=0; - int q = 6; - for (i=0; i frame_width-1)) { - draw_textured_shape(&test[i], main_matrix, NORMAL); - q_pages_rendered++; - } + if (backgroundColor[1] < 0.01) { + vec4 color = {0.0,0.0,0.0,1.0}; + draw_colored_shape(&cloud_cover, main_matrix, color); + } else if (backgroundColor[1] > 0.99) { + vec4 color = {1.0,1.0,1.0,1.0}; + draw_colored_shape(&cloud_cover, main_matrix, color); + } else { + vec4 color = {0.09,0.133,0.176, 1.0f}; + draw_colored_shape(&cloud_cover, main_matrix, color); } - - glEnable(GL_BLEND); - - int d = 16; - for (i=0; i #include "rngs.h" - float frand(float from, float to) { - // srand(time(NULL)); return (float)(((double)random()/RAND_MAX)*(to-from)+from); } int irand(int from, int to) { - // srand(time(NULL)); return (int)(((double)random()/RAND_MAX)*(to-from+1)+from); } int signrand() { - // srand(time(NULL)); return irand(0, 1)*2-1; } - - - - - diff --git a/third-party/RMIntro/core/timing.c b/third-party/RMIntro/core/timing.c index 90b5453fc8..21488660dd 100644 --- a/third-party/RMIntro/core/timing.c +++ b/third-party/RMIntro/core/timing.c @@ -1,12 +1,3 @@ -// -// timing.c -// IntroOpenGL -// -// Created by Ilya Rimchikov on 03/05/14. -// Copyright (c) 2014 IntroOpenGL. All rights reserved. -// - - #include "timing.h" static inline float evaluateAtParameterWithCoefficients(float t, float coefficients[]) @@ -136,4 +127,4 @@ float timing(float x, timing_type type) return y; -} \ No newline at end of file +} diff --git a/third-party/RMIntro/platform/ios/RMIntroViewController.m b/third-party/RMIntro/platform/ios/RMIntroViewController.m index ea21c1b559..4dae44f2e0 100644 --- a/third-party/RMIntro/platform/ios/RMIntroViewController.m +++ b/third-party/RMIntro/platform/ios/RMIntroViewController.m @@ -576,11 +576,7 @@ static void TGDispatchOnMainThread(dispatch_block_t block) { set_powerful_textures(setup_texture(@"powerful_mask.png", color), setup_texture(@"powerful_star.png", color), setup_texture(@"powerful_infinity.png", color), setup_texture(@"powerful_infinity_white.png", color)); - set_private_textures(setup_texture(@"private_door.png", color), setup_texture(@"private_screw.png", color)); - - - set_need_pages(0); - + set_private_textures(setup_texture(@"private_door.png", color), setup_texture(@"private_screw.png", color)); on_surface_created(); on_surface_changed(200, 200, 1, 0,0,0,0,0);