forked from mirrors/linphone-iphone
Add green call banner
This commit is contained in:
parent
433e28e945
commit
5b3c8d4d1a
9 changed files with 590 additions and 551 deletions
|
|
@ -241,6 +241,9 @@
|
|||
},
|
||||
"Contacts" : {
|
||||
|
||||
},
|
||||
"Content" : {
|
||||
|
||||
},
|
||||
"Continue" : {
|
||||
|
||||
|
|
@ -564,6 +567,9 @@
|
|||
},
|
||||
"This contact will be deleted definitively." : {
|
||||
|
||||
},
|
||||
"Title" : {
|
||||
|
||||
},
|
||||
"TLS" : {
|
||||
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ extension ProviderDelegate: CXProviderDelegate {
|
|||
DispatchQueue.main.async {
|
||||
withAnimation {
|
||||
TelecomManager.shared.callInProgress = true
|
||||
TelecomManager.shared.callDisplayed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class TelecomManager: ObservableObject {
|
|||
let callController: CXCallController // to support callkit
|
||||
|
||||
@Published var callInProgress: Bool = false
|
||||
@Published var callDisplayed: Bool = true
|
||||
@Published var callStarted: Bool = false
|
||||
@Published var outgoingCallStarted: Bool = false
|
||||
@Published var remoteVideo: Bool = false
|
||||
|
|
@ -242,6 +243,7 @@ class TelecomManager: ObservableObject {
|
|||
if self.callInProgress == false {
|
||||
withAnimation {
|
||||
self.callInProgress = true
|
||||
self.callDisplayed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -448,6 +450,7 @@ class TelecomManager: ObservableObject {
|
|||
if self.callInProgress == false {
|
||||
withAnimation {
|
||||
self.callInProgress = true
|
||||
self.callDisplayed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -578,6 +581,7 @@ class TelecomManager: ObservableObject {
|
|||
withAnimation {
|
||||
self.outgoingCallStarted = false
|
||||
self.callInProgress = false
|
||||
self.callDisplayed = false
|
||||
self.callStarted = false
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -44,11 +44,11 @@ struct CallView: View {
|
|||
@State var imageAudioRoute: String = ""
|
||||
|
||||
@State var angleDegree = 0.0
|
||||
@State var fullscreenVideo = false
|
||||
|
||||
@State var showingDialer = false
|
||||
|
||||
@State var isShowCallsListFragment = false
|
||||
@Binding var fullscreenVideo: Bool
|
||||
@Binding var isShowCallsListFragment: Bool
|
||||
@Binding var isShowStartCallFragment: Bool
|
||||
|
||||
var body: some View {
|
||||
|
|
@ -530,7 +530,7 @@ struct CallView: View {
|
|||
maxWidth: fullscreenVideo && !telecomManager.isPausedByRemote ? geometry.size.width : geometry.size.width - 8,
|
||||
maxHeight: fullscreenVideo && !telecomManager.isPausedByRemote ? geometry.size.height + geometry.safeAreaInsets.top + geometry.safeAreaInsets.bottom : geometry.size.height - (0.1 * geometry.size.height) - 60
|
||||
)
|
||||
.background(Color.gray600)
|
||||
.background(Color.gray900)
|
||||
.cornerRadius(20)
|
||||
.padding(.horizontal, fullscreenVideo && !telecomManager.isPausedByRemote ? 0 : 4)
|
||||
.onRotate { newOrientation in
|
||||
|
|
@ -862,6 +862,9 @@ struct CallView: View {
|
|||
HStack(spacing: 0) {
|
||||
VStack {
|
||||
Button {
|
||||
withAnimation {
|
||||
telecomManager.callDisplayed = false
|
||||
}
|
||||
} label: {
|
||||
Image("chat-teardrop-text")
|
||||
.renderingMode(.template)
|
||||
|
|
@ -875,7 +878,7 @@ struct CallView: View {
|
|||
.background(Color.gray600)
|
||||
.cornerRadius(40)
|
||||
//.disabled(callViewModel.isPaused || telecomManager.isPausedByRemote)
|
||||
.disabled(true)
|
||||
//.disabled(true)
|
||||
|
||||
Text("Messages")
|
||||
.foregroundStyle(.white)
|
||||
|
|
@ -1056,8 +1059,6 @@ struct CallView: View {
|
|||
}
|
||||
.frame(width: geo.size.width * 0.125, height: geo.size.width * 0.125)
|
||||
|
||||
|
||||
|
||||
VStack {
|
||||
Button {
|
||||
} label: {
|
||||
|
|
@ -1129,7 +1130,7 @@ struct CallView: View {
|
|||
}
|
||||
Spacer()
|
||||
}
|
||||
.background(Color.gray900)
|
||||
.background(Color.gray600)
|
||||
.frame(maxHeight: .infinity, alignment: .top)
|
||||
}
|
||||
}
|
||||
|
|
@ -1203,7 +1204,7 @@ struct BottomSheetView<Content: View>: View {
|
|||
}
|
||||
|
||||
#Preview {
|
||||
CallView(callViewModel: CallViewModel(), isShowStartCallFragment: .constant(false))
|
||||
CallView(callViewModel: CallViewModel(), fullscreenVideo: .constant(false), isShowCallsListFragment: .constant(false), isShowStartCallFragment: .constant(false))
|
||||
}
|
||||
// swiftlint:enable type_body_length
|
||||
// swiftlint:enable line_length
|
||||
|
|
|
|||
|
|
@ -121,7 +121,9 @@ class CallViewModel: ObservableObject {
|
|||
|
||||
func getCallsList() {
|
||||
coreContext.doOnCoreQueue { core in
|
||||
self.calls = core.calls
|
||||
DispatchQueue.main.async {
|
||||
self.calls = core.calls
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -141,6 +143,7 @@ class CallViewModel: ObservableObject {
|
|||
withAnimation {
|
||||
telecomManager.outgoingCallStarted = false
|
||||
telecomManager.callInProgress = true
|
||||
telecomManager.callDisplayed = true
|
||||
telecomManager.callStarted = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ struct ContactsInnerFragment: View {
|
|||
.frame(width: 25, height: 25, alignment: .leading)
|
||||
.padding(.all, 10)
|
||||
}
|
||||
.padding(.top, 30)
|
||||
.padding(.top, 10)
|
||||
.padding(.horizontal, 16)
|
||||
.background(.white)
|
||||
.onTapGesture {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ struct FavoriteContactsListFragment: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.padding(.all, 10)
|
||||
.padding(.horizontal, 10)
|
||||
.padding(.bottom, 10)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -25,6 +25,8 @@ struct SideMenu: View {
|
|||
|
||||
@ObservedObject private var coreContext = CoreContext.shared
|
||||
|
||||
@ObservedObject var callViewModel: CallViewModel
|
||||
|
||||
let width: CGFloat
|
||||
let isOpen: Bool
|
||||
let menuClose: () -> Void
|
||||
|
|
@ -88,7 +90,7 @@ struct SideMenu: View {
|
|||
Spacer()
|
||||
}
|
||||
.padding(.leading, safeAreaInsets.leading)
|
||||
.padding(.top, safeAreaInsets.top)
|
||||
.padding(.top, TelecomManager.shared.callInProgress ? 0 : safeAreaInsets.top)
|
||||
.padding(.bottom, safeAreaInsets.bottom)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue