summaryrefslogtreecommitdiff
path: root/Juick/Views
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-17 00:30:51 +0300
committerGravatar Vitaly Takmazov2018-10-17 00:30:51 +0300
commit675d2bd7c52ef0e191d52784f20f3c35e4b308f6 (patch)
tree21f3a35a9e04de4e27ea8dfee4550dd01af36272 /Juick/Views
parent6e98d48a7764c3d2a814ce70682a63d024910d17 (diff)
Layout fixes
Diffstat (limited to 'Juick/Views')
-rw-r--r--Juick/Views/ConversationCell.m6
-rw-r--r--Juick/Views/ConversationCell.xib29
-rw-r--r--Juick/Views/MessageCell.m1
3 files changed, 17 insertions, 19 deletions
diff --git a/Juick/Views/ConversationCell.m b/Juick/Views/ConversationCell.m
index 873f21e..ca09cd0 100644
--- a/Juick/Views/ConversationCell.m
+++ b/Juick/Views/ConversationCell.m
@@ -7,6 +7,7 @@
//
#import "ConversationCell.h"
+#import "ColorScheme.h"
@implementation ConversationCell
@@ -16,10 +17,9 @@
}
-(void) configureWithChat:(Chat *)chat {
+ self.chatName.textColor = [ColorScheme linkColor];
self.chatName.text = chat.uname;
- self.lastMessage.text = @"";
- self.unreadMarker.text = @"";
- __weak UIImageView *weakAvatar;
+ __weak UIImageView *weakAvatar = self.avatar;
[self.avatar setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [chat.uid intValue]]]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) {
[UIView transitionWithView:weakAvatar
duration:0.3
diff --git a/Juick/Views/ConversationCell.xib b/Juick/Views/ConversationCell.xib
index 65f9766..09b5a7e 100644
--- a/Juick/Views/ConversationCell.xib
+++ b/Juick/Views/ConversationCell.xib
@@ -18,41 +18,38 @@
<rect key="frame" x="0.0" y="0.0" width="478" height="126.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" alignment="center" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="6O8-u9-Jvc">
+ <stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="6O8-u9-Jvc">
<rect key="frame" x="6" y="17" width="466" height="93"/>
<subviews>
- <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="Sas-e1-iNF">
- <rect key="frame" x="0.0" y="17.5" width="42" height="58.5"/>
+ <stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="252" verticalHuggingPriority="252" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="752" axis="vertical" alignment="center" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="Sas-e1-iNF">
+ <rect key="frame" x="0.0" y="9.5" width="49.5" height="74.5"/>
<subviews>
- <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WsB-eh-dhD">
- <rect key="frame" x="5" y="0.0" width="32" height="32"/>
+ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WsB-eh-dhD">
+ <rect key="frame" x="1" y="0.0" width="48" height="48"/>
<constraints>
- <constraint firstAttribute="width" constant="32" id="6ox-eq-Vlp"/>
- <constraint firstAttribute="height" constant="32" id="e88-rG-unU"/>
+ <constraint firstAttribute="width" constant="48" id="6ox-eq-Vlp"/>
+ <constraint firstAttribute="height" constant="48" id="e88-rG-unU"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="●" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jW2-kr-sJn">
- <rect key="frame" x="13.5" y="38" width="15" height="20.5"/>
+ <rect key="frame" x="17.5" y="54" width="15" height="20.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
- <color key="textColor" red="0.90980392160000001" green="0.098039215690000001" blue="0.21960784310000001" alpha="1" colorSpace="calibratedRGB"/>
+ <color key="textColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
- <constraints>
- <constraint firstAttribute="width" constant="42" id="5Yp-OO-aaj"/>
- </constraints>
</stackView>
- <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="dJe-jR-n42">
- <rect key="frame" x="54" y="11.5" width="412" height="70.5"/>
+ <stackView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="252" horizontalCompressionResistancePriority="751" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="dJe-jR-n42">
+ <rect key="frame" x="61.5" y="11.5" width="404.5" height="70.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TTg-gl-dzG">
- <rect key="frame" x="0.0" y="0.0" width="412" height="20.5"/>
+ <rect key="frame" x="0.0" y="0.0" width="404.5" height="20.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EiA-lG-gV5">
- <rect key="frame" x="0.0" y="32.5" width="412" height="38"/>
+ <rect key="frame" x="0.0" y="32.5" width="404.5" height="38"/>
<string key="text">Lorem sdsdasds sdsada ddas dsad asdsadas dasd asdsa sadsa dasdsad asd asdas dasd asdas dasd asdas dasdasdasd asdasdasdadasdasd asdasd asdas dasdsa dasdasdasdasdas dasdas</string>
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
<color key="textColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index efdfbc6..cf23f62 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -30,6 +30,7 @@
}
- (void) configureWithMessage:(Message *)msg {
+ self.avatar.image = nil;
__weak UIImageView *weakAvatar = self.avatar;
[self.avatar setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]]] placeholderImage:nil success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull image) {
[UIView transitionWithView:weakAvatar