add ephemeral indicator in messageview

This commit is contained in:
Benoit Martins 2023-01-02 10:07:58 +01:00 committed by QuentinArguillere
parent 6e6ed5bb98
commit 7725dd2307
2 changed files with 10 additions and 0 deletions

View file

@ -152,6 +152,7 @@ import DropDown
override func viewDidAppear(_ animated: Bool) {
tableController.reloadData()
messageView.ephemeralIndicator.isHidden = (linphone_chat_room_ephemeral_enabled(chatRoom?.getCobject) == 0)
}
func goBackChatListView() {
@ -330,6 +331,8 @@ import DropDown
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_unmute_notifications)
}
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_delete_messages)
messageView.ephemeralIndicator.isHidden = (linphone_chat_room_ephemeral_enabled(chatRoom?.getCobject) == 0)
}
@objc func initChatRoom(cChatRoom:OpaquePointer) {

View file

@ -38,6 +38,8 @@ class MessageView: UIView, PHPickerViewControllerDelegate, UIDocumentPickerDele
let sendButton = CallControlButton(buttonTheme:VoipTheme.nav_button(""))
let messageTextView = UIView()
let messageText = UITextView()
let ephemeralIndicator = UIImageView(image: UIImage(named: "ephemeral_messages_color_A.png"))
let mediaSelector = UIView()
override init(frame: CGRect) {
super.init(frame: frame)
@ -63,6 +65,11 @@ class MessageView: UIView, PHPickerViewControllerDelegate, UIDocumentPickerDele
voiceRecordButton.size(w: 30, h: 30).done()
voiceRecordButton.onClickAction = action3
addSubview(ephemeralIndicator)
ephemeralIndicator.alignParentRight(withMargin: 4).alignParentTop(withMargin: 4).size(w: 9, h: 10).done()
ephemeralIndicator.isHidden = true
addSubview(sendButton)
sendButton.alignParentRight(withMargin: side_buttons_margin).matchParentHeight().done()
sendButton.setImage(UIImage(named:"chat_send_default.png"), for: .normal)