mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Merge commit 'f440eccbf6a19570283a4933f4523000b2ab1768'
This commit is contained in:
commit
f1a7ce6341
@ -6527,6 +6527,7 @@ Sorry for the inconvenience.";
|
|||||||
"Conversation.InputMenu" = "Menu";
|
"Conversation.InputMenu" = "Menu";
|
||||||
"Conversation.MessageDoesntExist" = "Message doesn't exist";
|
"Conversation.MessageDoesntExist" = "Message doesn't exist";
|
||||||
|
|
||||||
|
"Settings.CheckPasswordTitle" = "Your Password";
|
||||||
"Settings.CheckPasswordText" = "Your account is protected by 2-Step Verification. Do you still remember your password?";
|
"Settings.CheckPasswordText" = "Your account is protected by 2-Step Verification. Do you still remember your password?";
|
||||||
"Settings.KeepPassword" = "Yes, definitely";
|
"Settings.KeepPassword" = "Yes, definitely";
|
||||||
"Settings.TryEnterPassword" = "Not sure, let me try";
|
"Settings.TryEnterPassword" = "Not sure, let me try";
|
||||||
|
@ -12,4 +12,6 @@ public protocol StatusBarHost {
|
|||||||
|
|
||||||
func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool)
|
func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool)
|
||||||
func setStatusBarHidden(_ value: Bool, animated: Bool)
|
func setStatusBarHidden(_ value: Bool, animated: Bool)
|
||||||
|
|
||||||
|
var shouldChangeStatusBarStyle: ((UIStatusBarStyle) -> Bool)? { get set }
|
||||||
}
|
}
|
||||||
|
@ -776,12 +776,11 @@ public class Window1 {
|
|||||||
self?.inCallNavigate?()
|
self?.inCallNavigate?()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.hostView.containerView.insertSubview(rootController.view, at: 0)
|
||||||
if !self.windowLayout.size.width.isZero && !self.windowLayout.size.height.isZero {
|
if !self.windowLayout.size.width.isZero && !self.windowLayout.size.height.isZero {
|
||||||
rootController.displayNode.frame = CGRect(origin: CGPoint(), size: self.windowLayout.size)
|
rootController.displayNode.frame = CGRect(origin: CGPoint(), size: self.windowLayout.size)
|
||||||
rootController.containerLayoutUpdated(containedLayoutForWindowLayout(self.windowLayout, deviceMetrics: self.deviceMetrics), transition: .immediate)
|
rootController.containerLayoutUpdated(containedLayoutForWindowLayout(self.windowLayout, deviceMetrics: self.deviceMetrics), transition: .immediate)
|
||||||
}
|
}
|
||||||
|
|
||||||
self.hostView.containerView.insertSubview(rootController.view, at: 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.hostView.eventView.setNeedsLayout()
|
self.hostView.eventView.setNeedsLayout()
|
||||||
|
@ -264,13 +264,13 @@ public final class GradientBackgroundNode: ASDisplayNode {
|
|||||||
|
|
||||||
var steps: [[CGPoint]] = []
|
var steps: [[CGPoint]] = []
|
||||||
if backwards {
|
if backwards {
|
||||||
let phaseCount = extendAnimation ? 4 : 1
|
let phaseCount = extendAnimation ? 6 : 1
|
||||||
self.phase = (self.phase + phaseCount) % 8
|
self.phase = (self.phase + phaseCount) % 8
|
||||||
self.validPhase = self.phase
|
self.validPhase = self.phase
|
||||||
|
|
||||||
var stepPhase = self.phase - phaseCount
|
var stepPhase = self.phase - phaseCount
|
||||||
if stepPhase < 0 {
|
if stepPhase < 0 {
|
||||||
stepPhase = 7
|
stepPhase = 8 + stepPhase
|
||||||
}
|
}
|
||||||
for _ in 0 ... phaseCount {
|
for _ in 0 ... phaseCount {
|
||||||
steps.append(gatherPositions(shiftArray(array: GradientBackgroundNode.basePositions, offset: stepPhase)))
|
steps.append(gatherPositions(shiftArray(array: GradientBackgroundNode.basePositions, offset: stepPhase)))
|
||||||
|
@ -58,7 +58,7 @@ public final class PasscodeEntryController: ViewController {
|
|||||||
private var inBackground: Bool = false
|
private var inBackground: Bool = false
|
||||||
private var inBackgroundDisposable: Disposable?
|
private var inBackgroundDisposable: Disposable?
|
||||||
|
|
||||||
private let statusBarHost: StatusBarHost?
|
private var statusBarHost: StatusBarHost?
|
||||||
private var previousStatusBarStyle: UIStatusBarStyle?
|
private var previousStatusBarStyle: UIStatusBarStyle?
|
||||||
|
|
||||||
public init(applicationBindings: TelegramApplicationBindings, accountManager: AccountManager, appLockContext: AppLockContext, presentationData: PresentationData, presentationDataSignal: Signal<PresentationData, NoError>, statusBarHost: StatusBarHost?, challengeData: PostboxAccessChallengeData, biometrics: PasscodeEntryControllerBiometricsMode, arguments: PasscodeEntryControllerPresentationArguments) {
|
public init(applicationBindings: TelegramApplicationBindings, accountManager: AccountManager, appLockContext: AppLockContext, presentationData: PresentationData, presentationDataSignal: Signal<PresentationData, NoError>, statusBarHost: StatusBarHost?, challengeData: PostboxAccessChallengeData, biometrics: PasscodeEntryControllerBiometricsMode, arguments: PasscodeEntryControllerPresentationArguments) {
|
||||||
@ -76,7 +76,14 @@ public final class PasscodeEntryController: ViewController {
|
|||||||
super.init(navigationBarPresentationData: nil)
|
super.init(navigationBarPresentationData: nil)
|
||||||
|
|
||||||
self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait)
|
self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait)
|
||||||
statusBarHost?.setStatusBarStyle(.lightContent, animated: true)
|
self.statusBarHost?.setStatusBarStyle(.lightContent, animated: true)
|
||||||
|
self.statusBarHost?.shouldChangeStatusBarStyle = { [weak self] style in
|
||||||
|
if let strongSelf = self {
|
||||||
|
strongSelf.previousStatusBarStyle = style
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
self.presentationDataDisposable = (presentationDataSignal
|
self.presentationDataDisposable = (presentationDataSignal
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] presentationData in
|
|> deliverOnMainQueue).start(next: { [weak self] presentationData in
|
||||||
@ -276,6 +283,7 @@ public final class PasscodeEntryController: ViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func dismiss(completion: (() -> Void)? = nil) {
|
public override func dismiss(completion: (() -> Void)? = nil) {
|
||||||
|
self.statusBarHost?.shouldChangeStatusBarStyle = nil
|
||||||
if let statusBarHost = self.statusBarHost, let previousStatusBarStyle = self.previousStatusBarStyle {
|
if let statusBarHost = self.statusBarHost, let previousStatusBarStyle = self.previousStatusBarStyle {
|
||||||
statusBarHost.setStatusBarStyle(previousStatusBarStyle, animated: true)
|
statusBarHost.setStatusBarStyle(previousStatusBarStyle, animated: true)
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,14 @@ final class PasscodeEntryControllerNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.keyboardNode.backspace = { [weak self] in
|
||||||
|
if let strongSelf = self {
|
||||||
|
strongSelf.inputFieldNode.delete()
|
||||||
|
if let gradientNode = strongSelf.backgroundCustomNode as? GradientBackgroundNode {
|
||||||
|
gradientNode.animateEvent(transition: .animated(duration: 0.55, curve: .spring), backwards: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
self.inputFieldNode.complete = { [weak self] passcode in
|
self.inputFieldNode.complete = { [weak self] passcode in
|
||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
|
@ -113,6 +113,7 @@ final class PasscodeEntryButtonNode: HighlightTrackingButtonNode {
|
|||||||
private let backgroundNode: ASImageNode
|
private let backgroundNode: ASImageNode
|
||||||
|
|
||||||
var action: (() -> Void)?
|
var action: (() -> Void)?
|
||||||
|
var cancelAction: (() -> Void)?
|
||||||
|
|
||||||
init(presentationData: PresentationData, background: PasscodeBackground, title: String, subtitle: String) {
|
init(presentationData: PresentationData, background: PasscodeBackground, title: String, subtitle: String) {
|
||||||
self.presentationData = presentationData
|
self.presentationData = presentationData
|
||||||
@ -146,11 +147,16 @@ final class PasscodeEntryButtonNode: HighlightTrackingButtonNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.addTarget(self, action: #selector(self.nop), forControlEvents: .touchUpInside)
|
self.addTarget(self, action: #selector(self.nop), forControlEvents: .touchUpInside)
|
||||||
|
self.addTarget(self, action: #selector(self.cancel), forControlEvents: .touchUpOutside)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func nop() {
|
@objc private func nop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc private func cancel() {
|
||||||
|
self.cancelAction?()
|
||||||
|
}
|
||||||
|
|
||||||
override var frame: CGRect {
|
override var frame: CGRect {
|
||||||
get {
|
get {
|
||||||
return super.frame
|
return super.frame
|
||||||
@ -223,6 +229,7 @@ final class PasscodeEntryKeyboardNode: ASDisplayNode {
|
|||||||
private var background: PasscodeBackground?
|
private var background: PasscodeBackground?
|
||||||
|
|
||||||
var charactedEntered: ((String) -> Void)?
|
var charactedEntered: ((String) -> Void)?
|
||||||
|
var backspace: (() -> Void)?
|
||||||
|
|
||||||
private func updateButtons() {
|
private func updateButtons() {
|
||||||
guard let presentationData = self.presentationData, let background = self.background else {
|
guard let presentationData = self.presentationData, let background = self.background else {
|
||||||
@ -239,6 +246,9 @@ final class PasscodeEntryKeyboardNode: ASDisplayNode {
|
|||||||
buttonNode.action = { [weak self] in
|
buttonNode.action = { [weak self] in
|
||||||
self?.charactedEntered?(title)
|
self?.charactedEntered?(title)
|
||||||
}
|
}
|
||||||
|
buttonNode.cancelAction = { [weak self] in
|
||||||
|
self?.backspace?()
|
||||||
|
}
|
||||||
self.addSubnode(buttonNode)
|
self.addSubnode(buttonNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -99,9 +99,13 @@ private class ApplicationStatusBarHost: StatusBarHost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool) {
|
func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool) {
|
||||||
self.application.setStatusBarStyle(style, animated: animated)
|
if self.shouldChangeStatusBarStyle?(style) ?? true {
|
||||||
|
self.application.setStatusBarStyle(style, animated: animated)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var shouldChangeStatusBarStyle: ((UIStatusBarStyle) -> Bool)?
|
||||||
|
|
||||||
func setStatusBarHidden(_ value: Bool, animated: Bool) {
|
func setStatusBarHidden(_ value: Bool, animated: Bool) {
|
||||||
self.application.setStatusBarHidden(value, with: animated ? .fade : .none)
|
self.application.setStatusBarHidden(value, with: animated ? .fade : .none)
|
||||||
}
|
}
|
||||||
|
@ -529,6 +529,7 @@ private enum PeerInfoSettingsSection {
|
|||||||
case username
|
case username
|
||||||
case addAccount
|
case addAccount
|
||||||
case logout
|
case logout
|
||||||
|
case rememberPassword
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class PeerInfoInteraction {
|
private final class PeerInfoInteraction {
|
||||||
@ -708,7 +709,14 @@ private func settingsItems(data: PeerInfoScreenData?, context: AccountContext, p
|
|||||||
interaction.openSettings(.phoneNumber)
|
interaction.openSettings(.phoneNumber)
|
||||||
}))
|
}))
|
||||||
} else if settings.suggestPasswordConfirmation {
|
} else if settings.suggestPasswordConfirmation {
|
||||||
|
items[.phone]!.append(PeerInfoScreenInfoItem(id: 0, title: presentationData.strings.Settings_CheckPasswordTitle, text: .markdown(presentationData.strings.Settings_CheckPasswordText), linkAction: { _ in
|
||||||
|
}))
|
||||||
|
items[.phone]!.append(PeerInfoScreenActionItem(id: 1, text: presentationData.strings.Settings_KeepPassword, action: {
|
||||||
|
let _ = dismissServerProvidedSuggestion(account: context.account, suggestion: .validatePassword).start()
|
||||||
|
}))
|
||||||
|
items[.phone]!.append(PeerInfoScreenActionItem(id: 2, text: presentationData.strings.Settings_TryEnterPassword, action: {
|
||||||
|
interaction.openSettings(.phoneNumber)
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
if !settings.accountsAndPeers.isEmpty {
|
if !settings.accountsAndPeers.isEmpty {
|
||||||
@ -5445,6 +5453,8 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
|
|||||||
self.controller?.push(logoutOptionsController(context: self.context, navigationController: navigationController, canAddAccounts: accounts.count + 1 < maximumNumberOfAccounts, phoneNumber: phoneNumber))
|
self.controller?.push(logoutOptionsController(context: self.context, navigationController: navigationController, canAddAccounts: accounts.count + 1 < maximumNumberOfAccounts, phoneNumber: phoneNumber))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case .rememberPassword:
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,44 +601,13 @@ public final class OngoingGroupCallContext {
|
|||||||
mainView?.setOnIsMirroredUpdated { value in
|
mainView?.setOnIsMirroredUpdated { value in
|
||||||
f?(value)
|
f?(value)
|
||||||
}
|
}
|
||||||
|
}, setIsPaused: { [weak mainView] paused in
|
||||||
|
mainView?.setIsPaused(paused)
|
||||||
|
}, renderToSize: { [weak mainView] size, animated in
|
||||||
|
mainView?.render(to: size, animated: animated)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
var cloneVideoView: OngoingCallContextPresentationCallVideoView?
|
completion(mainVideoView, nil)
|
||||||
if let cloneView = cloneView {
|
|
||||||
cloneVideoView = OngoingCallContextPresentationCallVideoView(
|
|
||||||
view: cloneView,
|
|
||||||
setOnFirstFrameReceived: { [weak cloneView] f in
|
|
||||||
cloneView?.setOnFirstFrameReceived(f)
|
|
||||||
},
|
|
||||||
getOrientation: { [weak cloneView] in
|
|
||||||
if let cloneView = cloneView {
|
|
||||||
return OngoingCallVideoOrientation(cloneView.orientation)
|
|
||||||
} else {
|
|
||||||
return .rotation0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getAspect: { [weak cloneView] in
|
|
||||||
if let cloneView = cloneView {
|
|
||||||
return cloneView.aspect
|
|
||||||
} else {
|
|
||||||
return 0.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setOnOrientationUpdated: { [weak cloneView] f in
|
|
||||||
cloneView?.setOnOrientationUpdated { value, aspect in
|
|
||||||
f?(OngoingCallVideoOrientation(value), aspect)
|
|
||||||
}
|
|
||||||
}, setVideoContentMode: { [weak cloneView] mode in
|
|
||||||
cloneView?.setVideoContentMode(mode)
|
|
||||||
},
|
|
||||||
setOnIsMirroredUpdated: { [weak cloneView] f in
|
|
||||||
cloneView?.setOnIsMirroredUpdated { value in
|
|
||||||
f?(value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
completion(mainVideoView, cloneVideoView)
|
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
completion(nil, nil)
|
completion(nil, nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user