diff --git a/Ring/Ring/Constants/Generated/Images.swift b/Ring/Ring/Constants/Generated/Images.swift index bce5d020b72df8ddf43d028ab2cc361d2308e7c3..adc0e747356c78e476ef5c9790f57ca1b30ba0e9 100644 --- a/Ring/Ring/Constants/Generated/Images.swift +++ b/Ring/Ring/Constants/Generated/Images.swift @@ -66,7 +66,6 @@ internal enum Asset { internal static let phoneBook = ImageAsset(name: "phone_book") internal static let qrCode = ImageAsset(name: "qr_code") internal static let qrCodeScan = ImageAsset(name: "qr_code_scan") - internal static let remove = ImageAsset(name: "remove") internal static let revokeDevice = ImageAsset(name: "revoke_device") internal static let ringLogo = ImageAsset(name: "ring_logo") internal static let rowSelected = ColorAsset(name: "row_selected") diff --git a/Ring/Ring/Extensions/UIView+Ring.swift b/Ring/Ring/Extensions/UIView+Ring.swift index de833d029b9044dfd47265d807c9ab091ac3082a..8c13e9db823ca195d4b1baf51ef0e78436322b6d 100644 --- a/Ring/Ring/Extensions/UIView+Ring.swift +++ b/Ring/Ring/Extensions/UIView+Ring.swift @@ -191,6 +191,18 @@ extension UIView { subview.removeFromSuperview() } } + + func setBorderPadding(left: CGFloat, right: CGFloat, top: CGFloat, bottom: CGFloat) { + let frame = self.bounds.inset(by: UIEdgeInsets(top: top, left: left, bottom: bottom, right: right)) + let circlePath = UIBezierPath(roundedRect: frame, cornerRadius: self.cornerRadius) + let shapeLayer = CAShapeLayer() + shapeLayer.path = circlePath.cgPath + shapeLayer.fillColor = UIColor.clear.cgColor + shapeLayer.strokeColor = self.borderColor.cgColor + shapeLayer.lineWidth = self.borderWidth + self.layer.addSublayer(shapeLayer) + self.borderWidth = 0 + } } typealias GradientPoints = (startPoint: CGPoint, endPoint: CGPoint) diff --git a/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.swift b/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.swift index df3e6e5ea13e8d1a992830914b4a544d580680e4..e816c3ebf26b5cb9ecd954e4d9b0395e0778c80a 100644 --- a/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.swift +++ b/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.swift @@ -51,9 +51,25 @@ class ContactRequestCell: UITableViewCell, NibReusable { override func prepareForReuse() { super.prepareForReuse() + drawBanButtonImage() self.disposeBag = DisposeBag() } + func drawBanButtonImage() { + let line = UIBezierPath() + line.move(to: CGPoint(x: banButton.bounds.width - 13, y: 13)) + line.addLine(to: CGPoint(x: 13, y: banButton.bounds.height - 13)) + line.close() + let shapeLayer = CAShapeLayer() + shapeLayer.path = line.cgPath + shapeLayer.strokeColor = UIColor.red.cgColor + shapeLayer.lineWidth = 2 + banButton.layer.addSublayer(shapeLayer) + acceptButton.setBorderPadding(left: 5, right: 5, top: 5, bottom: 5) + banButton.setBorderPadding(left: 5, right: 5, top: 5, bottom: 5) + discardButton.setBorderPadding(left: 5, right: 5, top: 5, bottom: 5) + } + func configureFromItem(_ item: ContactRequestItem) { // avatar Observable<(Data?, String)>.combineLatest(item.profileImageData.asObservable(), diff --git a/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.xib b/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.xib index 9be77b293ce7e5fa5a229a69ea6345ee0af17530..12d59417e6e3f43cfa3a64e4d0be5d789fff35a0 100644 --- a/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.xib +++ b/Ring/Ring/Features/ContactRequests/Cells/ContactRequestCell.xib @@ -17,7 +17,7 @@ <autoresizingMask key="autoresizingMask"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="aCO-e4-KsI"> - <rect key="frame" x="15" y="10" width="440" height="52"/> + <rect key="frame" x="15" y="10" width="445" height="52"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9NG-xW-Y5g" userLabel="Avatar View"> <rect key="frame" x="0.0" y="1" width="50" height="50"/> @@ -28,7 +28,7 @@ </constraints> </view> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dla-OF-biH"> - <rect key="frame" x="65" y="15.5" width="140" height="21"/> + <rect key="frame" x="65" y="15.5" width="141.5" height="21"/> <constraints> <constraint firstAttribute="height" constant="21" id="rIm-Pj-KP3"/> </constraints> @@ -36,14 +36,14 @@ <nil key="textColor"/> <nil key="highlightedColor"/> </label> - <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="klf-Xm-XH9"> - <rect key="frame" x="330" y="11" width="110" height="30"/> + <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="klf-Xm-XH9"> + <rect key="frame" x="313" y="6" width="132" height="40"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="feR-9F-sZM"> - <rect key="frame" x="0.0" y="0.0" width="30" height="30"/> + <rect key="frame" x="0.0" y="0.0" width="40" height="40"/> <constraints> - <constraint firstAttribute="width" constant="30" id="F6k-BD-rff"/> - <constraint firstAttribute="height" constant="30" id="mgC-Pn-LLR"/> + <constraint firstAttribute="width" constant="40" id="F6k-BD-rff"/> + <constraint firstAttribute="height" constant="40" id="mgC-Pn-LLR"/> </constraints> <color key="tintColor" red="0.0" green="0.69803921568627447" blue="0.043137254901960784" alpha="1" colorSpace="custom" customColorSpace="displayP3"/> <state key="normal" image="done_icon"> @@ -51,63 +51,64 @@ </state> <userDefinedRuntimeAttributes> <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <integer key="value" value="15"/> + <real key="value" value="17"/> </userDefinedRuntimeAttribute> <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> <color key="value" red="0.0" green="0.69803921568627447" blue="0.043137254901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </userDefinedRuntimeAttribute> <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <integer key="value" value="2"/> + <real key="value" value="2"/> </userDefinedRuntimeAttribute> </userDefinedRuntimeAttributes> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fWB-HR-tae"> - <rect key="frame" x="40" y="0.0" width="30" height="30"/> + <rect key="frame" x="46" y="0.0" width="40" height="40"/> <constraints> - <constraint firstAttribute="width" constant="30" id="BU4-ED-Mry"/> - <constraint firstAttribute="height" constant="30" id="fQt-vU-mXY"/> + <constraint firstAttribute="width" constant="40" id="BU4-ED-Mry"/> + <constraint firstAttribute="height" constant="40" id="fQt-vU-mXY"/> </constraints> <color key="tintColor" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> - <state key="normal" image="remove"> + <state key="normal" image="close_icon"> <color key="titleColor" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> </state> <userDefinedRuntimeAttributes> <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <integer key="value" value="2"/> + <real key="value" value="2"/> </userDefinedRuntimeAttribute> <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> <color key="value" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> </userDefinedRuntimeAttribute> <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <integer key="value" value="15"/> + <real key="value" value="17"/> </userDefinedRuntimeAttribute> </userDefinedRuntimeAttributes> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Pni-bm-rkr"> - <rect key="frame" x="80" y="0.0" width="30" height="30"/> + <rect key="frame" x="92" y="0.0" width="40" height="40"/> <constraints> - <constraint firstAttribute="height" constant="30" id="Bee-OT-mx8"/> - <constraint firstAttribute="width" constant="30" id="dsw-SF-fZe"/> + <constraint firstAttribute="height" constant="40" id="Bee-OT-mx8"/> + <constraint firstAttribute="width" constant="40" id="dsw-SF-fZe"/> </constraints> <color key="tintColor" red="0.94117647059999998" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/> - <state key="normal" image="close_icon"> + <state key="normal"> <color key="titleColor" red="0.94117647059999998" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> </state> <userDefinedRuntimeAttributes> <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> - <integer key="value" value="2"/> + <real key="value" value="2"/> </userDefinedRuntimeAttribute> <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> <color key="value" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> </userDefinedRuntimeAttribute> <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> - <integer key="value" value="15"/> + <real key="value" value="17"/> </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="boolean" keyPath="roundedCorners" value="YES"/> </userDefinedRuntimeAttributes> </button> </subviews> <constraints> - <constraint firstAttribute="width" constant="110" id="Y0h-W8-ovK"/> + <constraint firstAttribute="width" constant="132" id="SA1-7h-Opo"/> </constraints> </stackView> </subviews> @@ -120,7 +121,7 @@ <constraints> <constraint firstAttribute="bottom" secondItem="aCO-e4-KsI" secondAttribute="bottom" constant="10" id="4WN-Xl-S1O"/> <constraint firstItem="aCO-e4-KsI" firstAttribute="top" secondItem="YU4-Oq-lYT" secondAttribute="top" constant="10" id="8hg-Un-3P0"/> - <constraint firstAttribute="trailing" secondItem="aCO-e4-KsI" secondAttribute="trailing" constant="15" id="ij4-jn-hy9"/> + <constraint firstAttribute="trailing" secondItem="aCO-e4-KsI" secondAttribute="trailing" constant="10" id="ij4-jn-hy9"/> <constraint firstItem="aCO-e4-KsI" firstAttribute="leading" secondItem="YU4-Oq-lYT" secondAttribute="leading" constant="15" id="swY-Vn-ot6"/> </constraints> </tableViewCellContentView> @@ -137,6 +138,5 @@ <resources> <image name="close_icon" width="24" height="24"/> <image name="done_icon" width="24" height="24"/> - <image name="remove" width="24" height="24"/> </resources> </document> diff --git a/Ring/Ring/Features/ContactRequests/ContactRequestsViewController.swift b/Ring/Ring/Features/ContactRequests/ContactRequestsViewController.swift index 005d52783d39cf96945821aee455590ce72d658d..75f91bfce5b1e7d929835c867b291fe1fcbc2773 100644 --- a/Ring/Ring/Features/ContactRequests/ContactRequestsViewController.swift +++ b/Ring/Ring/Features/ContactRequests/ContactRequestsViewController.swift @@ -44,7 +44,6 @@ class ContactRequestsViewController: UIViewController, StoryboardBased, ViewMode noInvitationsPlaceholder.backgroundColor = UIColor.jamiBackgroundColor noRequestsLabel.backgroundColor = UIColor.jamiBackgroundColor noRequestsLabel.textColor = UIColor.jamiLabelColor - self.configureRingNavigationBar() self.tableView.rx.modelSelected(ContactRequestItem.self) .subscribe({ [weak self] item in diff --git a/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.swift b/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.swift index 00d6ebc058b0da0d4841487b20024792770ec1ee..7e8982f46eadf7a92bbbb131a00411aa7e32403d 100644 --- a/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.swift +++ b/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.swift @@ -124,11 +124,11 @@ class MessageAccessoryView: UIView, NibLoadable, GrowingTextViewDelegate { func setEmojiButtonVisibility(hide: Bool) { UIView.animate(withDuration: 0.2, animations: { if hide { - self.emojisButtonTrailingConstraint.constant = -27 - self.sendButtonLeftConstraint.constant = 13 + self.emojisButtonTrailingConstraint.constant = -46 + self.sendButtonLeftConstraint.constant = 5 self.sendButton.tintColor = UIColor.jamiMain } else { - self.emojisButtonTrailingConstraint.constant = 14 + self.emojisButtonTrailingConstraint.constant = 5 self.sendButtonLeftConstraint.constant = 35 self.sendButton.tintColor = UIColor.jamiMsgTextFieldBackground } diff --git a/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.xib b/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.xib index 654444b44d698fab1f562b10c82b9c7e31009ec4..4c2eede8afa323fd163ccf4d3beee06a678e4bd8 100644 --- a/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.xib +++ b/Ring/Ring/Features/Conversations/Conversation/MessageAccessoryView.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <device id="retina5_5" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> @@ -14,43 +14,48 @@ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eZ6-Cr-td2" userLabel="Upload Button"> - <rect key="frame" x="6" y="15" width="34" height="34"/> + <rect key="frame" x="4" y="13" width="36" height="36"/> <constraints> - <constraint firstAttribute="height" constant="34" id="efZ-wn-OTj"/> - <constraint firstAttribute="width" constant="34" id="i8S-m1-tB0"/> + <constraint firstAttribute="height" constant="36" id="efZ-wn-OTj"/> + <constraint firstAttribute="width" constant="36" id="i8S-m1-tB0"/> </constraints> + <inset key="imageEdgeInsets" minX="1" minY="1" maxX="1" maxY="1"/> <state key="normal" image="share_button"/> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ifq-LQ-X1n" userLabel="Send Button"> - <rect key="frame" x="274" y="15" width="28" height="26"/> + <rect key="frame" x="272" y="13" width="38" height="36"/> <constraints> - <constraint firstAttribute="height" constant="26" id="9PM-CR-8PT"/> - <constraint firstAttribute="width" constant="28" id="cfz-1y-EkK"/> + <constraint firstAttribute="height" constant="36" id="9PM-CR-8PT"/> + <constraint firstAttribute="width" constant="38" id="cfz-1y-EkK"/> </constraints> - <inset key="contentEdgeInsets" minX="0.0" minY="4" maxX="0.0" maxY="-4"/> + <inset key="imageEdgeInsets" minX="6" minY="6" maxX="5" maxY="6"/> <state key="normal" image="send_button"> <attributedString key="attributedTitle"/> </state> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="w2N-XG-vU1" userLabel="Emojis Button"> - <rect key="frame" x="271" y="15" width="30" height="34"/> + <rect key="frame" x="264" y="13" width="46" height="36"/> + <constraints> + <constraint firstAttribute="width" constant="46" id="r5p-e4-ejx"/> + </constraints> <state key="normal"> <attributedString key="attributedTitle"> <fragment content="👍"> <attributes> <font key="NSFont" size="25" name="AppleColorEmoji"/> - <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/> + <paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/> </attributes> </fragment> </attributedString> </state> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qCm-fg-RY1"> - <rect key="frame" x="46" y="15" width="34" height="34"/> + <rect key="frame" x="44" y="13" width="36" height="36"/> <constraints> - <constraint firstAttribute="height" constant="34" id="0I0-Zq-DPq"/> - <constraint firstAttribute="width" constant="34" id="Cby-RM-6vW"/> + <constraint firstAttribute="height" constant="36" id="0I0-Zq-DPq"/> + <constraint firstAttribute="width" constant="36" id="Cby-RM-6vW"/> </constraints> + <inset key="imageEdgeInsets" minX="1" minY="1" maxX="1" maxY="1"/> <state key="normal" image="camera"/> </button> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="pNY-Qf-lFT" customClass="GrowingTextView" customModule="Ring" customModuleProvider="target" colorLabel="IBBuiltInLabel-Red"> @@ -73,8 +78,8 @@ <constraint firstItem="Ifq-LQ-X1n" firstAttribute="top" secondItem="w2N-XG-vU1" secondAttribute="top" id="QD5-vj-Bmr"/> <constraint firstAttribute="bottom" secondItem="eZ6-Cr-td2" secondAttribute="bottom" constant="11" id="Tp1-ul-mld"/> <constraint firstItem="w2N-XG-vU1" firstAttribute="bottom" secondItem="pNY-Qf-lFT" secondAttribute="bottom" id="WH1-PP-VfU"/> - <constraint firstAttribute="trailing" secondItem="w2N-XG-vU1" secondAttribute="trailing" constant="14" id="Yyb-X2-nbp"/> - <constraint firstAttribute="trailing" secondItem="Ifq-LQ-X1n" secondAttribute="trailing" constant="13" id="a3L-Tj-DTf"/> + <constraint firstAttribute="trailing" secondItem="w2N-XG-vU1" secondAttribute="trailing" constant="5" id="Yyb-X2-nbp"/> + <constraint firstAttribute="trailing" secondItem="Ifq-LQ-X1n" secondAttribute="trailing" constant="5" id="a3L-Tj-DTf"/> <constraint firstItem="w2N-XG-vU1" firstAttribute="bottom" secondItem="qCm-fg-RY1" secondAttribute="bottom" id="gxN-rs-CSX"/> <constraint firstAttribute="leading" secondItem="eZ6-Cr-td2" secondAttribute="trailing" constant="-40" id="nXf-yT-cg0"/> </constraints> diff --git a/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.swift b/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.swift index 5926b926143276dd084db29964a86db83af92709..a4aba2c3a1385c376d415dbc3d60f0822a7b35c7 100644 --- a/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.swift +++ b/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.swift @@ -25,6 +25,7 @@ class AccountItemView: UIView { @IBOutlet var containerView: UIView! @IBOutlet weak var avatarView: UIImageView! @IBOutlet weak var nameLabel: UILabel! + @IBOutlet weak var idLabel: UILabel! @IBOutlet weak var needMigrateLabel: UILabel! override init(frame: CGRect) { diff --git a/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.xib b/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.xib index c2747c809ecaf55463f1db62c0e07ece69b46df8..1d54e88fdda02b7496977d18c0b51dd78bb67ca1 100644 --- a/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.xib +++ b/Ring/Ring/Features/Conversations/SmartList/Cells/AccountItemView.xib @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <device id="retina4_7" orientation="portrait" appearance="light"/> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/> <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"/> </dependencies> <objects> @@ -12,6 +13,7 @@ <connections> <outlet property="avatarView" destination="1tO-cV-0xx" id="NvX-rb-pwF"/> <outlet property="containerView" destination="ZAR-pP-XYM" id="9C5-cI-mFe"/> + <outlet property="idLabel" destination="DTf-Dg-NjD" id="1VN-Ya-SjV"/> <outlet property="nameLabel" destination="tuV-pF-WQA" id="lXf-rB-tMK"/> <outlet property="needMigrateLabel" destination="0dD-UW-SVT" id="pu5-Kk-FAF"/> </connections> @@ -35,36 +37,50 @@ </userDefinedRuntimeAttribute> </userDefinedRuntimeAttributes> </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tuV-pF-WQA"> - <rect key="frame" x="60" y="19.5" width="0.0" height="21"/> - <constraints> - <constraint firstAttribute="height" constant="21" id="Zjs-hB-YBW"/> - </constraints> - <fontDescription key="fontDescription" type="system" weight="light" pointSize="20"/> - <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="account need to be migrated" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0dD-UW-SVT"> - <rect key="frame" x="65" y="17" width="266.5" height="26.5"/> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="DeJ-aj-8ch"> + <rect key="frame" x="60" y="10" width="50" height="40"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tuV-pF-WQA"> + <rect key="frame" x="0.0" y="0.0" width="50" height="21"/> + <constraints> + <constraint firstAttribute="height" constant="21" id="Zjs-hB-YBW"/> + </constraints> + <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/> + <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DTf-Dg-NjD"> + <rect key="frame" x="0.0" y="21" width="50" height="19"/> + <fontDescription key="fontDescription" type="system" pointSize="13"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + </subviews> + </stackView> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="account need to be migrated" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0dD-UW-SVT"> + <rect key="frame" x="65" y="17" width="269" height="26.5"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" weight="light" pointSize="22"/> - <color key="textColor" systemColor="systemRedColor" red="1" green="0.23137254900000001" blue="0.18823529410000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <color key="textColor" systemColor="systemRedColor"/> <nil key="highlightedColor"/> </label> </subviews> + <viewLayoutGuide key="safeArea" id="jNX-Vv-YVe"/> <constraints> - <constraint firstItem="0dD-UW-SVT" firstAttribute="centerY" secondItem="tuV-pF-WQA" secondAttribute="centerY" id="BAn-Uf-ENV"/> - <constraint firstItem="tuV-pF-WQA" firstAttribute="centerY" secondItem="1tO-cV-0xx" secondAttribute="centerY" id="CmQ-98-6jB"/> - <constraint firstItem="0dD-UW-SVT" firstAttribute="leading" secondItem="tuV-pF-WQA" secondAttribute="trailing" constant="5" id="GBQ-iD-yxH"/> - <constraint firstItem="tuV-pF-WQA" firstAttribute="leading" secondItem="1tO-cV-0xx" secondAttribute="trailing" constant="10" id="WLa-Pn-wn3"/> + <constraint firstItem="DeJ-aj-8ch" firstAttribute="top" secondItem="1tO-cV-0xx" secondAttribute="top" id="Can-Tj-uzp"/> + <constraint firstItem="DeJ-aj-8ch" firstAttribute="bottom" secondItem="1tO-cV-0xx" secondAttribute="bottom" id="KhV-4s-3NG"/> <constraint firstItem="1tO-cV-0xx" firstAttribute="top" secondItem="ZAR-pP-XYM" secondAttribute="top" constant="10" id="X2n-U2-2DP"/> + <constraint firstItem="DeJ-aj-8ch" firstAttribute="leading" secondItem="1tO-cV-0xx" secondAttribute="trailing" constant="10" id="qbU-Jf-lnk"/> <constraint firstItem="1tO-cV-0xx" firstAttribute="leading" secondItem="ZAR-pP-XYM" secondAttribute="leading" constant="10" id="x4m-ev-gel"/> </constraints> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> - <viewLayoutGuide key="safeArea" id="jNX-Vv-YVe"/> <point key="canvasLocation" x="-357" y="160"/> </view> </objects> <resources> <image name="ic_contact_picture" width="128" height="128"/> + <systemColor name="systemRedColor"> + <color red="1" green="0.23137254901960785" blue="0.18823529411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </systemColor> </resources> </document> diff --git a/Ring/Ring/Features/Conversations/SmartList/Cells/AccountPickerAdapter.swift b/Ring/Ring/Features/Conversations/SmartList/Cells/AccountPickerAdapter.swift index ab03d262cc281d71dacd0ca3b2aea1f33653a2d5..0c0f290bb3a19042fb22d438e60affb017e352b8 100644 --- a/Ring/Ring/Features/Conversations/SmartList/Cells/AccountPickerAdapter.swift +++ b/Ring/Ring/Features/Conversations/SmartList/Cells/AccountPickerAdapter.swift @@ -62,6 +62,19 @@ final class AccountPickerAdapter: NSObject, UIPickerViewDataSource, UIPickerView let hideMigrationLabel = items[row].account.status != .errorNeedMigration accountView.needMigrateLabel.isHidden = hideMigrationLabel let profile = items[row].profileObservable + let account = items[row].account + let jamiId: String = { (account: AccountModel) -> String in + if !account.registeredName.isEmpty { + return account.registeredName + } + if let userNameData = UserDefaults.standard.dictionary(forKey: registeredNamesKey), + let accountName = userNameData[account.id] as? String, + !accountName.isEmpty { + return accountName + } + return account.jamiId + }(account) + accountView.idLabel.text = jamiId profile .map({ [weak self] accountProfile in if let photo = accountProfile.photo, @@ -83,22 +96,16 @@ final class AccountPickerAdapter: NSObject, UIPickerViewDataSource, UIPickerView .disposed(by: DisposeBag()) profile - .map({ [weak self] accountProfile in + .map({ accountProfile -> String in if let name = accountProfile.alias, !name.isEmpty { return name } - guard let account = self?.items[row].account else { return "" } - if !account.registeredName.isEmpty { - return account.registeredName - } - if let userNameData = UserDefaults.standard.dictionary(forKey: registeredNamesKey), - let accountName = userNameData[account.id] as? String, - !accountName.isEmpty { - return accountName - } - return account.jamiId + return jamiId + }) + .subscribe(onNext: { [weak accountView] (name) in + accountView?.idLabel.isHidden = name == jamiId + accountView?.nameLabel.text = name }) - .bind(to: accountView.nameLabel.rx.text) .disposed(by: DisposeBag()) return accountView } diff --git a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift index cb6f46ceceb4bf21fd05b872a1b00715807a1baf..d3005e955ac36d6c5aaf988f427c4d59ac99fe7c 100644 --- a/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift +++ b/Ring/Ring/Features/Conversations/SmartList/SmartlistViewController.swift @@ -284,12 +284,10 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased func setupUI() { conversationBadge.contentEdgeInsets = UIEdgeInsets(top: 1, left: 5, bottom: 1, right: 5) requestsBadge.contentEdgeInsets = UIEdgeInsets(top: 1, left: 5, bottom: 2, right: 5) + conversationBadge.backgroundColor = UIColor.jamiMain + requestsBadge.backgroundColor = UIColor.jamiMain if #available(iOS 13.0, *) { - conversationBadge.backgroundColor = UIColor.tertiaryLabel - requestsBadge.backgroundColor = UIColor.tertiaryLabel } else { - conversationBadge.backgroundColor = UIColor.gray.lighten(by: 20) - requestsBadge.backgroundColor = UIColor.gray.lighten(by: 20) conversationsSegmentControl.tintColor = UIColor.gray.lighten(by: 10) } self.viewModel.updateSegmentControl.subscribe { [weak self] (messages, requests) in @@ -331,13 +329,17 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased let imageSettings = UIImage(asset: Asset.moreSettings) as UIImage? let generalSettingsButton = UIButton(type: UIButton.ButtonType.system) as UIButton - generalSettingsButton.frame = CGRect(x: 0, y: 0, width: 25, height: 25) + generalSettingsButton.frame = CGRect(x: 0, y: 0, width: 32, height: 32) generalSettingsButton.borderWidth = 2 generalSettingsButton.borderColor = UIColor.jamiMain generalSettingsButton.setImage(imageSettings, for: .normal) generalSettingsButton.contentMode = .scaleAspectFill let settingsButtonItem = UIBarButtonItem(customView: generalSettingsButton) - generalSettingsButton.cornerRadius = 12.5 + generalSettingsButton.cornerRadius = 17.5 + generalSettingsButton.imageEdgeInsets = UIEdgeInsets(top: 5, left: 10, bottom: 5, right: 0) + generalSettingsButton.setBorderPadding(left: 10, right: 0, top: 5, bottom: 5) + generalSettingsButton.layoutIfNeeded() + generalSettingsButton.layer.masksToBounds = false generalSettingsButton.rx.tap.throttle(Durations.halfSecond.toTimeInterval(), scheduler: MainScheduler.instance) .subscribe(onNext: { [weak self] in self?.showContextualMenu() @@ -369,9 +371,9 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased let screenWidth = screenRect.size.width let window = UIApplication.shared.keyWindow let leftPadding: CGFloat = window?.safeAreaInsets.left ?? 0 - let maxWidth: CGFloat = screenWidth - 45 - margin * 3 - leftPadding * 2 + let maxWidth: CGFloat = screenWidth - generalSettingsButton.frame.width - margin * 4 - leftPadding * 2 let accountNameX: CGFloat = accountButton.frame.origin.x + accountButton.frame.size.width + margin - let triangleViewX: CGFloat = maxWidth - triangleViewSize - 2 + let triangleViewX: CGFloat = maxWidth - triangleViewSize let triangleViewY: CGFloat = size * 0.5 let accountNameWidth: CGFloat = maxWidth - triangleViewSize - size - margin * 2 let accountName = UILabel(frame: CGRect(x: accountNameX, y: 5, width: accountNameWidth, height: size)) @@ -445,21 +447,20 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased let originY = frame.size.height let originX = frame.size.width - 120 let marginX: CGFloat = 20 - let marginY: CGFloat = 15 - let itemHeight: CGFloat = 25 - menu = UIView(frame: CGRect(x: originX, y: originY, width: 100, height: 155)) + let itemHeight: CGFloat = 50 + menu = UIView(frame: CGRect(x: originX, y: originY, width: 100, height: itemHeight * 3)) menu.roundedCorners = true menu.cornerRadius = 15 // labels - let accountSettings = UILabel(frame: CGRect(x: marginX, y: 0, width: 100, height: itemHeight)) + let accountSettings = UILabel(frame: CGRect(x: marginX, y: 15, width: 100, height: itemHeight)) accountSettings.font = UIFont.systemFont(ofSize: 18, weight: .regular) accountSettings.text = L10n.Smartlist.accountSettings accountSettings.sizeToFit() - let advancedSettings = UILabel(frame: CGRect(x: marginX, y: 0, width: 100, height: itemHeight)) + let advancedSettings = UILabel(frame: CGRect(x: marginX, y: 15, width: 100, height: itemHeight)) advancedSettings.font = UIFont.systemFont(ofSize: 18, weight: .regular) advancedSettings.text = L10n.Smartlist.advancedSettings advancedSettings.sizeToFit() - let about = UILabel(frame: CGRect(x: marginX, y: 0, width: 100, height: itemHeight)) + let about = UILabel(frame: CGRect(x: marginX, y: 15, width: 100, height: itemHeight)) about.text = L10n.Smartlist.aboutJami about.font = UIFont.systemFont(ofSize: 18, weight: .regular) about.sizeToFit() @@ -468,8 +469,8 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased let viewWidth = maxWidth + marginX * 3 + 25 let buttonOrigin = maxWidth + marginX * 2 - let accountSettingsView = UIView.init(frame: CGRect(x: 0, y: marginY, width: viewWidth, height: itemHeight)) - let accountImage = UIImageView.init(frame: CGRect(x: buttonOrigin + 2, y: 2, width: 20, height: 20)) + let accountSettingsView = UIView.init(frame: CGRect(x: 0, y: 0, width: viewWidth, height: itemHeight)) + let accountImage = UIImageView.init(frame: CGRect(x: buttonOrigin + 2, y: 17, width: 20, height: 20)) accountImage.tintColor = UIColor.jamiMain accountImage.image = UIImage(asset: Asset.fallbackAvatar) accountImage.borderWidth = 1 @@ -488,8 +489,8 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased .disposed(by: self.disposeBag) accountSettingsView.addSubview(accountSettingsButton) - let advancedSettingsView = UIView.init(frame: CGRect(x: 0, y: marginY + itemHeight * 2, width: viewWidth, height: itemHeight)) - let advancedImage = UIImageView.init(frame: CGRect(x: buttonOrigin, y: 0, width: 25, height: 25)) + let advancedSettingsView = UIView.init(frame: CGRect(x: 0, y: itemHeight, width: viewWidth, height: itemHeight)) + let advancedImage = UIImageView.init(frame: CGRect(x: buttonOrigin, y: 15, width: 25, height: 25)) advancedImage.tintColor = UIColor.jamiMain advancedImage.image = UIImage(asset: Asset.settings) advancedSettingsView.addSubview(advancedSettings) @@ -505,8 +506,8 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased .disposed(by: self.disposeBag) advancedSettingsView.addSubview(advancedSettingsButton) - let aboutView = UIView.init(frame: CGRect(x: 0, y: marginY + itemHeight * 4, width: viewWidth, height: itemHeight)) - let aboutImage = UIImageView.init(frame: CGRect(x: buttonOrigin + 2, y: 2, width: 20, height: 20)) + let aboutView = UIView.init(frame: CGRect(x: 0, y: itemHeight * 2, width: viewWidth, height: itemHeight)) + let aboutImage = UIImageView.init(frame: CGRect(x: buttonOrigin + 2, y: 17, width: 20, height: 20)) aboutImage.image = UIImage(asset: Asset.jamiIcon) aboutView.addSubview(about) aboutView.addSubview(aboutImage) @@ -529,8 +530,8 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased menu.addSubview(accountSettingsView) menu.addSubview(advancedSettingsView) menu.addSubview(aboutView) - let firstLine = UIView.init(frame: CGRect(x: 0, y: itemHeight * 2, width: viewWidth, height: 1)) - let secondLine = UIView.init(frame: CGRect(x: 0, y: itemHeight * 4, width: viewWidth, height: 1)) + let firstLine = UIView.init(frame: CGRect(x: 0, y: itemHeight, width: viewWidth, height: 1)) + let secondLine = UIView.init(frame: CGRect(x: 0, y: itemHeight * 2, width: viewWidth, height: 1)) if #available(iOS 13.0, *) { firstLine.backgroundColor = UIColor.quaternaryLabel secondLine.backgroundColor = UIColor.quaternaryLabel diff --git a/Ring/Ring/Resources/Images.xcassets/block_icon.imageset/Contents.json b/Ring/Ring/Resources/Images.xcassets/block_icon.imageset/Contents.json index 9ee4e2cca22427b0b637206da801dde2a2781c4d..895505ebcd251bdcc38d01dfc38a99a8ff9016fb 100644 --- a/Ring/Ring/Resources/Images.xcassets/block_icon.imageset/Contents.json +++ b/Ring/Ring/Resources/Images.xcassets/block_icon.imageset/Contents.json @@ -1,23 +1,26 @@ { "images" : [ { - "idiom" : "universal", "filename" : "ic_block.png", + "idiom" : "universal", "scale" : "1x" }, { - "idiom" : "universal", "filename" : "ic_block_2x.png", + "idiom" : "universal", "scale" : "2x" }, { - "idiom" : "universal", "filename" : "ic_block_3x.png", + "idiom" : "universal", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/Ring/Ring/Resources/Images.xcassets/remove.imageset/Contents.json b/Ring/Ring/Resources/Images.xcassets/remove.imageset/Contents.json deleted file mode 100644 index bc65a35c095fa53a39c11291f6880fefe6afe968..0000000000000000000000000000000000000000 --- a/Ring/Ring/Resources/Images.xcassets/remove.imageset/Contents.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "images" : [ - { - "filename" : "remove1.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "remove2.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "remove3png.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "template-rendering-intent" : "template" - } -} diff --git a/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove1.png b/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove1.png deleted file mode 100644 index 23a9f6a7976a372e8750b1deec93ee3171973df3..0000000000000000000000000000000000000000 Binary files a/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove1.png and /dev/null differ diff --git a/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove2.png b/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove2.png deleted file mode 100644 index d28b711846cd3bdd1df434db6a969125a25a3df4..0000000000000000000000000000000000000000 Binary files a/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove2.png and /dev/null differ diff --git a/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove3png.png b/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove3png.png deleted file mode 100644 index 8c3233f881bd9ed58936243cca79383d4e35fde1..0000000000000000000000000000000000000000 Binary files a/Ring/Ring/Resources/Images.xcassets/remove.imageset/remove3png.png and /dev/null differ diff --git a/Ring/Ring/UI/CustomSearchBar.swift b/Ring/Ring/UI/CustomSearchBar.swift index e28462d520ae2203a9e5c8c0df07948aa4adc7f0..b53b8c75badb0a054aab1828d51722bb615876f2 100644 --- a/Ring/Ring/UI/CustomSearchBar.swift +++ b/Ring/Ring/UI/CustomSearchBar.swift @@ -28,8 +28,7 @@ class CustomSearchBar: UISearchBar { let leading: CGFloat = 15 let trailingEditing: CGFloat = -80 let trailingEditing1: CGFloat = -80.5 - let buttonOriginXOffset: CGFloat = -49 - let buttonSize: CGFloat = 40 + let buttonSize: CGFloat = 50 let disposeBag = DisposeBag() var rightMargin: CGFloat { @@ -78,7 +77,7 @@ class CustomSearchBar: UISearchBar { func sizeChanged(to size: CGFloat) { var buttonFrame = rightButton.frame let margin = rightMargin - buttonFrame.origin.x = size + buttonOriginXOffset + margin + buttonFrame.origin.x = size - buttonSize + margin rightButton.frame = buttonFrame if margin == 0 { searchFieldTrailing.constant = rightButton.isHidden ? currentTrailingEditing : currentTrailing @@ -93,8 +92,8 @@ class CustomSearchBar: UISearchBar { } func configure(buttonImage: UIImage, buttonPressed: @escaping (() -> Void)) { - rightButton = UIButton(frame: CGRect(x: self.frame.size.width + buttonOriginXOffset, y: 3, width: buttonSize, height: buttonSize)) - rightButton.imageEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10) + rightButton = UIButton(frame: CGRect(x: self.frame.size.width - buttonSize - 10, y: 0, width: buttonSize, height: buttonSize)) + rightButton.imageEdgeInsets = UIEdgeInsets(top: 15, left: 15, bottom: 15, right: 15) rightButton.setImage(buttonImage, for: .normal) rightButton.tintColor = UIColor.jamiMain self.addSubview(rightButton) @@ -128,7 +127,6 @@ class CustomSearchBar: UISearchBar { } } rightButton.rx.tap - .throttle(Durations.halfSecond.toTimeInterval(), scheduler: MainScheduler.instance) .subscribe(onNext: { buttonPressed() }) .disposed(by: self.disposeBag) self.rx.textDidBeginEditing