mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-09 01:17:41 +02:00
Merge pull request #1389 from vector-im/room_table_cell
RoomTableViewCell: Replace the direct chat icon with a green ring
This commit is contained in:
@@ -712,13 +712,9 @@
|
||||
{
|
||||
[roomCell render:room];
|
||||
}
|
||||
roomCell.directRoomIcon.hidden = NO;
|
||||
roomCell.encryptedRoomIcon.hidden = !room.state.isEncrypted;
|
||||
}
|
||||
else
|
||||
{
|
||||
roomCell.directRoomIcon.hidden = YES;
|
||||
|
||||
roomCell.avatarImageView.image = [UIImage imageNamed:@"start_chat"];
|
||||
roomCell.avatarImageView.backgroundColor = [UIColor clearColor];
|
||||
roomCell.avatarImageView.userInteractionEnabled = NO;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
@interface RoomTableViewCell : MXKTableViewCell
|
||||
|
||||
@property (weak, nonatomic) IBOutlet MXKImageView *avatarImageView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *directRoomIcon;
|
||||
@property (weak, nonatomic) IBOutlet UIView *directRoomBorderView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *encryptedRoomIcon;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
[super awakeFromNib];
|
||||
|
||||
self.titleLabel.textColor = kRiotTextColorBlack;
|
||||
|
||||
// Prepare direct room border
|
||||
[self.directRoomBorderView.layer setCornerRadius:self.directRoomBorderView.frame.size.width / 2];
|
||||
self.directRoomBorderView.clipsToBounds = YES;
|
||||
self.directRoomBorderView.layer.borderColor = CGColorCreateCopyWithAlpha(kRiotColorGreen.CGColor, 0.75);
|
||||
self.directRoomBorderView.layer.borderWidth = 3;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
@@ -46,6 +52,18 @@
|
||||
self.avatarImageView.backgroundColor = [UIColor clearColor];
|
||||
|
||||
self.titleLabel.text = room.riotDisplayname;
|
||||
|
||||
self.directRoomBorderView.hidden = !room.isDirect;
|
||||
|
||||
self.encryptedRoomIcon.hidden = !room.state.isEncrypted;
|
||||
}
|
||||
|
||||
- (void)prepareForReuse
|
||||
{
|
||||
[super prepareForReuse];
|
||||
|
||||
self.directRoomBorderView.hidden = YES;
|
||||
self.encryptedRoomIcon.hidden = YES;
|
||||
}
|
||||
|
||||
+ (CGFloat)cellHeight
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1108" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
@@ -17,7 +17,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="74"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="L2L-l5-wPx" id="aXz-IR-jj5">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="73"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="74"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FfX-ul-Kr4" customClass="MXKImageView">
|
||||
@@ -29,6 +29,13 @@
|
||||
<constraint firstAttribute="width" secondItem="FfX-ul-Kr4" secondAttribute="height" multiplier="1:1" id="ycc-8M-xEj"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="O8i-B6-S6A">
|
||||
<rect key="frame" x="14" y="16" width="42" height="42"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="O8i-B6-S6A" secondAttribute="height" multiplier="1:1" id="KP4-Uc-4pf"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lg1-xQ-AGn">
|
||||
<rect key="frame" x="70" y="27" width="34" height="20"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="TitleLabel"/>
|
||||
@@ -39,51 +46,39 @@
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="direct_icon.png" translatesAutoresizingMaskIntoConstraints="NO" id="z0D-Vp-W1P">
|
||||
<rect key="frame" x="50" y="18" width="11" height="13"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="DirectRoomIcon"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="13" id="3UP-dK-nZW"/>
|
||||
<constraint firstAttribute="width" constant="11" id="jeb-V2-1z0"/>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="11" id="pU0-Ng-xIu"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="13" id="pXo-bd-QsE"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="e2e_verified.png" translatesAutoresizingMaskIntoConstraints="NO" id="apY-Nk-wQh">
|
||||
<rect key="frame" x="50" y="42" width="11" height="13"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="EncryptedRoomIcon"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="11" id="2BN-VL-aj3"/>
|
||||
<constraint firstAttribute="width" constant="11" id="6Pz-2E-7D8"/>
|
||||
<constraint firstAttribute="height" constant="13" id="YaH-z9-Zn0"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="13" id="nuB-5V-Ea6"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="z0D-Vp-W1P" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="top" constant="18" id="0uz-6q-Qqk"/>
|
||||
<constraint firstItem="Lg1-xQ-AGn" firstAttribute="leading" secondItem="FfX-ul-Kr4" secondAttribute="trailing" constant="14" id="A6H-TC-2Pg"/>
|
||||
<constraint firstItem="apY-Nk-wQh" firstAttribute="top" secondItem="z0D-Vp-W1P" secondAttribute="bottom" constant="11" id="HQu-8q-mJG"/>
|
||||
<constraint firstItem="O8i-B6-S6A" firstAttribute="centerY" secondItem="FfX-ul-Kr4" secondAttribute="centerY" id="L8U-Xi-rD7"/>
|
||||
<constraint firstItem="Lg1-xQ-AGn" firstAttribute="centerY" secondItem="aXz-IR-jj5" secondAttribute="centerY" id="O6E-Di-2d4"/>
|
||||
<constraint firstItem="apY-Nk-wQh" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="topMargin" constant="34" id="Rlm-bQ-Qpr"/>
|
||||
<constraint firstItem="O8i-B6-S6A" firstAttribute="width" secondItem="FfX-ul-Kr4" secondAttribute="width" id="Sej-VT-sBx"/>
|
||||
<constraint firstAttribute="trailingMargin" relation="greaterThanOrEqual" secondItem="Lg1-xQ-AGn" secondAttribute="trailing" constant="15" id="U1F-vo-7f6"/>
|
||||
<constraint firstItem="z0D-Vp-W1P" firstAttribute="leading" secondItem="aXz-IR-jj5" secondAttribute="leading" constant="50" id="g5c-qa-Nql"/>
|
||||
<constraint firstItem="apY-Nk-wQh" firstAttribute="leading" secondItem="aXz-IR-jj5" secondAttribute="leadingMargin" constant="42" id="dut-Df-DIU"/>
|
||||
<constraint firstItem="FfX-ul-Kr4" firstAttribute="centerY" secondItem="aXz-IR-jj5" secondAttribute="centerY" id="gUw-GV-DPX"/>
|
||||
<constraint firstItem="apY-Nk-wQh" firstAttribute="leading" secondItem="z0D-Vp-W1P" secondAttribute="leading" id="ks0-cW-Frh"/>
|
||||
<constraint firstItem="FfX-ul-Kr4" firstAttribute="leading" secondItem="aXz-IR-jj5" secondAttribute="leadingMargin" constant="6" id="qey-6T-URF"/>
|
||||
<constraint firstItem="O8i-B6-S6A" firstAttribute="centerX" secondItem="FfX-ul-Kr4" secondAttribute="centerX" id="xfK-sI-YJQ"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="RoomTableViewCell"/>
|
||||
<connections>
|
||||
<outlet property="avatarImageView" destination="FfX-ul-Kr4" id="NOo-Lj-BBY"/>
|
||||
<outlet property="directRoomIcon" destination="z0D-Vp-W1P" id="DBb-xx-jRY"/>
|
||||
<outlet property="directRoomBorderView" destination="O8i-B6-S6A" id="b7x-Sz-SiX"/>
|
||||
<outlet property="encryptedRoomIcon" destination="apY-Nk-wQh" id="qlf-6j-voX"/>
|
||||
<outlet property="titleLabel" destination="Lg1-xQ-AGn" id="uqU-hH-KT0"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="direct_icon.png" width="11" height="13"/>
|
||||
<image name="e2e_verified.png" width="10" height="12"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
Reference in New Issue
Block a user