From 07dbf407b044ad1ce7542adb3ecb9b9d8295496d Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Thu, 20 Nov 2025 15:54:22 +0100 Subject: [PATCH] Update PopupView UI --- .../Localizable/cs.lproj/Localizable.strings | 2 +- .../Localizable/de.lproj/Localizable.strings | 2 +- .../Localizable/en.lproj/Localizable.strings | 2 +- .../Localizable/fr.lproj/Localizable.strings | 2 +- .../Localizable/ru.lproj/Localizable.strings | 2 +- .../Localizable/sk.lproj/Localizable.strings | 2 +- .../Localizable/uk.lproj/Localizable.strings | 2 +- .../zh-Hans.lproj/Localizable.strings | 2 +- .../Assistant/Fragments/LoginFragment.swift | 36 ++-- .../Fragments/ProfileModeFragment.swift | 29 ++-- .../Fragments/RegisterFragment.swift | 11 +- .../UI/Call/Fragments/CallsListFragment.swift | 26 +-- .../Fragments/ParticipantsListFragment.swift | 26 +-- Linphone/UI/Main/ContentView.swift | 160 +++++++++++------- .../StartGroupConversationFragment.swift | 2 +- .../Main/Fragments/PopupUpdatePassword.swift | 2 +- Linphone/UI/Main/Fragments/PopupView.swift | 94 ++++++---- .../Fragments/PopupViewWithTextField.swift | 2 +- .../UI/Main/Help/Fragments/HelpFragment.swift | 10 +- .../Fragments/ScheduleMeetingFragment.swift | 2 +- .../Fragments/AccountProfileFragment.swift | 21 +-- 21 files changed, 258 insertions(+), 179 deletions(-) diff --git a/Linphone/Localizable/cs.lproj/Localizable.strings b/Linphone/Localizable/cs.lproj/Localizable.strings index 27e239ef7..631ccadd3 100644 --- a/Linphone/Localizable/cs.lproj/Localizable.strings +++ b/Linphone/Localizable/cs.lproj/Localizable.strings @@ -2,7 +2,7 @@ "assistant_sip_account_transport_protocol" = "Transport"; "contact_call_action" = "Volat"; "conversation_action_call" = "Volat"; -"dialog_ok" = "OK"; +"dialog_confirm" = "Confirm"; "drawer_menu_manage_account" = "Spravovat profil"; "help_error_checking_version_toast_message" = "Během kontroly aktualizací nastala chyba"; "settings_contacts_carddav_name_title" = "Zobrazené jméno"; diff --git a/Linphone/Localizable/de.lproj/Localizable.strings b/Linphone/Localizable/de.lproj/Localizable.strings index 97d4d7e1c..8d4ff7de9 100644 --- a/Linphone/Localizable/de.lproj/Localizable.strings +++ b/Linphone/Localizable/de.lproj/Localizable.strings @@ -192,7 +192,7 @@ "dialog_deny" = "Ablehnen"; "dialog_install" = "Installieren"; "dialog_no" = "Nein"; -"dialog_ok" = "OK"; +"dialog_confirm" = "Confirm"; "dialog_yes" = "Ja"; "drawer_menu_account_connection_status_cleared" = "Deaktiviert"; "drawer_menu_account_connection_status_connected" = "Verbunden"; diff --git a/Linphone/Localizable/en.lproj/Localizable.strings b/Linphone/Localizable/en.lproj/Localizable.strings index c68cdeafa..d7050448e 100644 --- a/Linphone/Localizable/en.lproj/Localizable.strings +++ b/Linphone/Localizable/en.lproj/Localizable.strings @@ -272,7 +272,7 @@ "dialog_deny" = "Deny"; "dialog_install" = "Install"; "dialog_no" = "No"; -"dialog_ok" = "OK"; +"dialog_confirm" = "Confirm"; "dialog_yes" = "Yes"; "drawer_menu_account_connection_status_cleared" = "Disabled"; "drawer_menu_account_connection_status_connected" = "Connected"; diff --git a/Linphone/Localizable/fr.lproj/Localizable.strings b/Linphone/Localizable/fr.lproj/Localizable.strings index b6008c570..5f09441a0 100644 --- a/Linphone/Localizable/fr.lproj/Localizable.strings +++ b/Linphone/Localizable/fr.lproj/Localizable.strings @@ -272,7 +272,7 @@ "dialog_deny" = "Refuser"; "dialog_install" = "Installer"; "dialog_no" = "Non"; -"dialog_ok" = "OK"; +"dialog_confirm" = "Confirmer"; "dialog_yes" = "Oui"; "drawer_menu_account_connection_status_cleared" = "Désactivé"; "drawer_menu_account_connection_status_connected" = "Connecté"; diff --git a/Linphone/Localizable/ru.lproj/Localizable.strings b/Linphone/Localizable/ru.lproj/Localizable.strings index 0f6b7d6f9..bd4edb2a2 100644 --- a/Linphone/Localizable/ru.lproj/Localizable.strings +++ b/Linphone/Localizable/ru.lproj/Localizable.strings @@ -187,7 +187,7 @@ "dialog_deny" = "Отказать"; "dialog_install" = "Установить"; "dialog_no" = "Нет"; -"dialog_ok" = "ОК"; +"dialog_confirm" = "ОК"; "dialog_yes" = "Да"; "drawer_menu_account_connection_status_cleared" = "Отключить"; "drawer_menu_account_connection_status_connected" = "Подключен"; diff --git a/Linphone/Localizable/sk.lproj/Localizable.strings b/Linphone/Localizable/sk.lproj/Localizable.strings index 7a04eba8f..582bba3a4 100644 --- a/Linphone/Localizable/sk.lproj/Localizable.strings +++ b/Linphone/Localizable/sk.lproj/Localizable.strings @@ -171,7 +171,7 @@ "dialog_deny" = "Odmietnuť"; "dialog_install" = "Inštalovať"; "dialog_no" = "Nie"; -"dialog_ok" = "OK"; +"dialog_confirm" = "Confirm"; "dialog_yes" = "Áno"; "meeting_waiting_room_cancel" = "Zrušiť"; "menu_delete_selected_item" = "Vymazať"; diff --git a/Linphone/Localizable/uk.lproj/Localizable.strings b/Linphone/Localizable/uk.lproj/Localizable.strings index b965bbb6f..3e7a019ab 100644 --- a/Linphone/Localizable/uk.lproj/Localizable.strings +++ b/Linphone/Localizable/uk.lproj/Localizable.strings @@ -377,7 +377,7 @@ "conversation_ephemeral_messages_duration_one_week" = "1 тиждень"; "conversation_ephemeral_messages_duration_three_days" = "3 доби"; "conversation_ephemeral_messages_duration_one_day" = "1 доба"; -"dialog_ok" = "ОК"; +"dialog_confirm" = "ОК"; "welcome_page_title" = "Ласкаво просимо"; ": %@" = ": %@"; "[https://sip.linphone.org](https://sip.linphone.org)" = "[https://sip.linphone.org](https://sip.linphone.org)"; diff --git a/Linphone/Localizable/zh-Hans.lproj/Localizable.strings b/Linphone/Localizable/zh-Hans.lproj/Localizable.strings index 853d1469c..b3b295824 100644 --- a/Linphone/Localizable/zh-Hans.lproj/Localizable.strings +++ b/Linphone/Localizable/zh-Hans.lproj/Localizable.strings @@ -181,7 +181,7 @@ "dialog_deny" = "拒绝"; "dialog_install" = "安装"; "dialog_no" = "否"; -"dialog_ok" = "OK"; +"dialog_confirm" = "Confirm"; "dialog_yes" = "是"; "drawer_menu_account_connection_status_cleared" = "禁用"; "drawer_menu_account_connection_status_connected" = "已连接"; diff --git a/Linphone/UI/Assistant/Fragments/LoginFragment.swift b/Linphone/UI/Assistant/Fragments/LoginFragment.swift index 3fde7171e..655dd638d 100644 --- a/Linphone/UI/Assistant/Fragments/LoginFragment.swift +++ b/Linphone/UI/Assistant/Fragments/LoginFragment.swift @@ -70,25 +70,33 @@ struct LoginFragment: View { let contentPopup3 = Text(.init(splitMsg[1])) let contentPopup4 = Text(.init(privacyPolicy)).underline() let contentPopup5 = Text(.init(splitMsg[2])) - PopupView(isShowPopup: $isShowPopup, - title: Text("assistant_dialog_general_terms_and_privacy_policy_title"), - content: contentPopup1 + contentPopup2 + contentPopup3 + contentPopup4 + contentPopup5, - titleFirstButton: Text("dialog_deny"), - actionFirstButton: {self.isShowPopup.toggle()}, - titleSecondButton: Text("dialog_accept"), - actionSecondButton: {acceptGeneralTerms()}) + PopupView( + isShowPopup: $isShowPopup, + title: Text("assistant_dialog_general_terms_and_privacy_policy_title"), + content: contentPopup1 + contentPopup2 + contentPopup3 + contentPopup4 + contentPopup5, + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_accept"), + actionSecondButton: { acceptGeneralTerms() }, + titleThirdButton: Text("dialog_deny"), + actionThirdButton: { self.isShowPopup.toggle() } + ) .background(.black.opacity(0.65)) .onTapGesture { self.isShowPopup.toggle() } } else { // backup just in case - PopupView(isShowPopup: $isShowPopup, - title: Text("assistant_dialog_general_terms_and_privacy_policy_title"), - content: Text(.init(String(format: String(localized: "assistant_dialog_general_terms_and_privacy_policy_message"), generalTerms, privacyPolicy))), - titleFirstButton: Text("dialog_deny"), - actionFirstButton: {self.isShowPopup.toggle()}, - titleSecondButton: Text("dialog_accept"), - actionSecondButton: {acceptGeneralTerms()}) + PopupView( + isShowPopup: $isShowPopup, + title: Text("assistant_dialog_general_terms_and_privacy_policy_title"), + content: Text(.init(String(format: String(localized: "assistant_dialog_general_terms_and_privacy_policy_message"), generalTerms, privacyPolicy))), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_accept"), + actionSecondButton: { acceptGeneralTerms() }, + titleThirdButton: Text("dialog_deny"), + actionThirdButton: { self.isShowPopup.toggle() } + ) .background(.black.opacity(0.65)) .onTapGesture { self.isShowPopup.toggle() diff --git a/Linphone/UI/Assistant/Fragments/ProfileModeFragment.swift b/Linphone/UI/Assistant/Fragments/ProfileModeFragment.swift index b5aad06a6..bfde7c666 100644 --- a/Linphone/UI/Assistant/Fragments/ProfileModeFragment.swift +++ b/Linphone/UI/Assistant/Fragments/ProfileModeFragment.swift @@ -145,20 +145,21 @@ struct ProfileModeFragment: View { } if self.isShowPopup { - PopupView(isShowPopup: $isShowPopup, - title: Text(isShowPopupForDefault ? "Default mode" : "Interoperable mode"), - content: Text( - isShowPopupForDefault - ? "Texte explicatif du default mode : lorem ipsum dolor sit amet, consectetur adipiscing elit." - + "Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula." - : "Texte explicatif du interoperable mode : lorem ipsum dolor sit amet, consectetur adipiscing elit." - + " Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula."), - titleFirstButton: nil, - actionFirstButton: {}, - titleSecondButton: Text("dialog_close"), - actionSecondButton: { - self.isShowPopup.toggle() - } + PopupView( + isShowPopup: $isShowPopup, + title: Text(isShowPopupForDefault ? "Default mode" : "Interoperable mode"), + content: Text( + isShowPopupForDefault + ? "Texte explicatif du default mode : lorem ipsum dolor sit amet, consectetur adipiscing elit." + + "Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula." + : "Texte explicatif du interoperable mode : lorem ipsum dolor sit amet, consectetur adipiscing elit." + + " Etiam velit sapien, egestas sit amet dictum eget, condimentum a ligula."), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: nil, + actionSecondButton: {}, + titleThirdButton: Text("dialog_close"), + actionThirdButton: { self.isShowPopup.toggle() } ) .background(.black.opacity(0.65)) .onTapGesture { diff --git a/Linphone/UI/Assistant/Fragments/RegisterFragment.swift b/Linphone/UI/Assistant/Fragments/RegisterFragment.swift index 69f42192e..2d5179eb7 100644 --- a/Linphone/UI/Assistant/Fragments/RegisterFragment.swift +++ b/Linphone/UI/Assistant/Fragments/RegisterFragment.swift @@ -57,22 +57,21 @@ struct RegisterFragment: View { let titlePopup = Text("assistant_dialog_confirm_phone_number_title") let contentPopup = Text(String(format: String(localized: "assistant_dialog_confirm_phone_number_message"), registerViewModel.phoneNumber)) - PopupView( isShowPopup: $isShowPopup, title: titlePopup, content: contentPopup, - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: { - self.isShowPopup = false - }, + titleFirstButton: nil, + actionFirstButton: {}, titleSecondButton: Text("dialog_continue"), actionSecondButton: { self.isShowPopup = false registerViewModel.createInProgress = true registerViewModel.startAccountCreation() registerViewModel.phoneNumberConfirmedByUser() - } + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { self.isShowPopup = false }, ) .background(.black.opacity(0.65)) .onTapGesture { diff --git a/Linphone/UI/Call/Fragments/CallsListFragment.swift b/Linphone/UI/Call/Fragments/CallsListFragment.swift index 2c670cb87..d6211a6a4 100644 --- a/Linphone/UI/Call/Fragments/CallsListFragment.swift +++ b/Linphone/UI/Call/Fragments/CallsListFragment.swift @@ -103,17 +103,21 @@ struct CallsListFragment: View { .background(.white) if self.isShowPopup { - PopupView(isShowPopup: $isShowPopup, - title: Text("calls_list_dialog_merge_into_conference_title"), - content: nil, - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: {self.isShowPopup.toggle()}, - titleSecondButton: Text("calls_list_dialog_merge_into_conference_label"), - actionSecondButton: { - callViewModel.mergeCallsIntoConference() - self.isShowPopup.toggle() - isShowCallsListFragment.toggle() - }) + PopupView( + isShowPopup: $isShowPopup, + title: Text("calls_list_dialog_merge_into_conference_title"), + content: nil, + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("calls_list_dialog_merge_into_conference_label"), + actionSecondButton: { + callViewModel.mergeCallsIntoConference() + self.isShowPopup.toggle() + isShowCallsListFragment.toggle() + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { self.isShowPopup.toggle() }, + ) .background(.black.opacity(0.65)) .onTapGesture { self.isShowPopup.toggle() diff --git a/Linphone/UI/Call/Fragments/ParticipantsListFragment.swift b/Linphone/UI/Call/Fragments/ParticipantsListFragment.swift index 756670ee5..5478a6533 100644 --- a/Linphone/UI/Call/Fragments/ParticipantsListFragment.swift +++ b/Linphone/UI/Call/Fragments/ParticipantsListFragment.swift @@ -108,17 +108,21 @@ struct ParticipantsListFragment: View { if self.isShowPopup { let contentPopup = Text(String(format: String(localized: "meeting_call_remove_participant_confirmation_message"), callViewModel.participantList[indexToRemove].name)) - PopupView(isShowPopup: $isShowPopup, - title: Text("meeting_call_remove_participant_confirmation_title"), - content: contentPopup, - titleFirstButton: Text("dialog_no"), - actionFirstButton: {self.isShowPopup.toggle()}, - titleSecondButton: Text("dialog_yes"), - actionSecondButton: { - callViewModel.removeParticipant(index: indexToRemove) - self.isShowPopup.toggle() - indexToRemove = -1 - }) + PopupView( + isShowPopup: $isShowPopup, + title: Text("meeting_call_remove_participant_confirmation_title"), + content: contentPopup, + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_yes"), + actionSecondButton: { + callViewModel.removeParticipant(index: indexToRemove) + self.isShowPopup.toggle() + indexToRemove = -1 + }, + titleThirdButton: Text("dialog_no"), + actionThirdButton: { self.isShowPopup.toggle() } + ) .background(.black.opacity(0.65)) .onTapGesture { self.isShowPopup.toggle() diff --git a/Linphone/UI/Main/ContentView.swift b/Linphone/UI/Main/ContentView.swift index 590ec4130..a2b19818a 100644 --- a/Linphone/UI/Main/ContentView.swift +++ b/Linphone/UI/Main/ContentView.swift @@ -1111,14 +1111,16 @@ struct ContentView: View { ) ), content: Text("contact_dialog_delete_message"), - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: { - self.isShowDeleteContactPopup.toggle()}, - titleSecondButton: Text("dialog_ok"), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_confirm"), actionSecondButton: { contactsListVM.deleteSelectedContact() self.isShowDeleteContactPopup.toggle() - }) + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { self.isShowDeleteContactPopup.toggle() } + ) .background(.black.opacity(0.65)) .zIndex(3) .onTapGesture { @@ -1130,27 +1132,31 @@ struct ContentView: View { } if isShowDeleteAllHistoryPopup { - PopupView(isShowPopup: $isShowDeleteContactPopup, - title: Text("history_dialog_delete_all_call_logs_title"), - content: Text("history_dialog_delete_all_call_logs_message"), - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: { - self.isShowDeleteAllHistoryPopup.toggle() - if let historyListVM = historyListViewModel { - historyListVM.callLogsAddressToDelete = "" + PopupView( + isShowPopup: $isShowDeleteContactPopup, + title: Text("history_dialog_delete_all_call_logs_title"), + content: Text("history_dialog_delete_all_call_logs_message"), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_confirm"), + actionSecondButton: { + if let historyListVM = historyListViewModel { + historyListVM.removeCallLogs() + } + self.isShowDeleteAllHistoryPopup.toggle() + sharedMainViewModel.displayedCall = nil + + ToastViewModel.shared.toastMessage = "Success_remove_call_logs" + ToastViewModel.shared.displayToast.toggle() + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { + self.isShowDeleteAllHistoryPopup.toggle() + if let historyListVM = historyListViewModel { + historyListVM.callLogsAddressToDelete = "" + } } - }, - titleSecondButton: Text("dialog_ok"), - actionSecondButton: { - if let historyListVM = historyListViewModel { - historyListVM.removeCallLogs() - } - self.isShowDeleteAllHistoryPopup.toggle() - sharedMainViewModel.displayedCall = nil - - ToastViewModel.shared.toastMessage = "Success_remove_call_logs" - ToastViewModel.shared.displayToast.toggle() - }) + ) .background(.black.opacity(0.65)) .zIndex(3) .onTapGesture { @@ -1159,20 +1165,24 @@ struct ContentView: View { } if isShowDismissPopup { - PopupView(isShowPopup: $isShowDismissPopup, - title: Text("contact_editor_dialog_abort_confirmation_title"), - content: Text("contact_editor_dialog_abort_confirmation_message"), - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: {self.isShowDismissPopup.toggle()}, - titleSecondButton: Text("dialog_ok"), - actionSecondButton: { - self.isShowDismissPopup.toggle() - if isShowEditContactFragment { - isShowEditContactFragment = false - } else { - isShowEditContactFragmentInContactDetails = false - } - }) + PopupView( + isShowPopup: $isShowDismissPopup, + title: Text("contact_editor_dialog_abort_confirmation_title"), + content: Text("contact_editor_dialog_abort_confirmation_message"), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_confirm"), + actionSecondButton: { + self.isShowDismissPopup.toggle() + if isShowEditContactFragment { + isShowEditContactFragment = false + } else { + isShowEditContactFragmentInContactDetails = false + } + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { self.isShowDismissPopup.toggle() } + ) .background(.black.opacity(0.65)) .zIndex(3) .onTapGesture { @@ -1294,21 +1304,25 @@ struct ContentView: View { } if let meetingsListVM = meetingsListViewModel, isShowSendCancelMeetingNotificationPopup { - PopupView(isShowPopup: $isShowSendCancelMeetingNotificationPopup, - title: Text("meeting_schedule_cancel_dialog_title"), - content: !sharedMainViewModel.disableChatFeature ? Text("meeting_schedule_cancel_dialog_message") : Text(""), - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: { - sharedMainViewModel.displayedMeeting = nil - meetingsListVM.deleteSelectedMeeting() - self.isShowSendCancelMeetingNotificationPopup.toggle( - ) }, - titleSecondButton: Text("dialog_ok"), - actionSecondButton: { - sharedMainViewModel.displayedMeeting = nil - meetingsListVM.cancelMeetingWithNotifications() - self.isShowSendCancelMeetingNotificationPopup.toggle() - }) + PopupView( + isShowPopup: $isShowSendCancelMeetingNotificationPopup, + title: Text("meeting_schedule_cancel_dialog_title"), + content: !sharedMainViewModel.disableChatFeature ? Text("meeting_schedule_cancel_dialog_message") : Text(""), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_confirm"), + actionSecondButton: { + sharedMainViewModel.displayedMeeting = nil + meetingsListVM.cancelMeetingWithNotifications() + self.isShowSendCancelMeetingNotificationPopup.toggle() + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { + sharedMainViewModel.displayedMeeting = nil + meetingsListVM.deleteSelectedMeeting() + self.isShowSendCancelMeetingNotificationPopup.toggle() + } + ) .background(.black.opacity(0.65)) .zIndex(3) .onTapGesture { @@ -1321,17 +1335,17 @@ struct ContentView: View { isShowPopup: $isShowStartCallGroupPopup, title: Text("conversation_info_confirm_start_group_call_dialog_title"), content: Text("conversation_info_confirm_start_group_call_dialog_message"), - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: { - self.isShowStartCallGroupPopup.toggle() - }, - titleSecondButton: Text("dialog_ok"), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_confirm"), actionSecondButton: { if sharedMainViewModel.displayedConversation != nil { sharedMainViewModel.displayedConversation!.createGroupCall() } self.isShowStartCallGroupPopup.toggle() - } + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { self.isShowStartCallGroupPopup.toggle() } ) .background(.black.opacity(0.65)) .zIndex(3) @@ -1340,6 +1354,32 @@ struct ContentView: View { } } + /* + if isShowStartCallGroupPopup { + PopupView( + isShowPopup: $isShowStartCallGroupPopup, + title: Text("conversation_info_confirm_start_group_call_dialog_title"), + content: Text("conversation_info_confirm_start_group_call_dialog_message"), + titleFirstButton: Text("dialog_cancel"), + actionFirstButton: { self.isShowStartCallGroupPopup.toggle() }, + titleSecondButton: Text("dialog_confirm"), + actionSecondButton: { + if sharedMainViewModel.displayedConversation != nil { + sharedMainViewModel.displayedConversation!.createGroupCall() + } + self.isShowStartCallGroupPopup.toggle() + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { self.isShowStartCallGroupPopup.toggle() } + ) + .background(.black.opacity(0.65)) + .zIndex(3) + .onTapGesture { + self.isShowStartCallGroupPopup.toggle() + } + } + */ + if isShowConversationInfoPopup { PopupViewWithTextField( isShowConversationInfoPopup: $isShowConversationInfoPopup, diff --git a/Linphone/UI/Main/Conversations/Fragments/StartGroupConversationFragment.swift b/Linphone/UI/Main/Conversations/Fragments/StartGroupConversationFragment.swift index 1edbaf478..6963e60c3 100644 --- a/Linphone/UI/Main/Conversations/Fragments/StartGroupConversationFragment.swift +++ b/Linphone/UI/Main/Conversations/Fragments/StartGroupConversationFragment.swift @@ -111,7 +111,7 @@ struct StartGroupConversationFragment: View { Button(action: { startConversationViewModel.createGroupChatRoom() }, label: { - Text("dialog_ok") + Text("dialog_confirm") .default_text_style_white_600(styleSize: 20) .frame(height: 35) .frame(maxWidth: .infinity) diff --git a/Linphone/UI/Main/Fragments/PopupUpdatePassword.swift b/Linphone/UI/Main/Fragments/PopupUpdatePassword.swift index d7ca7d013..d61e153d6 100644 --- a/Linphone/UI/Main/Fragments/PopupUpdatePassword.swift +++ b/Linphone/UI/Main/Fragments/PopupUpdatePassword.swift @@ -105,7 +105,7 @@ struct PopupUpdatePassword: View { updateAuthInfo() isShowUpdatePasswordPopup = false }, label: { - Text("dialog_ok") + Text("dialog_confirm") .default_text_style_white_600(styleSize: 20) .frame(height: 35) .frame(maxWidth: .infinity) diff --git a/Linphone/UI/Main/Fragments/PopupView.swift b/Linphone/UI/Main/Fragments/PopupView.swift index a1bd4ac5a..784ed58ef 100644 --- a/Linphone/UI/Main/Fragments/PopupView.swift +++ b/Linphone/UI/Main/Fragments/PopupView.swift @@ -34,6 +34,9 @@ struct PopupView: View { var titleSecondButton: Text? var actionSecondButton: () -> Void + var titleThirdButton: Text? + var actionThirdButton: () -> Void + var body: some View { GeometryReader { geometry in VStack(alignment: .leading) { @@ -49,40 +52,57 @@ struct PopupView: View { .padding(.bottom, 20) } - if titleFirstButton != nil { - Button(action: { - actionFirstButton() - }, label: { - titleFirstButton - .default_text_style_orange_600(styleSize: 20) - .frame(height: 35) - .frame(maxWidth: .infinity) - }) - .padding(.horizontal, 20) - .padding(.vertical, 10) - .cornerRadius(60) - .overlay( - RoundedRectangle(cornerRadius: 60) - .inset(by: 0.5) - .stroke(Color.orangeMain500, lineWidth: 1) - ) - .padding(.bottom, 10) - } - - if titleSecondButton != nil { - Button(action: { - actionSecondButton() - }, label: { - titleSecondButton - .default_text_style_white_600(styleSize: 20) - .frame(height: 35) - .frame(maxWidth: .infinity) - }) - .padding(.horizontal, 20) - .padding(.vertical, 10) - .background(Color.orangeMain500) - .cornerRadius(60) + HStack { + if titleFirstButton != nil { + Button(action: { + actionFirstButton() + }, label: { + titleFirstButton + .default_text_style_white_600(styleSize: 14) + .frame(height: 30) + }) + .padding(.horizontal, 20) + .padding(.vertical, 10) + .background(Color.orangeMain500) + .cornerRadius(60) + .padding(.horizontal, 2) + } + + if titleSecondButton != nil { + Button(action: { + actionSecondButton() + }, label: { + titleSecondButton + .default_text_style_white_600(styleSize: 14) + .frame(height: 30) + }) + .padding(.horizontal, 20) + .padding(.vertical, 10) + .background(Color.orangeMain500) + .cornerRadius(60) + .padding(.horizontal, 2) + } + + if titleThirdButton != nil { + Button(action: { + actionThirdButton() + }, label: { + titleThirdButton + .default_text_style_orange_600(styleSize: 14) + .frame(height: 30) + }) + .padding(.horizontal, 20) + .padding(.vertical, 10) + .cornerRadius(60) + .overlay( + RoundedRectangle(cornerRadius: 60) + .inset(by: 0.5) + .stroke(Color.orangeMain500, lineWidth: 1) + ) + .padding(.horizontal, 2) + } } + .frame(maxWidth: .infinity, alignment: .trailing) } .padding(.horizontal, 20) .padding(.vertical, 20) @@ -101,9 +121,11 @@ struct PopupView: View { PopupView(isShowPopup: .constant(true), title: Text("Title"), content: Text("Content"), - titleFirstButton: Text("Deny all"), + titleFirstButton: Text("Accept all"), actionFirstButton: {}, - titleSecondButton: Text("Accept all"), - actionSecondButton: {}) + titleSecondButton: Text("dialog_confirm"), + actionSecondButton: {}, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: {}) .background(.black.opacity(0.65)) } diff --git a/Linphone/UI/Main/Fragments/PopupViewWithTextField.swift b/Linphone/UI/Main/Fragments/PopupViewWithTextField.swift index 58d22c217..7f8f58bfc 100644 --- a/Linphone/UI/Main/Fragments/PopupViewWithTextField.swift +++ b/Linphone/UI/Main/Fragments/PopupViewWithTextField.swift @@ -72,7 +72,7 @@ struct PopupViewWithTextField: View { setNewChatRoomSubject() isShowConversationInfoPopup = false }, label: { - Text("dialog_ok") + Text("dialog_confirm") .default_text_style_white_600(styleSize: 20) .frame(height: 35) .frame(maxWidth: .infinity) diff --git a/Linphone/UI/Main/Help/Fragments/HelpFragment.swift b/Linphone/UI/Main/Help/Fragments/HelpFragment.swift index 18c55d618..052dc0103 100644 --- a/Linphone/UI/Main/Help/Fragments/HelpFragment.swift +++ b/Linphone/UI/Main/Help/Fragments/HelpFragment.swift @@ -306,17 +306,17 @@ struct HelpFragment: View { isShowPopup: $helpViewModel.checkUpdateAvailable, title: Text("help_dialog_update_available_title"), content: Text(String(format: String(localized: "help_dialog_update_available_message"), helpViewModel.versionAvailable)), - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: { - helpViewModel.checkUpdateAvailable = false - }, + titleFirstButton: nil, + actionFirstButton: {}, titleSecondButton: Text("dialog_install"), actionSecondButton: { helpViewModel.checkUpdateAvailable = false if let url = URL(string: helpViewModel.urlVersionAvailable) { UIApplication.shared.open(url) } - } + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { helpViewModel.checkUpdateAvailable = false } ) .background(.black.opacity(0.65)) .zIndex(3) diff --git a/Linphone/UI/Main/Meetings/Fragments/ScheduleMeetingFragment.swift b/Linphone/UI/Main/Meetings/Fragments/ScheduleMeetingFragment.swift index f5c9d53f8..41db8fc3e 100644 --- a/Linphone/UI/Main/Meetings/Fragments/ScheduleMeetingFragment.swift +++ b/Linphone/UI/Main/Meetings/Fragments/ScheduleMeetingFragment.swift @@ -468,7 +468,7 @@ struct ScheduleMeetingFragment: View { showDatePicker.toggle() } } - Text("dialog_ok") + Text("dialog_confirm") .default_text_style_orange_500(styleSize: 16) .onTapGesture { pickDate() diff --git a/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift b/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift index 2485681a0..90d4fbd6b 100644 --- a/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift +++ b/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift @@ -606,15 +606,16 @@ struct AccountProfileFragment: View { .background(Color.gray100) if self.isShowPopup { - PopupView(isShowPopup: $isShowPopup, + PopupView( + isShowPopup: $isShowPopup, title: Text("manage_account_international_prefix"), content: Text("manage_account_dialog_international_prefix_help_message"), titleFirstButton: nil, actionFirstButton: {}, - titleSecondButton: Text("dialog_ok"), - actionSecondButton: { - self.isShowPopup.toggle() - } + titleSecondButton: Text("dialog_confirm"), + actionSecondButton: { self.isShowPopup.toggle() }, + titleThirdButton: nil, + actionThirdButton: {} ) .background(.black.opacity(0.65)) .onTapGesture { @@ -635,10 +636,8 @@ struct AccountProfileFragment: View { isShowPopup: $isShowLogoutPopup, title: Text("manage_account_dialog_remove_account_title"), content: contentPopup1 + contentPopup2, - titleFirstButton: Text("dialog_cancel"), - actionFirstButton: { - self.isShowLogoutPopup.toggle() - }, + titleFirstButton: nil, + actionFirstButton: {}, titleSecondButton: Text("manage_account_delete"), actionSecondButton: { if accountProfileViewModel.accountModelIndex != nil { @@ -650,7 +649,9 @@ struct AccountProfileFragment: View { } } } - } + }, + titleThirdButton: Text("dialog_cancel"), + actionThirdButton: { self.isShowLogoutPopup.toggle() } ) .background(.black.opacity(0.65)) .onTapGesture {