Room details: align correctly unsent label with unsent messages

This commit is contained in:
giomfo
2014-11-13 15:44:29 +01:00
parent 6d099cbee0
commit 7a416d1de7
3 changed files with 9 additions and 6 deletions
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="GsA-m1-kGB"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="GsA-m1-kGB">
<dependencies> <dependencies>
<deployment defaultVersion="1536" identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/> <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
</dependencies> </dependencies>
<scenes> <scenes>
@@ -169,6 +169,7 @@
<outlet property="msgTextViewWidthConstraint" destination="a6g-WS-jjN" id="aM9-xQ-hVM"/> <outlet property="msgTextViewWidthConstraint" destination="a6g-WS-jjN" id="aM9-xQ-hVM"/>
<outlet property="pictureView" destination="mks-jh-AiZ" id="qL1-Kd-oRC"/> <outlet property="pictureView" destination="mks-jh-AiZ" id="qL1-Kd-oRC"/>
<outlet property="unsentLabel" destination="alD-cg-uMl" id="UXm-mh-sux"/> <outlet property="unsentLabel" destination="alD-cg-uMl" id="UXm-mh-sux"/>
<outlet property="unsentLabelTopConstraint" destination="M1S-HJ-o3b" id="Geo-hs-Ils"/>
</connections> </connections>
</tableViewCell> </tableViewCell>
</prototypes> </prototypes>
@@ -35,5 +35,6 @@
@interface OutgoingMessageTableCell : RoomMessageTableCell @interface OutgoingMessageTableCell : RoomMessageTableCell
@property (weak, nonatomic) IBOutlet UILabel *unsentLabel; @property (weak, nonatomic) IBOutlet UILabel *unsentLabel;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator; @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *unsentLabelTopConstraint;
@end @end
@@ -684,16 +684,17 @@ NSString *const kFailedEventId = @"failedEventId";
// Reset text color // Reset text color
cell.messageTextView.textColor = [UIColor blackColor]; cell.messageTextView.textColor = [UIColor blackColor];
} else { } else {
OutgoingMessageTableCell* outgoingMsgCell = (OutgoingMessageTableCell*)cell;
// Hide unsent label by default // Hide unsent label by default
UILabel *unsentLabel = ((OutgoingMessageTableCell*)cell).unsentLabel; outgoingMsgCell.unsentLabel.hidden = YES;
unsentLabel.hidden = YES;
// Set the right text color for outgoing messages // Set the right text color for outgoing messages
if ([mxEvent.eventId hasPrefix:kLocalEchoEventIdPrefix]) { if ([mxEvent.eventId hasPrefix:kLocalEchoEventIdPrefix]) {
cell.messageTextView.textColor = [UIColor lightGrayColor]; cell.messageTextView.textColor = [UIColor lightGrayColor];
} else if ([mxEvent.eventId hasPrefix:kFailedEventId]) { } else if ([mxEvent.eventId hasPrefix:kFailedEventId]) {
cell.messageTextView.textColor = [UIColor redColor]; cell.messageTextView.textColor = [UIColor redColor];
unsentLabel.hidden = NO; outgoingMsgCell.unsentLabel.hidden = NO;
outgoingMsgCell.unsentLabelTopConstraint.constant = cell.msgTextViewTopConstraint.constant + cell.messageTextView.contentInset.top - ROOM_MESSAGE_CELL_TEXTVIEW_TOP_CONST_GROUPED_CELL;
} else { } else {
cell.messageTextView.textColor = [UIColor blackColor]; cell.messageTextView.textColor = [UIColor blackColor];
} }