ICS Reply

This commit is contained in:
Christophe Deschamps 2022-07-11 23:42:52 +02:00
parent 16a46d94dd
commit 368d6fa90a
6 changed files with 28 additions and 4 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@ -13,6 +13,7 @@
<connections>
<outlet property="contentCollection" destination="ZgY-Ye-8DD" id="hlD-Fw-g1z"/>
<outlet property="dismissButton" destination="KrT-j6-YOy" id="K5m-Mw-Cjx"/>
<outlet property="icsIcon" destination="gkH-jk-DYU" id="Xkl-Ip-skO"/>
<outlet property="leftBar" destination="Iov-AL-8Xz" id="eKb-4B-unZ"/>
<outlet property="originalMessageGone" destination="B26-sw-o4w" id="Gwh-dh-GRN"/>
<outlet property="senderName" destination="uuW-tW-1Sj" id="Yao-6A-SBh"/>
@ -68,6 +69,10 @@
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<state key="normal" image="reply_cancel.png"/>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="voip_meeting_schedule.png" translatesAutoresizingMaskIntoConstraints="NO" id="gkH-jk-DYU">
<rect key="frame" x="16" y="23" width="35" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
@ -77,6 +82,7 @@
</objects>
<resources>
<image name="reply_cancel.png" width="60" height="60"/>
<image name="voip_meeting_schedule.png" width="20" height="20"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>

View file

@ -33,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UICollectionView *contentCollection;
@property NSArray *dataContent;
@property (weak, nonatomic) IBOutlet UILabel *originalMessageGone;
@property (weak, nonatomic) IBOutlet UIImageView *icsIcon;
-(void) configureForMessage:(LinphoneChatMessage *)message withDimissBlock:(void (^)(void))dismissBlock hideDismiss:(BOOL)hideDismiss withClickBlock:(void (^)(void))clickBlock;
@end

View file

@ -40,6 +40,7 @@
-(void) viewDidLoad {
_contentCollection.dataSource = self;
[_icsIcon setImageNamed:@"voip_meeting_schedule" tintColor:VoipTheme.voip_dark_gray];
[_contentCollection registerClass:UICollectionViewCell.class forCellWithReuseIdentifier:@"dataContent"];
}
@ -51,6 +52,7 @@
_contentCollection.hidden = true;
_senderName.hidden = true;
_originalMessageGone.hidden = false;
_icsIcon.hidden = true;
return;
}
if (hideDismiss) {
@ -60,9 +62,12 @@
_originalMessageGone.hidden = true;
self.message = message;
self.dataContent = [self loadDataContent];
BOOL isIcal = [ICSBubbleView isConferenceInvitationMessageWithCmessage:message];
_icsIcon.hidden = !isIcal;
NSString *sender = [FastAddressBook displayNameForAddress:linphone_chat_message_get_from_address(message)];
_senderName.text = sender;
const char * text = linphone_chat_message_get_text_content(message);
const char * text = isIcal ? [ICSBubbleView getSubjectFromContentWithCmessage:message].UTF8String : linphone_chat_message_get_text_content(message);
if (text && strlen(text) == 0)
text = nil;
_textContent.text = text ? [NSString stringWithUTF8String:text] : @"";

View file

@ -169,5 +169,17 @@ import EventKitUI
controller.dismiss(animated: true, completion: nil)
}
@objc static func getSubjectFromContent(cmessage: OpaquePointer) -> String {
let message = ChatMessage.getSwiftObject(cObject: cmessage)
var subject = ""
message.contents.forEach { content in
if (content.isIcalendar) {
if let conferenceInfo = try? Factory.Instance.createConferenceInfoFromIcalendarContent(content: content) {
subject = conferenceInfo.subject
}
}
}
return subject
}
}

View file

@ -26,7 +26,7 @@ import UIKit
static let voip_gray_blue_color = UIColor(hex:"#798791")
static let voip_light_gray = UIColor(hex:"#D0D8DE")
@objc static let voip_dark_gray = UIColor(hex:"#4B5964")
static let voip_gray = UIColor(hex:"#96A5B1")
@objc static let voip_gray = UIColor(hex:"#96A5B1")
static let voip_gray_background = UIColor(hex:"#AFAFAF")
static let voip_call_record_background = UIColor(hex:"#EBEBEB")
static let voip_calls_list_inactive_background = UIColor(hex:"#F0F1F2")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB