Add CustomAlertController and functions called in alertController (Start group call and go to Device list view)

This commit is contained in:
Benoit Martins 2022-12-19 13:40:32 +01:00 committed by QuentinArguillere
parent 06cf997eb5
commit b57ae83662
4 changed files with 64 additions and 7 deletions

View file

@ -1429,11 +1429,4 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll
chatRoomSwift.markAsRead()
PhoneMainView.instance().updateApplicationBadgeNumber()
}
=======
menu.selectionAction = { index, title in
print("index \(index) and \(title)")
}
}
>>>>>>> 7c8c2cf81 (Add DropDown menu)
}

View file

@ -318,6 +318,7 @@ class BackActionsNavigationView: UIViewController {
topBar.backgroundColor = VoipTheme.voipToolbarBackgroundColor.get()
}
<<<<<<< HEAD
deinit {
NotificationCenter.default.removeObserver(self)
}
@ -330,6 +331,25 @@ class BackActionsNavigationView: UIViewController {
constraintLandscapeFloatingButton!.isActive = false
constraintFloatingButton!.isActive = true
}
=======
func alertAction() {
let alertController = CustomAlertController(title: VoipTexts.alert_dialog_secure_badge_button_chat_conversation_title, message: nil, preferredStyle: .alert)
alertController.setBackgroundColor(color: .darkGray)
alertController.setTitle(font: nil, color: .white)
alertController.setTint(color: .white)
alertController.setMaxWidth(alert: alertController)
alertController.addButtonsAlertController(alertController: alertController, buttonsViewHeightV: 60, checkboxViewHeightV: 50, buttonsAlertHeightV: 40)
self.present(alertController, animated: true, completion:{
alertController.view.superview?.isUserInteractionEnabled = true
alertController.view.superview?.subviews[0].addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dismissOnTapOutsideOrCancel)))
})
alertController.ok_button_alert.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.onTapOk)))
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
}
func changeTitle(titleString: String){
@ -347,10 +367,15 @@ class BackActionsNavigationView: UIViewController {
}
}
<<<<<<< HEAD
func changeCallIcon(groupChat: Bool){
isGroupChat = groupChat
let defaultAccount = Core.getSwiftObject(cObject: LinphoneManager.getLc()).defaultAccount
if(groupChat && (defaultAccount != nil) && (defaultAccount!.params!.audioVideoConferenceFactoryAddress != nil)){
=======
func changeCallIcon(groupeChat: Bool){
if(groupeChat){
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
action1Button.isHidden = true
action1BisButton.isHidden = false
}else if(groupChat){
@ -362,6 +387,7 @@ class BackActionsNavigationView: UIViewController {
}
}
<<<<<<< HEAD
func editModeOn(){
backButton.isHidden = true
cancelButton.isHidden = false
@ -398,5 +424,13 @@ class BackActionsNavigationView: UIViewController {
func deleteSelected(){
=======
@objc func dismissOnTapOutsideOrCancel(){
self.dismiss(animated: true, completion: nil)
}
@objc func onTapOk(){
self.dismiss(animated: true, completion: nil)
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
}
}

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
/*
* Copyright (c) 2010-2020 Belledonne Communications SARL.
*
@ -16,6 +17,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
=======
//
// CustomAlertController.swift
// linphone
//
// Created by Benoît Martins on 19/12/2022.
//
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
import Foundation
@ -27,6 +36,13 @@ class CustomAlertController: UIAlertController {
var isChecked = false
let checkBoxText = UILabel()
<<<<<<< HEAD
=======
var isSecure : Bool = false
let isGroupChat : Bool = false
let levelMaxSecure : Bool = false
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
@objc func dismissOnTapOutsideOrCancel(){
self.dismiss(animated: true, completion: nil)
}
@ -35,7 +51,11 @@ class CustomAlertController: UIAlertController {
self.dismiss(animated: true, completion: nil)
}
<<<<<<< HEAD
@objc func changeCheckValue(){
=======
@objc func switchCheckedValue(){
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
isChecked = !isChecked
checkBoxButton.isSelected = isChecked
}
@ -83,7 +103,11 @@ class CustomAlertController: UIAlertController {
checkBoxButton.setImage(UIImage(named:"checkbox_unchecked.png"), for: .normal)
checkBoxButton.setImage(UIImage(named:"checkbox_checked.png"), for: .selected)
<<<<<<< HEAD
checkBoxButton.addTarget(self, action: #selector(changeCheckValue), for: .touchUpInside)
=======
checkBoxButton.addTarget(self, action: #selector(switchCheckedValue), for: .touchUpInside)
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
checkboxView.addSubview(checkBoxButton)
checkBoxText.text = VoipTexts.alert_dialog_secure_badge_button_chat_conversation_checkboxtext
@ -93,6 +117,7 @@ class CustomAlertController: UIAlertController {
checkBoxText.sizeToFit()
}
}
<<<<<<< HEAD
func setBackgroundColor(color: UIColor) {
if let bgView = self.view.subviews.first, let groupView = bgView.subviews.first, let contentView = groupView.subviews.first {
@ -169,4 +194,6 @@ class CustomAlertController: UIAlertController {
func setTint(color: UIColor) {
self.view.tintColor = color
}
=======
>>>>>>> 8f0096967 (Add CustomAlertController and functions called in alertController (Start group call and go to Device list view))
}

View file

@ -962,6 +962,7 @@
D7421D9E29228A5200290CAB /* DetailChatRoomFragment.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7421D9D29228A5200290CAB /* DetailChatRoomFragment.swift */; };
D74A44912923BAF90017D063 /* BackActionsNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D74A44902923BAF90017D063 /* BackActionsNavigationView.swift */; };
D77057F1292E4A340031A970 /* ChatConversationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77057F0292E4A340031A970 /* ChatConversationViewModel.swift */; };
D7A7545029507038005C9D4A /* CustomAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7A7544F29507038005C9D4A /* CustomAlertController.swift */; };
D7C6DE7D2947331A00756E03 /* UIAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7C6DE7C2947331A00756E03 /* UIAlertController.swift */; };
D7C6DE832948CF3100756E03 /* DropDownCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7C6DE812948CF3100756E03 /* DropDownCell.swift */; };
D7C6DE842948CF3100756E03 /* DropDownCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D7C6DE822948CF3100756E03 /* DropDownCell.xib */; };
@ -2215,6 +2216,7 @@
D7421D9D29228A5200290CAB /* DetailChatRoomFragment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailChatRoomFragment.swift; sourceTree = "<group>"; };
D74A44902923BAF90017D063 /* BackActionsNavigationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackActionsNavigationView.swift; sourceTree = "<group>"; };
D77057F0292E4A340031A970 /* ChatConversationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatConversationViewModel.swift; sourceTree = "<group>"; };
D7A7544F29507038005C9D4A /* CustomAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAlertController.swift; sourceTree = "<group>"; };
D7C6DE7C2947331A00756E03 /* UIAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIAlertController.swift; sourceTree = "<group>"; };
D7C6DE812948CF3100756E03 /* DropDownCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropDownCell.swift; sourceTree = "<group>"; };
D7C6DE822948CF3100756E03 /* DropDownCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DropDownCell.xib; sourceTree = "<group>"; };
@ -3488,6 +3490,7 @@
D779D39D29AC9E92007B8087 /* AudioPlayer.swift */,
D779D3A129B5E365007B8087 /* UIImageExtension.swift */,
D7C6DE7C2947331A00756E03 /* UIAlertController.swift */,
D7A7544F29507038005C9D4A /* CustomAlertController.swift */,
);
path = Util;
sourceTree = "<group>";