Commit 0c4fe4c0 authored by Quentin Muret's avatar Quentin Muret Committed by Andreas Traczyk

conversations: adjust the height of the names in the header for all devices

Change-Id: Icb752a57094a027a647e92c9cf7220a58df3fb38
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 2ff4a7e9
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="O1m-sW-gim">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="O1m-sW-gim">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -36,7 +36,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" animating="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="NYW-Ie-8yB">
<rect key="frame" x="169.5" y="315" width="37" height="37"/>
<rect key="frame" x="169" y="315" width="37" height="37"/>
<color key="color" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</activityIndicatorView>
</subviews>
......
......@@ -278,14 +278,24 @@ class ConversationViewController: UIViewController, UITextFieldDelegate,
titleView.addSubview(profileImageView)
}
var dnlabelYOffset: CGFloat
let device = UIDevice.modelName
switch device {
case "iPhone X", "iPhone XS", "iPhone XS Max", "iPhone XR" :
dnlabelYOffset = 4
userNameYOffset = 20
default :
dnlabelYOffset = -2
userNameYOffset = 12
}
if let name = displayName, !name.isEmpty {
let dnlabel: UILabel = UILabel.init(frame: CGRect.init(x: imageSize + infoPadding, y: 4, width: maxNameLength, height: 20))
let dnlabel: UILabel = UILabel.init(frame: CGRect.init(x: imageSize + infoPadding, y: dnlabelYOffset, width: maxNameLength, height: 20))
dnlabel.text = name
dnlabel.font = UIFont.systemFont(ofSize: nameSize)
dnlabel.textColor = UIColor.ringMain
dnlabel.textAlignment = .left
titleView.addSubview(dnlabel)
userNameYOffset = 20.0
nameSize = 14.0
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment