mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Merge branch 'feature/call_features_custom_bottom_sheet' into 'master'
Custom bottom sheet in call view See merge request BC/private/linphone-iphone-6.0!18
This commit is contained in:
commit
2fc711b63f
10 changed files with 728 additions and 714 deletions
|
|
@ -123,7 +123,6 @@ final class CoreContext: ObservableObject {
|
|||
self.mCore.videoCaptureEnabled = true
|
||||
self.mCore.videoDisplayEnabled = true
|
||||
|
||||
|
||||
// Create a Core listener to listen for the callback we need
|
||||
// In this case, we want to know about the account registration status
|
||||
self.mCoreSuscriptions.insert(self.mCore.publisher?.onConfiguringStatus?.postOnMainQueue { (cbVal: (core: Core, status: Config.ConfiguringState, message: String)) in
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<true/>
|
||||
<key>ITSEncryptionExportComplianceCode</key>
|
||||
<string>b5cb085f-772a-4a4f-8c77-5d1332b1f93f</string>
|
||||
<key>UIUserInterfaceStyle</key>
|
||||
<string>Light</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Camera usage is required for video VOIP calls</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>Microphone usage is required for VOIP calls</string>
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>NotoSans-Light.ttf</string>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@
|
|||
"strings" : {
|
||||
"" : {
|
||||
|
||||
},
|
||||
" " : {
|
||||
|
||||
},
|
||||
" et " : {
|
||||
|
||||
|
|
@ -337,9 +334,6 @@
|
|||
},
|
||||
"Incoming call" : {
|
||||
|
||||
},
|
||||
"Incoming Call" : {
|
||||
|
||||
},
|
||||
"Information" : {
|
||||
|
||||
|
|
@ -418,9 +412,6 @@
|
|||
},
|
||||
"Outgoing call" : {
|
||||
|
||||
},
|
||||
"Outgoing Call" : {
|
||||
|
||||
},
|
||||
"password" : {
|
||||
"extractionState" : "manual",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -75,6 +75,7 @@ class CallViewModel: ObservableObject {
|
|||
|
||||
//self.avatarModel = ???
|
||||
self.micMutted = self.currentCall!.microphoneMuted
|
||||
self.cameraDisplayed = self.currentCall!.cameraEnabled == true
|
||||
self.isRecording = self.currentCall!.params!.isRecording
|
||||
self.isPaused = self.isCallPaused()
|
||||
self.timeElapsed = 0
|
||||
|
|
|
|||
|
|
@ -35,45 +35,25 @@ struct ContactFragment: View {
|
|||
|
||||
var body: some View {
|
||||
let indexDisplayed = contactViewModel.indexDisplayedFriend != nil ? contactViewModel.indexDisplayedFriend! : 0
|
||||
if #available(iOS 16.0, *) {
|
||||
if idiom != .pad {
|
||||
ContactInnerFragment(
|
||||
contactAvatarModel: ContactsManager.shared.avatarListModel[indexDisplayed],
|
||||
contactViewModel: contactViewModel,
|
||||
editContactViewModel: editContactViewModel,
|
||||
cnContact: CNContact(),
|
||||
isShowDeletePopup: $isShowDeletePopup,
|
||||
showingSheet: $showingSheet,
|
||||
showShareSheet: $showShareSheet,
|
||||
isShowDismissPopup: $isShowDismissPopup
|
||||
)
|
||||
.sheet(isPresented: $showingSheet) {
|
||||
ContactListBottomSheet(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
.presentationDetents([.fraction(0.2)])
|
||||
}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: ContactsManager.shared.lastSearch[contactViewModel.indexDisplayedFriend!].friend!)
|
||||
.presentationDetents([.medium])
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
} else {
|
||||
ContactInnerFragment(
|
||||
contactAvatarModel: ContactsManager.shared.avatarListModel[indexDisplayed],
|
||||
contactViewModel: contactViewModel,
|
||||
editContactViewModel: editContactViewModel,
|
||||
cnContact: CNContact(),
|
||||
isShowDeletePopup: $isShowDeletePopup,
|
||||
showingSheet: $showingSheet,
|
||||
showShareSheet: $showShareSheet,
|
||||
isShowDismissPopup: $isShowDismissPopup
|
||||
)
|
||||
.halfSheet(showSheet: $showingSheet) {
|
||||
ContactListBottomSheet(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
} onDismiss: {}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: ContactsManager.shared.lastSearch[contactViewModel.indexDisplayedFriend!].friend!)
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
if #available(iOS 16.0, *), idiom != .pad {
|
||||
ContactInnerFragment(
|
||||
contactAvatarModel: ContactsManager.shared.avatarListModel[indexDisplayed],
|
||||
contactViewModel: contactViewModel,
|
||||
editContactViewModel: editContactViewModel,
|
||||
cnContact: CNContact(),
|
||||
isShowDeletePopup: $isShowDeletePopup,
|
||||
showingSheet: $showingSheet,
|
||||
showShareSheet: $showShareSheet,
|
||||
isShowDismissPopup: $isShowDismissPopup
|
||||
)
|
||||
.sheet(isPresented: $showingSheet) {
|
||||
ContactListBottomSheet(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
.presentationDetents([.fraction(0.2)])
|
||||
}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: ContactsManager.shared.lastSearch[contactViewModel.indexDisplayedFriend!].friend!)
|
||||
.presentationDetents([.medium])
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
} else {
|
||||
ContactInnerFragment(
|
||||
|
|
@ -89,10 +69,10 @@ struct ContactFragment: View {
|
|||
.halfSheet(showSheet: $showingSheet) {
|
||||
ContactListBottomSheet(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
} onDismiss: {}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: ContactsManager.shared.lastSearch[contactViewModel.indexDisplayedFriend!].friend!)
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: ContactsManager.shared.lastSearch[contactViewModel.indexDisplayedFriend!].friend!)
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,38 +32,22 @@ struct ContactsFragment: View {
|
|||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
if #available(iOS 16.0, *) {
|
||||
if idiom != .pad {
|
||||
ContactsInnerFragment(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
.sheet(isPresented: $showingSheet) {
|
||||
ContactsListBottomSheet(
|
||||
contactViewModel: contactViewModel,
|
||||
isShowDeletePopup: $isShowDeletePopup,
|
||||
showingSheet: $showingSheet,
|
||||
showShareSheet: $showShareSheet
|
||||
)
|
||||
.presentationDetents([.fraction(0.2)])
|
||||
}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: contactViewModel.selectedFriendToShare!)
|
||||
.presentationDetents([.medium])
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
} else {
|
||||
ContactsInnerFragment(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
.halfSheet(showSheet: $showingSheet) {
|
||||
ContactsListBottomSheet(
|
||||
contactViewModel: contactViewModel,
|
||||
isShowDeletePopup: $isShowDeletePopup,
|
||||
showingSheet: $showingSheet,
|
||||
showShareSheet: $showShareSheet
|
||||
)
|
||||
} onDismiss: {}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: contactViewModel.selectedFriendToShare!)
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
}
|
||||
if #available(iOS 16.0, *), idiom != .pad {
|
||||
ContactsInnerFragment(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
.sheet(isPresented: $showingSheet) {
|
||||
ContactsListBottomSheet(
|
||||
contactViewModel: contactViewModel,
|
||||
isShowDeletePopup: $isShowDeletePopup,
|
||||
showingSheet: $showingSheet,
|
||||
showShareSheet: $showShareSheet
|
||||
)
|
||||
.presentationDetents([.fraction(0.2)])
|
||||
}
|
||||
.sheet(isPresented: $showShareSheet) {
|
||||
ShareSheet(friendToShare: contactViewModel.selectedFriendToShare!)
|
||||
.presentationDetents([.medium])
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
} else {
|
||||
ContactsInnerFragment(contactViewModel: contactViewModel, showingSheet: $showingSheet)
|
||||
.halfSheet(showSheet: $showingSheet) {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ struct EditContactFragment: View {
|
|||
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
|
||||
@State private var orientation = UIDevice.current.orientation
|
||||
|
||||
var contactViewModel: ContactViewModel
|
||||
|
||||
@Binding var isShowEditContactFragment: Bool
|
||||
|
|
@ -50,16 +53,33 @@ struct EditContactFragment: View {
|
|||
ZStack {
|
||||
VStack(spacing: 1) {
|
||||
if editContactViewModel.selectedEditFriend == nil {
|
||||
Rectangle()
|
||||
.foregroundColor(delayedColor)
|
||||
.edgesIgnoringSafeArea(.top)
|
||||
.frame(height: 0)
|
||||
.task(delayColor)
|
||||
if #available(iOS 16.0, *) {
|
||||
Rectangle()
|
||||
.foregroundColor(delayedColor)
|
||||
.edgesIgnoringSafeArea(.top)
|
||||
.frame(height: 0)
|
||||
.task(delayColor)
|
||||
} else if idiom != .pad && !(orientation == .landscapeLeft || orientation == .landscapeRight
|
||||
|| UIScreen.main.bounds.size.width > UIScreen.main.bounds.size.height) {
|
||||
Rectangle()
|
||||
.foregroundColor(delayedColor)
|
||||
.edgesIgnoringSafeArea(.top)
|
||||
.frame(height: 1)
|
||||
.task(delayColor)
|
||||
}
|
||||
} else {
|
||||
Rectangle()
|
||||
.foregroundColor(Color.orangeMain500)
|
||||
.edgesIgnoringSafeArea(.top)
|
||||
.frame(height: 0)
|
||||
if #available(iOS 16.0, *) {
|
||||
Rectangle()
|
||||
.foregroundColor(Color.orangeMain500)
|
||||
.edgesIgnoringSafeArea(.top)
|
||||
.frame(height: 0)
|
||||
} else if idiom != .pad && !(orientation == .landscapeLeft || orientation == .landscapeRight
|
||||
|| UIScreen.main.bounds.size.width > UIScreen.main.bounds.size.height) {
|
||||
Rectangle()
|
||||
.foregroundColor(Color.orangeMain500)
|
||||
.edgesIgnoringSafeArea(.top)
|
||||
.frame(height: 1)
|
||||
}
|
||||
}
|
||||
|
||||
HStack {
|
||||
|
|
|
|||
|
|
@ -515,40 +515,23 @@ struct ContentView: View {
|
|||
|
||||
if isShowStartCallFragment {
|
||||
|
||||
if #available(iOS 16.4, *) {
|
||||
if idiom != .pad {
|
||||
StartCallFragment(
|
||||
if #available(iOS 16.4, *), idiom != .pad {
|
||||
StartCallFragment(
|
||||
startCallViewModel: startCallViewModel,
|
||||
isShowStartCallFragment: $isShowStartCallFragment,
|
||||
showingDialer: $showingDialer
|
||||
)
|
||||
.zIndex(3)
|
||||
.transition(.move(edge: .bottom))
|
||||
.sheet(isPresented: $showingDialer) {
|
||||
DialerBottomSheet(
|
||||
startCallViewModel: startCallViewModel,
|
||||
isShowStartCallFragment: $isShowStartCallFragment,
|
||||
showingDialer: $showingDialer
|
||||
)
|
||||
.zIndex(3)
|
||||
.transition(.move(edge: .bottom))
|
||||
.sheet(isPresented: $showingDialer) {
|
||||
DialerBottomSheet(
|
||||
startCallViewModel: startCallViewModel,
|
||||
showingDialer: $showingDialer
|
||||
)
|
||||
.presentationDetents([.medium])
|
||||
// .interactiveDismissDisabled()
|
||||
.presentationBackgroundInteraction(.enabled(upThrough: .medium))
|
||||
}
|
||||
} else {
|
||||
StartCallFragment(
|
||||
startCallViewModel: startCallViewModel,
|
||||
isShowStartCallFragment: $isShowStartCallFragment,
|
||||
showingDialer: $showingDialer
|
||||
)
|
||||
.zIndex(3)
|
||||
.transition(.move(edge: .bottom))
|
||||
.halfSheet(showSheet: $showingDialer) {
|
||||
DialerBottomSheet(
|
||||
startCallViewModel: startCallViewModel,
|
||||
showingDialer: $showingDialer
|
||||
)
|
||||
} onDismiss: {}
|
||||
.presentationDetents([.medium])
|
||||
// .interactiveDismissDisabled()
|
||||
.presentationBackgroundInteraction(.enabled(upThrough: .medium))
|
||||
}
|
||||
|
||||
} else {
|
||||
StartCallFragment(
|
||||
startCallViewModel: startCallViewModel,
|
||||
|
|
|
|||
|
|
@ -33,35 +33,20 @@ struct HistoryFragment: View {
|
|||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
if #available(iOS 16.0, *) {
|
||||
if idiom != .pad {
|
||||
HistoryListFragment(historyListViewModel: historyListViewModel, historyViewModel: historyViewModel, showingSheet: $showingSheet)
|
||||
.sheet(isPresented: $showingSheet) {
|
||||
HistoryListBottomSheet(
|
||||
historyViewModel: historyViewModel,
|
||||
contactViewModel: contactViewModel,
|
||||
editContactViewModel: editContactViewModel,
|
||||
historyListViewModel: historyListViewModel,
|
||||
showingSheet: $showingSheet,
|
||||
index: $index,
|
||||
isShowEditContactFragment: $isShowEditContactFragment
|
||||
)
|
||||
.presentationDetents([.fraction(0.2)])
|
||||
}
|
||||
} else {
|
||||
HistoryListFragment(historyListViewModel: historyListViewModel, historyViewModel: historyViewModel, showingSheet: $showingSheet)
|
||||
.halfSheet(showSheet: $showingSheet) {
|
||||
HistoryListBottomSheet(
|
||||
historyViewModel: historyViewModel,
|
||||
contactViewModel: contactViewModel,
|
||||
editContactViewModel: editContactViewModel,
|
||||
historyListViewModel: historyListViewModel,
|
||||
showingSheet: $showingSheet,
|
||||
index: $index,
|
||||
isShowEditContactFragment: $isShowEditContactFragment
|
||||
)
|
||||
} onDismiss: {}
|
||||
}
|
||||
if #available(iOS 16.0, *), idiom != .pad {
|
||||
HistoryListFragment(historyListViewModel: historyListViewModel, historyViewModel: historyViewModel, showingSheet: $showingSheet)
|
||||
.sheet(isPresented: $showingSheet) {
|
||||
HistoryListBottomSheet(
|
||||
historyViewModel: historyViewModel,
|
||||
contactViewModel: contactViewModel,
|
||||
editContactViewModel: editContactViewModel,
|
||||
historyListViewModel: historyListViewModel,
|
||||
showingSheet: $showingSheet,
|
||||
index: $index,
|
||||
isShowEditContactFragment: $isShowEditContactFragment
|
||||
)
|
||||
.presentationDetents([.fraction(0.2)])
|
||||
}
|
||||
} else {
|
||||
HistoryListFragment(historyListViewModel: historyListViewModel, historyViewModel: historyViewModel, showingSheet: $showingSheet)
|
||||
.halfSheet(showSheet: $showingSheet) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue