diff --git a/Linphone/UI/Call/CallView.swift b/Linphone/UI/Call/CallView.swift index 52dac2093..caf4be1fe 100644 --- a/Linphone/UI/Call/CallView.swift +++ b/Linphone/UI/Call/CallView.swift @@ -39,6 +39,7 @@ struct CallView: View { @ObservedObject var conversationForwardMessageViewModel: ConversationForwardMessageViewModel @ObservedObject var contactViewModel: ContactViewModel @ObservedObject var editContactViewModel: EditContactViewModel + @ObservedObject var meetingViewModel: MeetingViewModel @State private var addParticipantsViewModel: AddParticipantsViewModel? @@ -76,6 +77,8 @@ struct CallView: View { @Binding var isShowEditContactFragment: Bool @Binding var indexPage: Int + @Binding var isShowScheduleMeetingFragment: Bool + var body: some View { GeometryReader { geo in ZStack { @@ -207,10 +210,12 @@ struct CallView: View { conversationForwardMessageViewModel: conversationForwardMessageViewModel, contactViewModel: contactViewModel, editContactViewModel: editContactViewModel, + meetingViewModel: meetingViewModel, isShowConversationFragment: $isShowConversationFragment, isShowStartCallGroupPopup: $isShowStartCallGroupPopup, isShowEditContactFragment: $isShowEditContactFragment, - indexPage: $indexPage + indexPage: $indexPage, + isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment ) .frame(maxWidth: .infinity) .background(Color.gray100) @@ -2836,12 +2841,14 @@ struct PressedButtonStyle: ButtonStyle { conversationForwardMessageViewModel: ConversationForwardMessageViewModel(), contactViewModel: ContactViewModel(), editContactViewModel: EditContactViewModel(), + meetingViewModel: MeetingViewModel(), fullscreenVideo: .constant(false), isShowStartCallFragment: .constant(false), isShowConversationFragment: .constant(false), isShowStartCallGroupPopup: .constant(false), isShowEditContactFragment: .constant(false), - indexPage: .constant(0) + indexPage: .constant(0), + isShowScheduleMeetingFragment: .constant(false) ) } // swiftlint:enable type_body_length diff --git a/Linphone/UI/Main/ContentView.swift b/Linphone/UI/Main/ContentView.swift index dd5b34494..6dd48d923 100644 --- a/Linphone/UI/Main/ContentView.swift +++ b/Linphone/UI/Main/ContentView.swift @@ -864,10 +864,12 @@ struct ContentView: View { conversationForwardMessageViewModel: conversationForwardMessageViewModel, contactViewModel: contactViewModel, editContactViewModel: editContactViewModel, + meetingViewModel: meetingViewModel, isShowConversationFragment: $isShowConversationFragment, isShowStartCallGroupPopup: $isShowStartCallGroupPopup, isShowEditContactFragment: $isShowEditContactFragment, - indexPage: $index + indexPage: $index, + isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment ) .frame(maxWidth: .infinity) .background(Color.gray100) @@ -1239,12 +1241,14 @@ struct ContentView: View { conversationForwardMessageViewModel: conversationForwardMessageViewModel, contactViewModel: contactViewModel, editContactViewModel: editContactViewModel, + meetingViewModel: meetingViewModel, fullscreenVideo: $fullscreenVideo, isShowStartCallFragment: $isShowStartCallFragment, isShowConversationFragment: $isShowConversationFragment, isShowStartCallGroupPopup: $isShowStartCallGroupPopup, isShowEditContactFragment: $isShowEditContactFragment, - indexPage: $index + indexPage: $index, + isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment ) .zIndex(5) .transition(.scale.combined(with: .move(edge: .top))) diff --git a/Linphone/UI/Main/Conversations/Fragments/ConversationFragment.swift b/Linphone/UI/Main/Conversations/Fragments/ConversationFragment.swift index cae7ab69d..8b475f0a4 100644 --- a/Linphone/UI/Main/Conversations/Fragments/ConversationFragment.swift +++ b/Linphone/UI/Main/Conversations/Fragments/ConversationFragment.swift @@ -35,6 +35,7 @@ struct ConversationFragment: View { @ObservedObject var conversationForwardMessageViewModel: ConversationForwardMessageViewModel @ObservedObject var contactViewModel: ContactViewModel @ObservedObject var editContactViewModel: EditContactViewModel + @ObservedObject var meetingViewModel: MeetingViewModel @State var isMenuOpen = false @State private var isMuted: Bool = false @@ -68,6 +69,8 @@ struct ConversationFragment: View { @Binding var isShowEditContactFragment: Bool @Binding var indexPage: Int + @Binding var isShowScheduleMeetingFragment: Bool + var body: some View { NavigationView { GeometryReader { geometry in @@ -984,12 +987,14 @@ struct ConversationFragment: View { conversationsListViewModel: conversationsListViewModel, contactViewModel: contactViewModel, editContactViewModel: editContactViewModel, + meetingViewModel: meetingViewModel, isMuted: $isMuted, isShowEphemeralFragment: $isShowEphemeralFragment, isShowStartCallGroupPopup: $isShowStartCallGroupPopup, isShowInfoConversationFragment: $isShowInfoConversationFragment, isShowEditContactFragment: $isShowEditContactFragment, - indexPage: $indexPage + indexPage: $indexPage, + isShowScheduleMeetingFragment: $isShowScheduleMeetingFragment ) .zIndex(5) .transition(.move(edge: .trailing)) diff --git a/Linphone/UI/Main/Conversations/Fragments/ConversationInfoFragment.swift b/Linphone/UI/Main/Conversations/Fragments/ConversationInfoFragment.swift index c5f5e7581..4e1127cfb 100644 --- a/Linphone/UI/Main/Conversations/Fragments/ConversationInfoFragment.swift +++ b/Linphone/UI/Main/Conversations/Fragments/ConversationInfoFragment.swift @@ -30,6 +30,7 @@ struct ConversationInfoFragment: View { @ObservedObject var conversationsListViewModel: ConversationsListViewModel @ObservedObject var contactViewModel: ContactViewModel @ObservedObject var editContactViewModel: EditContactViewModel + @ObservedObject var meetingViewModel: MeetingViewModel @State var addParticipantsViewModel = AddParticipantsViewModel() @@ -40,6 +41,8 @@ struct ConversationInfoFragment: View { @Binding var isShowEditContactFragment: Bool @Binding var indexPage: Int + @Binding var isShowScheduleMeetingFragment: Bool + @State private var participantListIsOpen = true var body: some View { @@ -217,7 +220,15 @@ struct ConversationInfoFragment: View { Spacer() Button(action: { - // TODO Create Meeting + if conversationViewModel.displayedConversation != nil { + meetingViewModel.subject = conversationViewModel.displayedConversation!.subject + meetingViewModel.participants = conversationViewModel.participants + conversationViewModel.displayedConversation = nil + indexPage = 3 + withAnimation { + isShowScheduleMeetingFragment = true + } + } }, label: { VStack { HStack(alignment: .center) { @@ -636,6 +647,9 @@ struct ConversationInfoFragment: View { } .background(.white) .navigationBarHidden(true) + .onAppear { + conversationViewModel.getParticipants() + } .onRotate { newOrientation in orientation = newOrientation } @@ -652,13 +666,15 @@ struct ConversationInfoFragment: View { conversationsListViewModel: ConversationsListViewModel(), contactViewModel: ContactViewModel(), editContactViewModel: EditContactViewModel(), + meetingViewModel: MeetingViewModel(), addParticipantsViewModel: AddParticipantsViewModel(), isMuted: .constant(false), isShowEphemeralFragment: .constant(false), isShowStartCallGroupPopup: .constant(false), isShowInfoConversationFragment: .constant(true), isShowEditContactFragment: .constant(false), - indexPage: .constant(0) + indexPage: .constant(0), + isShowScheduleMeetingFragment: .constant(false) ) } // swiftlint:enable type_body_length