forked from mirrors/linphone-iphone
modification
This commit is contained in:
parent
50f8b10623
commit
b65b943114
16 changed files with 224 additions and 212 deletions
|
|
@ -9,6 +9,7 @@
|
|||
<connections>
|
||||
<outlet property="addressLabel" destination="8bV-K4-3TY" id="aqZ-1x-isL"/>
|
||||
<outlet property="avatarImage" destination="fZy-K5-yQp" id="hOl-IQ-c9B"/>
|
||||
<outlet property="callView" destination="9" id="TKY-dp-lKv"/>
|
||||
<outlet property="durationLabel" destination="Oy8-QO-Jwb" id="mUT-TX-gLp"/>
|
||||
<outlet property="eightButton" destination="DRh-kc-UVM" id="BPp-sh-qBg"/>
|
||||
<outlet property="fiveButton" destination="8Da-zK-V7e" id="URc-Ct-fu0"/>
|
||||
|
|
@ -116,7 +117,7 @@
|
|||
</accessibility>
|
||||
</view>
|
||||
<view contentMode="scaleAspectFit" id="127" userLabel="preview">
|
||||
<rect key="frame" x="254" y="355" width="113" height="140"/>
|
||||
<rect key="frame" x="254.00000029960563" y="354.99999967643191" width="113" height="140"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@
|
|||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatConversationView">
|
||||
<connections>
|
||||
<outlet property="addressLabel" destination="40" id="43"/>
|
||||
<outlet property="avatarImage" destination="41" id="44"/>
|
||||
<outlet property="chatView" destination="49" id="54"/>
|
||||
<outlet property="composeIndicatorView" destination="fx4-ao-53M" id="xk5-nK-lur"/>
|
||||
<outlet property="composeLabel" destination="fpY-Fv-ht2" id="4L6-ik-ZAe"/>
|
||||
<outlet property="editButton" destination="10" id="35"/>
|
||||
<outlet property="headerView" destination="39" id="45"/>
|
||||
<outlet property="messageField" destination="CPp-ts-xy0" id="wPX-Uo-vZQ"/>
|
||||
<outlet property="messageView" destination="14" id="89"/>
|
||||
<outlet property="pictureButton" destination="73" id="84"/>
|
||||
|
|
@ -40,7 +38,7 @@
|
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="9" userLabel="backButton" customClass="UIIconButton">
|
||||
<rect key="frame" x="0.0" y="0.0" width="72" height="40"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="75" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Back"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
|
|
@ -53,8 +51,27 @@
|
|||
<action selector="onBackClick:" destination="-1" eventType="touchUpInside" id="12"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Contact1" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="40" userLabel="addressLabel">
|
||||
<rect key="frame" x="75" y="0.0" width="150" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact name">
|
||||
<accessibilityTraits key="traits" none="YES"/>
|
||||
</accessibility>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="22"/>
|
||||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Wzg-i0-spp" userLabel="callButton" customClass="UIIconButton">
|
||||
<rect key="frame" x="225" y="0.0" width="75" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" image="status_busy.png">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="disabled" image="call_start_body_disabled.png"/>
|
||||
<state key="highlighted" image="call_start_body_over.png"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="10" userLabel="editButton" customClass="UIToggleButton">
|
||||
<rect key="frame" x="303" y="0.0" width="72" height="40"/>
|
||||
<rect key="frame" x="300" y="0.0" width="75" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Edit"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
|
|
@ -73,42 +90,8 @@
|
|||
<rect key="frame" x="0.0" y="44" width="375" height="515"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" id="39" userLabel="headerView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="80"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" image="avatar.png" id="41" userLabel="avatarImage" customClass="UIRoundedImageView">
|
||||
<rect key="frame" x="20" y="6" width="65" height="65"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact avatar">
|
||||
<accessibilityTraits key="traits" none="YES" image="YES" notEnabled="YES"/>
|
||||
<bool key="isElement" value="YES"/>
|
||||
</accessibility>
|
||||
</imageView>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Contact1" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="40" userLabel="addressLabel">
|
||||
<rect key="frame" x="93" y="17" width="189" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact name">
|
||||
<accessibilityTraits key="traits" none="YES"/>
|
||||
</accessibility>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="22"/>
|
||||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Wzg-i0-spp" userLabel="callButton" customClass="UIIconButton">
|
||||
<rect key="frame" x="287" y="6" width="65" height="65"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" image="call_start_body_default.png">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="disabled" image="call_start_body_disabled.png"/>
|
||||
<state key="highlighted" image="call_start_body_over.png"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="8" userLabel="tableView">
|
||||
<rect key="frame" x="0.0" y="80" width="375" height="338"/>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="8" userLabel="tableView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="418"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<gestureRecognizers/>
|
||||
|
|
@ -195,9 +178,7 @@
|
|||
</tableViewController>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="avatar.png" width="261" height="261"/>
|
||||
<image name="back.png" width="25" height="22"/>
|
||||
<image name="call_start_body_default.png" width="52" height="52"/>
|
||||
<image name="call_start_body_disabled.png" width="52" height="52"/>
|
||||
<image name="call_start_body_over.png" width="52" height="52"/>
|
||||
<image name="chat_picture_default.png" width="25" height="19"/>
|
||||
|
|
@ -207,6 +188,7 @@
|
|||
<image name="color_E.png" width="1" height="1"/>
|
||||
<image name="color_F.png" width="1" height="1"/>
|
||||
<image name="edit_list.png" width="31" height="29"/>
|
||||
<image name="status_busy.png" width="28" height="29"/>
|
||||
</resources>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,12 @@
|
|||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatsListView">
|
||||
<connections>
|
||||
<outlet property="addButton" destination="Z5G-IF-PBY" id="Tzw-rz-Bwe"/>
|
||||
<outlet property="backButton" destination="10" id="FsP-zG-prA"/>
|
||||
<outlet property="deleteButton" destination="e4g-nB-qYa" id="NMN-nd-I3d"/>
|
||||
<outlet property="editButton" destination="UxT-TB-Ri4" id="ycg-Aw-nDB"/>
|
||||
<outlet property="tableController" destination="4" id="18"/>
|
||||
<outlet property="toggleSelectionButton" destination="9" id="I4D-lq-R48"/>
|
||||
<outlet property="view" destination="5" id="14"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
|
|
@ -45,7 +50,7 @@
|
|||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onAddClick:" destination="-1" eventType="touchUpInside" id="20"/>
|
||||
<action selector="onEditToggle:" destination="-1" eventType="touchUpInside" id="ye7-fY-hzW"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="Z5G-IF-PBY" userLabel="addButton">
|
||||
|
|
@ -61,7 +66,7 @@
|
|||
<action selector="onAddClick:" destination="-1" eventType="touchUpInside" id="g4q-By-6nW"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="9" userLabel="selectAllButton" customClass="UIToggleButton">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="9" userLabel="toggleSelectionButton">
|
||||
<rect key="frame" x="211.00000607732113" y="0.0" width="76" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Edit"/>
|
||||
|
|
@ -70,8 +75,11 @@
|
|||
<state key="normal" image="select_all.png">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onSelectionToggle:" destination="-1" eventType="touchUpInside" id="cGl-4j-f3b"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="UxT-TB-Ri4" userLabel="editButton" customClass="UIToggleButton">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="UxT-TB-Ri4" userLabel="editButton">
|
||||
<rect key="frame" x="300" y="0.0" width="75" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Edit"/>
|
||||
|
|
@ -81,10 +89,10 @@
|
|||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onEditClick:" destination="-1" eventType="touchUpInside" id="Paf-as-rSa"/>
|
||||
<action selector="onEditToggle:" destination="-1" eventType="touchUpInside" id="WZN-yP-LAu"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="e4g-nB-qYa" userLabel="deleteButton" customClass="UIToggleButton">
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="e4g-nB-qYa" userLabel="deleteButton">
|
||||
<rect key="frame" x="300" y="0.0" width="75" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Edit"/>
|
||||
|
|
@ -96,7 +104,7 @@
|
|||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="6" userLabel="tableView">
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" allowsSelectionDuringEditing="YES" allowsMultipleSelectionDuringEditing="YES" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="6" userLabel="tableView">
|
||||
<rect key="frame" x="0.0" y="42" width="375" height="517"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@
|
|||
@property(nonatomic, strong) IBOutlet UICamSwitch *videoCameraSwitch;
|
||||
@property(nonatomic, strong) IBOutlet UIActivityIndicatorView *videoWaitingForFirstImage;
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UIView *callView;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIPauseButton *pauseButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *optionsConferenceButton;
|
||||
@property(nonatomic, strong) IBOutlet UIVideoButton *videoButton;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,4 @@
|
|||
- (void)updateChatEntry:(LinphoneChatMessage *)chat;
|
||||
- (void)setChatRoom:(LinphoneChatRoom *)room;
|
||||
|
||||
+ (CGSize)viewSize:(LinphoneChatMessage *)message width:(int)width;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -23,15 +23,6 @@
|
|||
#import "UIChatBubblePhotoCell.h"
|
||||
#import "PhoneMainView.h"
|
||||
|
||||
static const CGFloat CELL_MIN_HEIGHT = 50.0f;
|
||||
static const CGFloat CELL_MIN_WIDTH = 150.0f;
|
||||
static const CGFloat CELL_MESSAGE_X_MARGIN = 26.0f + 10.0f;
|
||||
static const CGFloat CELL_MESSAGE_Y_MARGIN = 36.0f;
|
||||
static const CGFloat CELL_FONT_SIZE = 17.0f;
|
||||
static const CGFloat CELL_IMAGE_HEIGHT = 100.0f;
|
||||
static const CGFloat CELL_IMAGE_WIDTH = 100.0f;
|
||||
static UIFont *CELL_FONT = nil;
|
||||
|
||||
@implementation ChatConversationTableView
|
||||
|
||||
@synthesize chatRoomDelegate;
|
||||
|
|
@ -223,47 +214,9 @@ static UIFont *CELL_FONT = nil;
|
|||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
LinphoneChatMessage *message = ms_list_nth_data(messageList, (int)[indexPath row]);
|
||||
return [self.class viewSize:message width:[self.view frame].size.width].height;
|
||||
UIChatBubbleTextCell *cell = (UIChatBubbleTextCell *)[self tableView:tableView cellForRowAtIndexPath:indexPath];
|
||||
return [cell viewSizeWithWidth:self.view.frame.size.width].height;
|
||||
}
|
||||
|
||||
#pragma mark - Cell dimension
|
||||
|
||||
+ (CGSize)viewSize:(LinphoneChatMessage *)message width:(int)width {
|
||||
CGSize messageSize;
|
||||
const char *url = linphone_chat_message_get_external_body_url(message);
|
||||
if (url == nil && linphone_chat_message_get_file_transfer_information(message) == NULL) {
|
||||
NSString *text = [UIChatBubbleTextCell TextMessageForChat:message];
|
||||
if (CELL_FONT == nil) {
|
||||
CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE];
|
||||
}
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
|
||||
if (UIDevice.currentDevice.systemVersion.doubleValue >= 7) {
|
||||
messageSize =
|
||||
[text boundingRectWithSize:CGSizeMake(width - CELL_MESSAGE_X_MARGIN, CGFLOAT_MAX)
|
||||
options:(NSStringDrawingUsesLineFragmentOrigin |
|
||||
NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesFontLeading)
|
||||
attributes:@{
|
||||
NSFontAttributeName : CELL_FONT
|
||||
} context:nil]
|
||||
.size;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
messageSize = [text sizeWithFont:CELL_FONT
|
||||
constrainedToSize:CGSizeMake(width - CELL_MESSAGE_X_MARGIN, 10000.0f)
|
||||
lineBreakMode:NSLineBreakByTruncatingTail];
|
||||
}
|
||||
} else {
|
||||
messageSize = CGSizeMake(CELL_IMAGE_WIDTH, CELL_IMAGE_HEIGHT);
|
||||
}
|
||||
messageSize.height += CELL_MESSAGE_Y_MARGIN;
|
||||
if (messageSize.height < CELL_MIN_HEIGHT)
|
||||
messageSize.height = CELL_MIN_HEIGHT;
|
||||
messageSize.width += CELL_MESSAGE_X_MARGIN;
|
||||
if (messageSize.width < CELL_MIN_WIDTH)
|
||||
messageSize.width = CELL_MIN_WIDTH;
|
||||
return messageSize;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -28,10 +28,15 @@
|
|||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet ChatsListTableView *tableController;
|
||||
@property(nonatomic, strong) IBOutlet UIToggleButton *editButton;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *editButton;
|
||||
@property(nonatomic, strong) IBOutlet UITextField *addressField;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *toggleSelectionButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *backButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *addButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *deleteButton;
|
||||
|
||||
- (IBAction)onAddClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
- (IBAction)onEditToggle:(id)event;
|
||||
- (IBAction)onSelectionToggle:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -22,10 +22,6 @@
|
|||
|
||||
@implementation ChatsListView
|
||||
|
||||
@synthesize tableController;
|
||||
@synthesize editButton;
|
||||
@synthesize addressField;
|
||||
|
||||
#pragma mark - Lifecycle Functions
|
||||
|
||||
- (id)init {
|
||||
|
|
@ -40,9 +36,7 @@
|
|||
selector:@selector(textReceivedEvent:)
|
||||
name:kLinphoneMessageReceived
|
||||
object:nil];
|
||||
if ([tableController isEditing])
|
||||
[tableController setEditing:FALSE animated:FALSE];
|
||||
[editButton setOff];
|
||||
[self setEditing:NO];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
|
|
@ -54,7 +48,7 @@
|
|||
#pragma mark - Event Functions
|
||||
|
||||
- (void)textReceivedEvent:(NSNotification *)notif {
|
||||
[tableController loadData];
|
||||
[_tableController loadData];
|
||||
}
|
||||
|
||||
#pragma mark - UICompositeViewDelegate Functions
|
||||
|
|
@ -82,7 +76,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (void)startChatRoom {
|
||||
// Push ChatRoom
|
||||
LinphoneChatRoom *room =
|
||||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [addressField.text UTF8String]);
|
||||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [_addressField.text UTF8String]);
|
||||
if (room != nil) {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
|
|
@ -95,10 +89,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
}
|
||||
addressField.text = @"";
|
||||
_addressField.text = @"";
|
||||
}
|
||||
|
||||
- (IBAction)onAddClick:(id)event {
|
||||
if ([[addressField text] length] == 0) { // if no address is manually set, lauch address book
|
||||
if (_addressField.text.length == 0) { // if no address is manually set, lauch address book
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeMessage];
|
||||
[ContactSelection setAddAddress:nil];
|
||||
[ContactSelection setSipFilter:[LinphoneManager instance].contactFilter];
|
||||
|
|
@ -110,15 +105,24 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
}
|
||||
|
||||
- (IBAction)onEditClick:(id)event {
|
||||
[tableController setEditing:![tableController isEditing] animated:TRUE];
|
||||
- (void)setEditing:(BOOL)editing {
|
||||
[_tableController setEditing:editing animated:TRUE];
|
||||
_toggleSelectionButton.hidden = _backButton.hidden = _deleteButton.hidden = !editing;
|
||||
_addButton.hidden = _editButton.hidden = editing;
|
||||
}
|
||||
|
||||
- (IBAction)onEditToggle:(id)event {
|
||||
[self setEditing:!_tableController.isEditing];
|
||||
}
|
||||
|
||||
- (IBAction)onSelectionToggle:(id)sender {
|
||||
}
|
||||
|
||||
#pragma mark - UITextFieldDelegate Functions
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||
[addressField resignFirstResponder];
|
||||
if ([[addressField text] length] > 0)
|
||||
[_addressField resignFirstResponder];
|
||||
if (_addressField.text.length > 0)
|
||||
[self startChatRoom];
|
||||
return YES;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
|
@ -22,14 +23,6 @@
|
|||
<rect key="frame" x="8" y="2" width="44" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="2" contentMode="left" text="11:15" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" minimumFontSize="1" id="r7A-Mk-LQX" userLabel="chatLatestTimeLabel">
|
||||
<rect key="frame" x="8" y="44" width="44" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact name"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="25"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="2" contentMode="left" usesAttributedText="YES" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" id="20" userLabel="addressLabel">
|
||||
<rect key="frame" x="60" y="0.0" width="260" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
|
|
@ -67,6 +60,14 @@
|
|||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
</button>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="2" contentMode="left" text="11:15" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" minimumFontSize="1" id="r7A-Mk-LQX" userLabel="chatLatestTimeLabel">
|
||||
<rect key="frame" x="8" y="45" width="44" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact name"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
|
||||
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
|
|
@ -74,8 +75,8 @@
|
|||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="avatar.png" width="751" height="751"/>
|
||||
<image name="chat_list_indicator.png" width="61" height="61"/>
|
||||
<image name="avatar.png" width="261" height="261"/>
|
||||
<image name="chat_list_indicator.png" width="21" height="21"/>
|
||||
</resources>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@
|
|||
@property(nonatomic, weak) IBOutlet UIButton *deleteButton;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView *bottomBarColor;
|
||||
@property(nonatomic, strong) id<ChatConversationDelegate> chatRoomDelegate;
|
||||
@property(strong, nonatomic) IBOutlet UIView *bubbleView;
|
||||
|
||||
- (CGSize)viewSizeWithWidth:(int)width;
|
||||
|
||||
- (void)setChatMessage:(LinphoneChatMessage *)message;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,21 +32,14 @@
|
|||
|
||||
- (id)initWithIdentifier:(NSString *)identifier {
|
||||
if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) {
|
||||
NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UIChatBubbleTextCell" owner:self options:nil];
|
||||
[self.contentView addSubview:[arrayOfViews objectAtIndex:arrayOfViews.count - 1]];
|
||||
|
||||
#if 0
|
||||
// shift message box, otherwise it will collide with the bubble
|
||||
CGRect messageCoords = _messageText.frame;
|
||||
messageCoords.origin.x += 2;
|
||||
messageCoords.origin.y += 2;
|
||||
messageCoords.size.width -= 5;
|
||||
|
||||
_messageText.frame = messageCoords;
|
||||
_messageText.allowSelectAll = TRUE;
|
||||
#endif
|
||||
NSArray *arrayOfViews =
|
||||
[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:self options:nil];
|
||||
// resize cell to match .nib size. It is needed when resized the cell to
|
||||
// correctly adapt its height too
|
||||
UIView *sub = ((UIView *)[arrayOfViews objectAtIndex:arrayOfViews.count - 1]);
|
||||
[self setFrame:CGRectMake(0, 0, sub.frame.size.width, sub.frame.size.height)];
|
||||
[self addSubview:sub];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +91,7 @@
|
|||
NSAttributedString *attr_text =
|
||||
[[NSAttributedString alloc] initWithString:self.textMessage
|
||||
attributes:@{
|
||||
NSFontAttributeName : [UIFont systemFontOfSize:17.0],
|
||||
NSFontAttributeName : _messageText.font,
|
||||
NSForegroundColorAttributeName : [UIColor darkGrayColor]
|
||||
}];
|
||||
_messageText.attributedText = attr_text;
|
||||
|
|
@ -110,7 +103,7 @@
|
|||
LinphoneChatMessageState state = linphone_chat_message_get_state(message);
|
||||
BOOL outgoing = linphone_chat_message_is_outgoing(message);
|
||||
|
||||
_backgroundColor.image = _bottomBarColor.image = [UIImage imageNamed:outgoing ? @"color_A" : @"color_F"];
|
||||
// _backgroundColor.image = _bottomBarColor.image = [UIImage imageNamed:outgoing ? @"color_A" : @"color_F"];
|
||||
|
||||
if (!outgoing) {
|
||||
_statusImage.accessibilityValue = @"incoming";
|
||||
|
|
@ -156,20 +149,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
#pragma mark - View Functions
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
if (message != nil) {
|
||||
BOOL is_outgoing = linphone_chat_message_is_outgoing(message);
|
||||
CGRect newFrame;
|
||||
newFrame.size = [ChatConversationTableView viewSize:message width:self.frame.size.width];
|
||||
newFrame.origin.y = 0.0f;
|
||||
newFrame.origin.x = is_outgoing ? self.contentView.frame.size.width - newFrame.size.width : 0;
|
||||
self.contentView.frame = self.frame = newFrame;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Action Functions
|
||||
|
||||
- (IBAction)onDeleteClick:(id)event {
|
||||
|
|
@ -224,4 +203,65 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
|
|||
[thiz update];
|
||||
}
|
||||
|
||||
#pragma mark - Bubble size computing
|
||||
|
||||
- (CGSize)viewSizeWithWidth:(int)width {
|
||||
static const CGFloat TEXT_MIN_HEIGHT = 50.0f;
|
||||
static const CGFloat TEXT_MIN_WIDTH = 150.0f;
|
||||
static const CGFloat MARGIN_WIDTH = 47 + 10;
|
||||
static const CGFloat MARGIN_HEIGHT = 12 + 10;
|
||||
static const CGFloat IMAGE_HEIGHT = 100.0f; // TODO: move that in bubblephpto
|
||||
static const CGFloat IMAGE_WIDTH = 100.0f;
|
||||
|
||||
CGSize messageSize;
|
||||
int messageAvailableWidth = width - MARGIN_WIDTH;
|
||||
|
||||
const char *url = linphone_chat_message_get_external_body_url(message);
|
||||
if (url == nil && linphone_chat_message_get_file_transfer_information(message) == NULL) {
|
||||
NSString *text = [UIChatBubbleTextCell TextMessageForChat:message];
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
|
||||
if ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 7) {
|
||||
messageSize =
|
||||
[text boundingRectWithSize:CGSizeMake(messageAvailableWidth, CGFLOAT_MAX)
|
||||
options:(NSStringDrawingUsesLineFragmentOrigin |
|
||||
NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesFontLeading)
|
||||
attributes:@{
|
||||
NSFontAttributeName : _messageText.font
|
||||
} context:nil]
|
||||
.size;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
messageSize = [text sizeWithFont:_messageText.font
|
||||
constrainedToSize:CGSizeMake(messageAvailableWidth, 10000.0f)
|
||||
lineBreakMode:NSLineBreakByTruncatingTail];
|
||||
}
|
||||
} else {
|
||||
messageSize = CGSizeMake(IMAGE_WIDTH, IMAGE_HEIGHT);
|
||||
}
|
||||
|
||||
messageSize.width = MAX(TEXT_MIN_WIDTH, messageSize.width);
|
||||
messageSize.height = MAX(TEXT_MIN_HEIGHT, messageSize.height);
|
||||
|
||||
CGSize bubbleSize = messageSize;
|
||||
bubbleSize.width += MARGIN_WIDTH;
|
||||
bubbleSize.height += MARGIN_HEIGHT;
|
||||
|
||||
LOGE(@"%d %fx%f for %@", width, bubbleSize.width, bubbleSize.height,
|
||||
[UIChatBubbleTextCell TextMessageForChat:message]);
|
||||
return bubbleSize;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
if (message != nil) {
|
||||
BOOL is_outgoing = linphone_chat_message_is_outgoing(message);
|
||||
CGRect bubbleFrame = _bubbleView.frame;
|
||||
bubbleFrame.size = [self viewSizeWithWidth:self.frame.size.width];
|
||||
bubbleFrame.origin.x = is_outgoing ? self.frame.size.width - bubbleFrame.size.width : 0;
|
||||
_bubbleView.frame = bubbleFrame;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<outlet property="avatarImage" destination="P1c-sD-eOv" id="h5P-hl-jbX"/>
|
||||
<outlet property="backgroundColor" destination="q2R-Zv-e5a" id="35T-Du-1AF"/>
|
||||
<outlet property="bottomBarColor" destination="mlr-pl-B6T" id="4Lk-Vn-E8h"/>
|
||||
<outlet property="bubbleView" destination="ucH-2r-rar" id="XWU-yi-1z8"/>
|
||||
<outlet property="contactDateLabel" destination="GRe-ur-aSb" id="DQA-v4-IjX"/>
|
||||
<outlet property="messageText" destination="CYa-If-oB4" id="7xm-UF-1qB"/>
|
||||
<outlet property="statusImage" destination="nLy-JO-TyL" id="9uf-2G-m8d"/>
|
||||
|
|
@ -21,63 +22,73 @@
|
|||
<action selector="onResendClick:" destination="-2" id="Xsy-zb-b7x"/>
|
||||
</connections>
|
||||
</tapGestureRecognizer>
|
||||
<view contentMode="scaleToFill" id="vdk-RV-QRU">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="60"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<view contentMode="scaleToFill" id="ucH-2r-rar">
|
||||
<rect key="frame" x="0.0" y="0.0" width="357" height="199"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.19999999999999968" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="q2R-Zv-e5a" userLabel="backgroundColor">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="60"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="avatar.png" id="P1c-sD-eOv" userLabel="avatarImage" customClass="UIRoundedImageView">
|
||||
<rect key="frame" x="8" y="5" width="50" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact avatar">
|
||||
<accessibilityTraits key="traits" none="YES" image="YES" notEnabled="YES"/>
|
||||
<bool key="isElement" value="YES"/>
|
||||
</accessibility>
|
||||
</imageView>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="Placeholder text is another very long ipsem lum dolorem...and it continues" id="CYa-If-oB4" userLabel="messageText" customClass="UITextViewNoDefine">
|
||||
<rect key="frame" x="66" y="23" width="246" height="34"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
</textView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chat_message_inprogress.png" id="nLy-JO-TyL" userLabel="statusImage">
|
||||
<rect key="frame" x="305" y="0.0" width="15" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="mlr-pl-B6T" userLabel="bottomBarColor">
|
||||
<rect key="frame" x="0.0" y="58" width="320" height="2"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</imageView>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="GRe-ur-aSb" userLabel="contactDateLabel">
|
||||
<rect key="frame" x="66" y="0.0" width="246" height="27"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact name"/>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="11:35 John ">
|
||||
<attributes>
|
||||
<color key="NSColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<font key="NSFont" size="16" name="HelveticaNeue"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="truncatingTail" baseWritingDirection="natural"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
<fragment content="Doe">
|
||||
<attributes>
|
||||
<color key="NSColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<font key="NSFont" size="16" name="HelveticaNeue-Bold"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="truncatingTail" baseWritingDirection="natural"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" id="vdk-RV-QRU" userLabel="innerView">
|
||||
<rect key="frame" x="6" y="5" width="345" height="189"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" alpha="0.19999999999999968" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="q2R-Zv-e5a" userLabel="backgroundColor">
|
||||
<rect key="frame" x="0.0" y="0.0" width="345" height="189"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="avatar.png" id="P1c-sD-eOv" userLabel="avatarImage" customClass="UIRoundedImageView">
|
||||
<rect key="frame" x="8" y="2" width="40" height="40"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact avatar">
|
||||
<accessibilityTraits key="traits" none="YES" image="YES" notEnabled="YES"/>
|
||||
<bool key="isElement" value="YES"/>
|
||||
</accessibility>
|
||||
</imageView>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="GRe-ur-aSb" userLabel="contactDateLabel">
|
||||
<rect key="frame" x="48" y="0.0" width="246" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label="Contact name"/>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="11:35 John ">
|
||||
<attributes>
|
||||
<color key="NSColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<font key="NSFont" size="16" name="HelveticaNeue"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="truncatingTail" baseWritingDirection="natural"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
<fragment content="Doe">
|
||||
<attributes>
|
||||
<color key="NSColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<font key="NSFont" size="16" name="HelveticaNeue-Bold"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="truncatingTail" baseWritingDirection="natural"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textView clipsSubviews="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" id="CYa-If-oB4" userLabel="messageText" customClass="UITextViewNoDefine">
|
||||
<rect key="frame" x="48" y="10" width="299" height="168"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<string key="text">static const CGFloat CELL_MESSAGE_WIDTH_MARGIN = 26.0f + 10.0f + 48;
|
||||
static const CGFloat CELL_MESSAGE_HEIGHT_MARGIN = 10.0f + 10;
|
||||
static const CGFloat CELL_IMAGE_HEIGHT = 100.0f;
|
||||
static const CGFloat CELL_IMAGE_WIDTH = 100.0f;</string>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<dataDetectorType key="dataDetectorTypes" link="YES"/>
|
||||
</textView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chat_message_inprogress.png" id="nLy-JO-TyL" userLabel="statusImage">
|
||||
<rect key="frame" x="330" y="0.0" width="15" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_A.png" id="mlr-pl-B6T" userLabel="bottomBarColor">
|
||||
<rect key="frame" x="0.0" y="188" width="345" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="339" y="43"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@
|
|||
[UIView beginAnimations:nil context:nil];
|
||||
[UIView setAnimationDuration:0.3];
|
||||
}
|
||||
[super setEditing:editing animated:animated];
|
||||
if (editing) {
|
||||
[deleteButton setAlpha:1.0f];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -353,7 +353,12 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args) {
|
|||
}
|
||||
|
||||
+ (void)setDisplayNameLabel:(UILabel *)label forAddress:(const LinphoneAddress *)addr {
|
||||
label.text = [FastAddressBook displayNameForAddress:addr];
|
||||
ABRecordRef contact = [FastAddressBook getContactWithLinphoneAddress:addr];
|
||||
if (contact) {
|
||||
[ContactDisplay setDisplayNameLabel:label forContact:contact];
|
||||
} else {
|
||||
label.text = [FastAddressBook displayNameForAddress:addr];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue