no message

This commit is contained in:
Peter
2018-01-09 13:18:08 +04:00
parent 0f26dc36a7
commit 6a47e739a3
644 changed files with 34297 additions and 13580 deletions

View File

@@ -7,15 +7,18 @@ final class AuthorizationSequencePhoneEntryController: ViewController {
return self.displayNode as! AuthorizationSequencePhoneEntryControllerNode
}
private let strings: PresentationStrings
private let theme: AuthorizationTheme
private var currentData: (Int32, String)?
var inProgress: Bool = false {
didSet {
if self.inProgress {
let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode())
let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.theme.accentColor))
self.navigationItem.rightBarButtonItem = item
} else {
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .done, target: self, action: #selector(self.nextPressed))
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed))
}
self.controllerNode.inProgress = self.inProgress
}
@@ -24,10 +27,17 @@ final class AuthorizationSequencePhoneEntryController: ViewController {
private let hapticFeedback = HapticFeedback()
init() {
super.init(navigationBarTheme: AuthorizationSequenceController.navigationBarTheme)
init(strings: PresentationStrings, theme: AuthorizationTheme) {
self.strings = strings
self.theme = theme
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .done, target: self, action: #selector(self.nextPressed))
super.init(navigationBarTheme: AuthorizationSequenceController.navigationBarTheme(theme))
self.hasActiveInput = true
self.statusBar.statusBarStyle = theme.statusBarStyle
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed))
}
required init(coder aDecoder: NSCoder) {
@@ -44,11 +54,11 @@ final class AuthorizationSequencePhoneEntryController: ViewController {
}
override public func loadDisplayNode() {
self.displayNode = AuthorizationSequencePhoneEntryControllerNode()
self.displayNode = AuthorizationSequencePhoneEntryControllerNode(strings: self.strings, theme: self.theme)
self.displayNodeDidLoad()
self.controllerNode.selectCountryCode = { [weak self] in
if let strongSelf = self {
let controller = AuthorizationSequenceCountrySelectionController()
let controller = AuthorizationSequenceCountrySelectionController(strings: strongSelf.strings, theme: strongSelf.theme)
controller.completeWithCountryCode = { code, _ in
if let strongSelf = self, let currentData = strongSelf.currentData {
strongSelf.updateData(countryCode: Int32(code), number: currentData.1)
@@ -76,7 +86,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController {
override func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) {
super.containerLayoutUpdated(layout, transition: transition)
self.controllerNode.containerLayoutUpdated(layout, navigationBarHeight: 0.0, transition: transition)
self.controllerNode.containerLayoutUpdated(layout, navigationBarHeight: self.navigationHeight, transition: transition)
}
@objc func nextPressed() {