Fix Reply Bubble Chat (UI and add click)

This commit is contained in:
Benoit Martins 2023-03-10 17:28:30 +01:00 committed by QuentinArguillere
parent 63d05e5fe5
commit 5e6e302fd1
5 changed files with 35 additions and 34 deletions

View file

@ -94,8 +94,15 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
if let message = ChatConversationTableViewModel.sharedModel.getMessage(index: indexPath.row){
cell.configure(message: message, isBasic: basic)
if !cell.replyContent.isHidden {
cell.replyContent.onClick {
print("ChatConversationTableViewSwift collectionview cellForItemAt click \(linphone_chat_message_get_reply_message(message.getCobject))")
}
}
}
cell.contentView.transform = CGAffineTransform(scaleX: 1, y: -1)
return cell
}

View file

@ -146,14 +146,12 @@ class MultilineMessageCell: UICollectionViewCell, UICollectionViewDataSource, UI
forwardView.topAnchor.constraint(equalTo: preContentViewBubble.topAnchor, constant: 0),
forwardView.bottomAnchor.constraint(equalTo: preContentViewBubble.bottomAnchor, constant: 0),
forwardView.leadingAnchor.constraint(equalTo: preContentViewBubble.leadingAnchor, constant: 0),
forwardView.trailingAnchor.constraint(equalTo: preContentViewBubble.trailingAnchor, constant: 0),
forwardIcon.topAnchor.constraint(equalTo: preContentViewBubble.topAnchor, constant: 6),
forwardIcon.leadingAnchor.constraint(equalTo: preContentViewBubble.leadingAnchor, constant: 6),
forwardLabel.topAnchor.constraint(equalTo: preContentViewBubble.topAnchor, constant: 6),
forwardLabel.leadingAnchor.constraint(equalTo: preContentViewBubble.leadingAnchor, constant: 20),
forwardLabel.trailingAnchor.constraint(equalTo: preContentViewBubble.trailingAnchor, constant: 0)
forwardLabel.leadingAnchor.constraint(equalTo: preContentViewBubble.leadingAnchor, constant: 20)
]
forwardView.isHidden = true
@ -169,7 +167,6 @@ class MultilineMessageCell: UICollectionViewCell, UICollectionViewDataSource, UI
replyLabel.size(w: 90, h: 10).done()
preContentViewBubble.addSubview(replyContent)
//replyContent.maxHeight(100).done()
replyContent.minWidth(200).done()
replyContent.layer.cornerRadius = 5
replyContent.clipsToBounds = true
@ -464,9 +461,8 @@ class MultilineMessageCell: UICollectionViewCell, UICollectionViewDataSource, UI
let isIcal = ICSBubbleView.isConferenceInvitationMessage(cmessage: (message.replyMessage?.getCobject)!)
let content : String? = (isIcal ? ICSBubbleView.getSubjectFromContent(cmessage: (message.replyMessage?.getCobject)!) : ChatMessage.getSwiftObject(cObject: (message.replyMessage?.getCobject)!).utf8Text)
let contentList = linphone_chat_message_get_contents(message.replyMessage?.getCobject)
//replyLabelTextView.text = message.replyMessage!.fromAddress?.displayName
let fromAdress = FastAddressBook.displayName(for: message.replyMessage!.fromAddress?.getCobject)
replyLabelTextView.text = String.localizedStringWithFormat(NSLocalizedString("%@", comment: ""), fromAdress!)
let fromAddress = FastAddressBook.displayName(for: message.replyMessage!.fromAddress?.getCobject)
replyLabelTextView.text = String.localizedStringWithFormat(NSLocalizedString("%@", comment: ""), fromAddress!)
replyContentTextView.text = content
replyContentForMeetingTextView.text = content
@ -516,7 +512,7 @@ class MultilineMessageCell: UICollectionViewCell, UICollectionViewDataSource, UI
if(isIcal){
let icsBubbleView = ICSBubbleView.init()
icsBubbleView.setFromChatMessageSwift(message: message)
icsBubbleView.setFromChatMessage(cmessage: message.getCobject!)
meetingView.addSubview(icsBubbleView)
icsBubbleView.size(w: 280, h: 200).done()

View file

@ -85,25 +85,23 @@ class ScheduledConferenceData {
}
private func computeParticipantsLists() {
//participantsShort.value = conferenceInfo.participants.map {(participant) in
// String(describing: participant.addressBookEnhancedDisplayName())
//}.joined(separator: ", ")
participantsShort.value = conferenceInfo.participants.map {(participant) in
String(describing: participant.addressBookEnhancedDisplayName())
}.joined(separator: ", ")
if (participantsShort.value?.count == 0) {
participantsShort.value = " "
}
//participantsExpanded.value = conferenceInfo.participants.map {(participant) in
// String(describing: participant.addressBookEnhancedDisplayName())+" ("+String(describing: participant.asStringUriOnly())+")"
//}.joined(separator: "\n")
participantsExpanded.value = conferenceInfo.participants.map {(participant) in
String(describing: participant.addressBookEnhancedDisplayName())+" ("+String(describing: participant.asStringUriOnly())+")"
}.joined(separator: "\n")
}
func gotoAssociatedChat() {
}
func deleteConference() {
conferenceSchedulerDelegate = ConferenceSchedulerDelegateStub(
onStateChanged: { scheduler, state in

View file

@ -53,7 +53,7 @@ import EventKitUI
didSet {
if let data = conferenceData {
subject.text = data.subject.value
participants.text = VoipTexts.conference_invite_participants_count.replacingOccurrences(of: "%d", with: "0")//String(data.conferenceInfo.participants.count+1))
participants.text = VoipTexts.conference_invite_participants_count.replacingOccurrences(of: "%d", with: String(data.conferenceInfo.participants.count+1))
participants.addIndicatorIcon(iconName: "conference_schedule_participants_default",padding : 0.0, y: -indicator_y, trailing: false)
date.text = TimestampUtils.dateToString(date: data.rawDate)
date.addIndicatorIcon(iconName: "conference_schedule_calendar_default", padding: 0.0, y:-indicator_y, trailing:false)
@ -162,16 +162,6 @@ import EventKitUI
}
}
}
func setFromChatMessageSwift(message: ChatMessage) {
message.contents.forEach { content in
if (content.isIcalendar) {
if let conferenceInfo = try? Factory.Instance.createConferenceInfoFromIcalendarContent(content: content) {
self.conferenceData = ScheduledConferenceData(conferenceInfo: conferenceInfo)
}
}
}
}
@objc static func isConferenceInvitationMessage(cmessage: OpaquePointer) -> Bool {
var isConferenceInvitationMessage = false
let message = ChatMessage.getSwiftObject(cObject: cmessage)

View file

@ -4901,13 +4901,11 @@
"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
"${BUILT_PRODUCTS_DIR}/linphone-sdk/linphonesw.framework",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/bctoolbox-ios.framework/bctoolbox-ios",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/bctoolbox-tester.framework/bctoolbox-tester",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/bctoolbox.framework/bctoolbox",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/belcard.framework/belcard",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/belle-sip.framework/belle-sip",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/belr.framework/belr",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/lime.framework/lime",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/limetester.framework/limetester",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/linphone.framework/linphone",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/linphonetester.framework/linphonetester",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/mediastreamer2.framework/mediastreamer2",
@ -4920,13 +4918,11 @@
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/ortp.framework/ortp",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/ZXing.framework/ZXing",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/bctoolbox-ios.framework/bctoolbox-ios",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/bctoolbox-tester.framework/bctoolbox-tester",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/bctoolbox.framework/bctoolbox",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/belcard.framework/belcard",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/belle-sip.framework/belle-sip",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/belr.framework/belr",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/lime.framework/lime",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/limetester.framework/limetester",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/linphone.framework/linphone",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/linphonetester.framework/linphonetester",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/linphone-sdk/all-frameworks/mediastreamer2.framework/mediastreamer2",
@ -4962,13 +4958,11 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/linphonesw.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/bctoolbox-ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/bctoolbox-tester.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/bctoolbox.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/belcard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/belle-sip.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/belr.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/lime.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/limetester.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/linphone.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/linphonetester.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/mediastreamer2.framework",
@ -5919,7 +5913,11 @@
"-DENABLE_QRCODE=TRUE",
"-DENABLE_SMS_INVITE=TRUE",
"$(inherited)",
<<<<<<< HEAD
"-DLINPHONE_SDK_VERSION=\\\"5.2.46-pre.1+faef54e3b\\\"",
=======
"-DLINPHONE_SDK_VERSION=\\\"5.2.22\\\"",
>>>>>>> bc1cd082e (Fix Reply Bubble Chat (UI and add click))
);
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
@ -6045,7 +6043,11 @@
"-DENABLE_QRCODE=TRUE",
"-DENABLE_SMS_INVITE=TRUE",
"$(inherited)",
<<<<<<< HEAD
"-DLINPHONE_SDK_VERSION=\\\"5.2.46-pre.1+faef54e3b\\\"",
=======
"-DLINPHONE_SDK_VERSION=\\\"5.2.22\\\"",
>>>>>>> bc1cd082e (Fix Reply Bubble Chat (UI and add click))
);
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
@ -6170,7 +6172,11 @@
"-DENABLE_QRCODE=TRUE",
"-DENABLE_SMS_INVITE=TRUE",
"$(inherited)",
<<<<<<< HEAD
"-DLINPHONE_SDK_VERSION=\\\"5.2.46-pre.1+faef54e3b\\\"",
=======
"-DLINPHONE_SDK_VERSION=\\\"5.2.22\\\"",
>>>>>>> bc1cd082e (Fix Reply Bubble Chat (UI and add click))
);
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
@ -6294,7 +6300,11 @@
"-DENABLE_QRCODE=TRUE",
"-DENABLE_SMS_INVITE=TRUE",
"$(inherited)",
<<<<<<< HEAD
"-DLINPHONE_SDK_VERSION=\\\"5.2.46-pre.1+faef54e3b\\\"",
=======
"-DLINPHONE_SDK_VERSION=\\\"5.2.22\\\"",
>>>>>>> bc1cd082e (Fix Reply Bubble Chat (UI and add click))
);
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;