Passcode and large emoji fixes

This commit is contained in:
Ilya Laktyushin 2019-04-22 18:07:35 +04:00
parent 14d9827016
commit 3fa03d1550
41 changed files with 320 additions and 336 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -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 = "<group>"; };
09F2159B2263E63200AEDF6D /* PasscodeEntryControllerNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryControllerNode.swift; sourceTree = "<group>"; };
09F2159F22649BCB00AEDF6D /* PasscodeEntryInputFieldNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryInputFieldNode.swift; sourceTree = "<group>"; };
09F215A322649C2200AEDF6D /* PasscodeEntryTitleNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryTitleNode.swift; sourceTree = "<group>"; };
09F215A322649C2200AEDF6D /* PasscodeEntryLabelNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryLabelNode.swift; sourceTree = "<group>"; };
09F215A522649C3000AEDF6D /* PasscodeLockIconNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeLockIconNode.swift; sourceTree = "<group>"; };
09F215A722649C7900AEDF6D /* PasscodeEntryKeyboardNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeEntryKeyboardNode.swift; sourceTree = "<group>"; };
09F215AA2264ABA600AEDF6D /* PasscodeBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeBackground.swift; sourceTree = "<group>"; };
@ -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 */,

View File

@ -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

View File

@ -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(

View File

@ -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(

View File

@ -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(

View File

@ -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
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
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

View File

@ -690,7 +690,9 @@ 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))
@ -702,8 +704,9 @@ private func fetchLargeEmojiRepresentation(account: Account, resource: MediaReso
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

View File

@ -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))
}
}
}

View File

@ -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)
}

View File

@ -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) {

View File

@ -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()
}

View File

@ -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))
})
})

View File

@ -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
}
}

View File

@ -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: {

View File

@ -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,7 +97,7 @@ 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
@ -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)

View File

@ -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()
}

View File

@ -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":[]}
{"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":[]}

View File

@ -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":[]}
{"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":[]}

View File

@ -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":[]}
{"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":[]}

View File

@ -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":[]}
{"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":[]}

View File

@ -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))

View File

@ -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

View File

@ -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)
}
}
}

View File

@ -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) {

View File

@ -216,31 +216,31 @@ private func twoStepVerificationUnlockSettingsControllerEntries(presentationData
}
enum TwoStepVerificationUnlockSettingsControllerMode {
case access
case access(intro: Bool, data: Signal<TwoStepVerificationUnlockSettingsControllerData, NoError>?)
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<TwoStepVerificationUnlockSettingsControllerData>()
let remoteDataPromise = Promise<TwoStepVerificationUnlockSettingsControllerData>()
switch mode {
case .access:
case let .access(_, data):
if let data = data {
dataPromise.set(data)
} else {
dataPromise.set(.single(TwoStepVerificationUnlockSettingsControllerData.access(configuration: nil))
|> then(twoStepVerificationConfiguration(account: context.account) |> map { TwoStepVerificationUnlockSettingsControllerData.access(configuration: TwoStepVeriticationAccessConfiguration(configuration: $0, password: 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()
@ -790,8 +800,8 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode:
}
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
}

View File

@ -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<q; i++) {
test[i].params.position.x=touch_x-frame_width/2+frame_width*i;
if (!(test[i].params.position.x < -frame_width+1 || test[i].params.position.x > 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<q; i++) {
pagination_dot.params.alpha = .35;
if (current_page == i) {
pagination_dot.params.alpha = .75;
}
pagination_dot.params.position.x = -q*d/2 + d/2 + i*d;
pagination_dot.params.position.y = pagination_y + d/2;
draw_textured_shape(&pagination_dot, main_matrix, NORMAL);
}
}
//duration_const=1;
prev_page = current_page;
}

View File

@ -31,9 +31,6 @@ void set_free_textures(int a_knot_up, int a_knot_down);
void set_powerful_textures(int a_powerful_mask, int a_powerful_star, int a_powerful_infinity, int a_powerful_infinity_white);
void set_private_textures(int a_private_door, int a_private_screw);
void set_ui_textures(int a_pagination_dot);
void set_need_pages(int a);
void set_y_offset(float a);

View File

@ -32,6 +32,7 @@ static TextureProgram texture_program_blue;
static TextureProgram texture_program_light_red;
static TextureProgram texture_program_light_blue;
static TextureProgram texture_program_black;
static TextureProgram texture_program_dark_blue;
static TextureProgram *texture_program_temp;
@ -40,20 +41,13 @@ static GradientProgram gradient_program;
static float y_offset;
void set_y_offset_objects(float a)
{
y_offset = a;
}
void setup_shaders()
{
char *vshader =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
@ -67,7 +61,6 @@ void setup_shaders()
"uniform float u_Alpha;"
"void main() {"
" gl_FragColor = u_Color;"
//" gl_FragColor = vec4(0,1,0,1);"
" gl_FragColor.w*=u_Alpha;"
"}";
@ -91,13 +84,11 @@ void setup_shaders()
"void main() {"
" gl_FragColor = v_DestinationColor;"
" gl_FragColor.w*=u_Alpha;"
//" gl_FragColor = vec4(0,1,0,1);"
"}";
gradient_program = get_gradient_program(build_program(vertex_gradient_shader, (GLint)strlen(vertex_gradient_shader), fragment_gradient_shader, (GLint)strlen(fragment_gradient_shader)));
char* vshader_texture =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
@ -121,10 +112,6 @@ void setup_shaders()
texture_program = get_texture_program(build_program(vshader_texture, (GLint)strlen(vshader_texture), fshader_texture, (GLint)strlen(fshader_texture)));
char* vshader_texture_blue =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
@ -142,8 +129,6 @@ void setup_shaders()
"uniform float u_Alpha;"
"void main(){"
" gl_FragColor = texture2D(u_TextureUnit, v_TextureCoordinates);"
//" float p = u_Alpha*gl_FragColor.w*0.4;"
//" gl_FragColor = vec4(0,0.353,0.761,p);"
" float p = u_Alpha*gl_FragColor.w;"
" gl_FragColor = vec4(0,0.6,0.898,p);"
"}";
@ -151,9 +136,6 @@ void setup_shaders()
texture_program_blue = get_texture_program(build_program(vshader_texture_blue, (GLint)strlen(vshader_texture_blue), fshader_texture_blue, (GLint)strlen(fshader_texture_blue)));
char* vshader_texture_red =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
@ -171,8 +153,6 @@ void setup_shaders()
"uniform float u_Alpha;"
"void main(){"
" gl_FragColor = texture2D(u_TextureUnit, v_TextureCoordinates);"
//" float p = gl_FragColor.w*0.45*u_Alpha;"
//" gl_FragColor = vec4(0.722,0.035,0,p);"
" float p = gl_FragColor.w*u_Alpha;"
" gl_FragColor = vec4(210./255.,57./255.,41./255.,p);"
"}";
@ -180,8 +160,6 @@ void setup_shaders()
texture_program_red = get_texture_program(build_program(vshader_texture_red, (GLint)strlen(vshader_texture_red), fshader_texture_red, (GLint)strlen(fshader_texture_red)));
vshader =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
@ -208,7 +186,6 @@ void setup_shaders()
texture_program_light_red = get_texture_program(build_program(vshader, (GLint)strlen(vshader), fshader, (GLint)strlen(fshader)));
vshader =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
@ -234,12 +211,6 @@ void setup_shaders()
texture_program_light_blue = get_texture_program(build_program(vshader, (GLint)strlen(vshader), fshader, (GLint)strlen(fshader)));
vshader =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
@ -262,16 +233,8 @@ void setup_shaders()
texture_program_one = get_texture_program(build_program(vshader, (GLint)strlen(vshader), fshader, (GLint)strlen(fshader)));
texture_program_one = get_texture_program(build_program(vshader, (GLint)strlen(vshader), fshader, (GLint)strlen(fshader)));
char* vshader_texture_black =
vshader =
"uniform mat4 u_MvpMatrix;"
"attribute vec4 a_Position;"
"attribute vec2 a_TextureCoordinates;"
@ -281,20 +244,31 @@ void setup_shaders()
" gl_Position = u_MvpMatrix * a_Position;"
"}";
char* fshader_texture_black =
fshader =
"precision lowp float;"
"uniform sampler2D u_TextureUnit;"
"varying vec2 v_TextureCoordinates;"
"uniform float u_Alpha;"
"void main(){"
" gl_FragColor = texture2D(u_TextureUnit, v_TextureCoordinates);"
//" float p = u_Alpha*gl_FragColor.w*0.4;"
//" gl_FragColor = vec4(0,0.353,0.761,p);"
" float p = u_Alpha*gl_FragColor.w;"
" gl_FragColor = vec4(0,0,0,p);"
"}";
texture_program_black = get_texture_program(build_program(vshader_texture_black, (GLint)strlen(vshader_texture_black), fshader_texture_black, (GLint)strlen(fshader_texture_black)));
texture_program_black = get_texture_program(build_program(vshader, (GLint)strlen(vshader), fshader, (GLint)strlen(fshader)));
fshader =
"precision lowp float;"
"uniform sampler2D u_TextureUnit;"
"varying vec2 v_TextureCoordinates;"
"uniform float u_Alpha;"
"void main(){"
" gl_FragColor = texture2D(u_TextureUnit, v_TextureCoordinates);"
" float p = u_Alpha*gl_FragColor.w;"
" gl_FragColor = vec4(0.09,0.133,0.176,p);"
"}";
texture_program_dark_blue = get_texture_program(build_program(vshader, (GLint)strlen(vshader), fshader, (GLint)strlen(fshader)));
}
@ -579,6 +553,10 @@ void draw_textured_shape(const TexturedShape* shape, mat4x4 view_projection_matr
{
texture_program_temp=&texture_program_black;
}
else if (program_type==DARK_BLUE)
{
texture_program_temp=&texture_program_dark_blue;
}
else if (program_type==LIGHT)
{
texture_program_temp=&texture_program_one;

View File

@ -15,7 +15,7 @@ extern float scale_factor;
extern int width, height;
extern int y_offset_absolute;
typedef enum {NORMAL, NORMAL_ONE, RED, BLUE, LIGHT_RED, LIGHT_BLUE, DARK, LIGHT} texture_program_type;
typedef enum {NORMAL, NORMAL_ONE, RED, BLUE, LIGHT_RED, LIGHT_BLUE, DARK, LIGHT, DARK_BLUE} texture_program_type;
typedef struct {
float x;

View File

@ -33,9 +33,3 @@ GradientProgram get_gradient_program(GLuint program)
glGetAttribLocation(program, "a_Color"),
glGetUniformLocation(program, "u_Alpha")};
}

View File

@ -3,26 +3,17 @@
#include <stdlib.h>
#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;
}

View File

@ -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[])

View File

@ -578,10 +578,6 @@ static void TGDispatchOnMainThread(dispatch_block_t block) {
set_private_textures(setup_texture(@"private_door.png", color), setup_texture(@"private_screw.png", color));
set_need_pages(0);
on_surface_created();
on_surface_changed(200, 200, 1, 0,0,0,0,0);
}