Combo update

This commit is contained in:
Ali
2021-06-10 01:15:00 +04:00
parent 9a364604c1
commit 3b621f0075
173 changed files with 8865 additions and 6411 deletions

View File

@@ -16,6 +16,7 @@ import CallsEmoji
import TooltipUI
import AlertUI
import PresentationDataUtils
import DeviceAccess
private func interpolateFrame(from fromValue: CGRect, to toValue: CGRect, t: CGFloat) -> CGRect {
return CGRect(x: floorToScreenPixels(toValue.origin.x * t + fromValue.origin.x * (1.0 - t)), y: floorToScreenPixels(toValue.origin.y * t + fromValue.origin.y * (1.0 - t)), width: floorToScreenPixels(toValue.size.width * t + fromValue.size.width * (1.0 - t)), height: floorToScreenPixels(toValue.size.height * t + fromValue.size.height * (1.0 - t)))
@@ -559,25 +560,36 @@ final class CallControllerNode: ViewControllerTracingNode, CallControllerNodePro
switch callState.state {
case .active:
if strongSelf.outgoingVideoNodeValue == nil {
let proceed = {
strongSelf.displayedCameraConfirmation = true
switch callState.videoState {
case .inactive:
strongSelf.isRequestingVideo = true
strongSelf.updateButtonsMode()
default:
break
DeviceAccess.authorizeAccess(to: .camera(.videoCall), onlyCheck: true, presentationData: strongSelf.presentationData, present: { [weak self] c, a in
if let strongSelf = self {
strongSelf.present?(c)
}
strongSelf.call.requestVideo()
}
if strongSelf.displayedCameraConfirmation {
proceed()
} else {
strongSelf.present?(textAlertController(sharedContext: strongSelf.sharedContext, title: nil, text: strongSelf.presentationData.strings.Call_CameraConfirmationText, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Call_CameraConfirmationConfirm, action: {
}, openSettings: { [weak self] in
self?.sharedContext.applicationBindings.openSettings()
}, _: { [weak self] ready in
guard let strongSelf = self, ready else {
return
}
let proceed = {
strongSelf.displayedCameraConfirmation = true
switch callState.videoState {
case .inactive:
strongSelf.isRequestingVideo = true
strongSelf.updateButtonsMode()
default:
break
}
strongSelf.call.requestVideo()
}
if strongSelf.displayedCameraConfirmation {
proceed()
})]))
}
} else {
strongSelf.present?(textAlertController(sharedContext: strongSelf.sharedContext, title: nil, text: strongSelf.presentationData.strings.Call_CameraConfirmationText, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Call_CameraConfirmationConfirm, action: {
proceed()
})]))
}
})
} else {
strongSelf.call.disableVideo()
strongSelf.cancelScheduledUIHiding()