mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 09:32:52 +02:00
Add avatar shadow
This commit is contained in:
@@ -18,9 +18,24 @@ import UIKit
|
||||
import Reusable
|
||||
import MatrixKit
|
||||
|
||||
class RoomInfoBasicTableViewCell: UITableViewCell {
|
||||
class RoomInfoBasicTableViewCell: GroupedTableViewCell {
|
||||
|
||||
@IBOutlet private weak var avatarImageView: MXKImageView!
|
||||
@IBOutlet private weak var shadowView: UIView! {
|
||||
didSet {
|
||||
let shadowPath = UIBezierPath(roundedRect: shadowView.bounds, cornerRadius: 0)
|
||||
let layer = CALayer()
|
||||
layer.shadowPath = shadowPath.cgPath
|
||||
layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.12).cgColor
|
||||
layer.shadowOpacity = 1
|
||||
layer.shadowRadius = 25
|
||||
layer.shadowOffset = CGSize(width: 0, height: 4)
|
||||
layer.bounds = shadowView.bounds
|
||||
layer.position = shadowView.center
|
||||
|
||||
shadowView.layer.addSublayer(layer)
|
||||
}
|
||||
}
|
||||
@IBOutlet private weak var badgeImageView: UIImageView!
|
||||
@IBOutlet private weak var roomNameLabel: UILabel!
|
||||
@IBOutlet private weak var roomAddressLabel: UILabel!
|
||||
|
||||
@@ -10,58 +10,76 @@
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="176" id="KGk-i7-Jjw" customClass="RoomInfoBasicTableViewCell" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="176"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="183" id="KGk-i7-Jjw" customClass="RoomInfoBasicTableViewCell" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="183"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="176"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="183"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ih9-pn-UCp" customClass="MXKImageView">
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fa9-lt-yKn">
|
||||
<rect key="frame" x="120" y="20" width="80" height="80"/>
|
||||
<subviews>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ih9-pn-UCp" customClass="MXKImageView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="80" height="80"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="40"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HjO-jJ-set">
|
||||
<rect key="frame" x="0.0" y="0.0" width="80" height="80"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="w9i-el-cnZ">
|
||||
<rect key="frame" x="56" y="56" width="24" height="24"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="24" id="bnv-KV-cKC"/>
|
||||
<constraint firstAttribute="width" constant="24" id="okP-qE-wlS"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="80" id="O3p-iU-hNS"/>
|
||||
<constraint firstAttribute="height" constant="80" id="x7L-ck-2Yh"/>
|
||||
<constraint firstAttribute="width" constant="80" id="5IH-35-imP"/>
|
||||
<constraint firstAttribute="bottom" secondItem="HjO-jJ-set" secondAttribute="bottom" id="6Cl-PB-WES"/>
|
||||
<constraint firstAttribute="trailing" secondItem="HjO-jJ-set" secondAttribute="trailing" id="7Lk-b9-V5T"/>
|
||||
<constraint firstItem="Ih9-pn-UCp" firstAttribute="top" secondItem="fa9-lt-yKn" secondAttribute="top" id="MYT-NV-avB"/>
|
||||
<constraint firstItem="Ih9-pn-UCp" firstAttribute="leading" secondItem="fa9-lt-yKn" secondAttribute="leading" id="ONR-ZM-WbJ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="w9i-el-cnZ" secondAttribute="bottom" id="SX6-0e-mcB"/>
|
||||
<constraint firstItem="HjO-jJ-set" firstAttribute="top" secondItem="fa9-lt-yKn" secondAttribute="top" id="Zw2-II-mFA"/>
|
||||
<constraint firstAttribute="trailing" secondItem="w9i-el-cnZ" secondAttribute="trailing" id="alD-bU-yjt"/>
|
||||
<constraint firstItem="HjO-jJ-set" firstAttribute="leading" secondItem="fa9-lt-yKn" secondAttribute="leading" id="guy-nt-gAp"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ih9-pn-UCp" secondAttribute="trailing" id="lJN-pY-vgd"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Ih9-pn-UCp" secondAttribute="bottom" id="sIC-G0-11c"/>
|
||||
<constraint firstAttribute="height" constant="80" id="wbC-Tq-fBe"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="40"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="w9i-el-cnZ">
|
||||
<rect key="frame" x="178" y="78" width="24" height="24"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="24" id="bnv-KV-cKC"/>
|
||||
<constraint firstAttribute="width" constant="24" id="okP-qE-wlS"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalCompressionResistancePriority="751" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uiN-p3-IYo">
|
||||
<rect key="frame" x="16" y="110" width="288" height="24"/>
|
||||
<rect key="frame" x="16" y="120" width="288" height="24"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ack-lj-oiX">
|
||||
<rect key="frame" x="16" y="142" width="288" height="18"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ack-lj-oiX">
|
||||
<rect key="frame" x="16" y="152" width="288" height="15"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="uiN-p3-IYo" firstAttribute="top" secondItem="Ih9-pn-UCp" secondAttribute="bottom" constant="10" id="0lK-pr-i7O"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Ack-lj-oiX" secondAttribute="bottom" constant="16" id="2NF-DW-HlN"/>
|
||||
<constraint firstItem="uiN-p3-IYo" firstAttribute="top" secondItem="fa9-lt-yKn" secondAttribute="bottom" constant="20" id="5e0-Vs-X84"/>
|
||||
<constraint firstItem="Ack-lj-oiX" firstAttribute="top" secondItem="uiN-p3-IYo" secondAttribute="bottom" constant="8" id="61S-XG-WG5"/>
|
||||
<constraint firstAttribute="trailing" secondItem="uiN-p3-IYo" secondAttribute="trailing" constant="16" id="CQu-se-rNL"/>
|
||||
<constraint firstItem="uiN-p3-IYo" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="DxO-wJ-0ER"/>
|
||||
<constraint firstItem="Ih9-pn-UCp" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="20" id="TR9-Ku-qVl"/>
|
||||
<constraint firstItem="fa9-lt-yKn" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="Jal-p3-ohT"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ack-lj-oiX" secondAttribute="trailing" constant="16" id="Unh-dc-S3G"/>
|
||||
<constraint firstItem="w9i-el-cnZ" firstAttribute="bottom" secondItem="Ih9-pn-UCp" secondAttribute="bottom" constant="2" id="lCQ-6E-yIp"/>
|
||||
<constraint firstItem="w9i-el-cnZ" firstAttribute="trailing" secondItem="Ih9-pn-UCp" secondAttribute="trailing" constant="2" id="o7w-oC-qoA"/>
|
||||
<constraint firstItem="fa9-lt-yKn" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="20" id="xqU-ym-WpF"/>
|
||||
<constraint firstItem="Ack-lj-oiX" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="zET-7P-QbW"/>
|
||||
<constraint firstItem="Ih9-pn-UCp" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="znG-nA-X2V"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
|
||||
@@ -70,8 +88,9 @@
|
||||
<outlet property="badgeImageView" destination="w9i-el-cnZ" id="WcY-6X-XFR"/>
|
||||
<outlet property="roomAddressLabel" destination="Ack-lj-oiX" id="YDF-XH-PfM"/>
|
||||
<outlet property="roomNameLabel" destination="uiN-p3-IYo" id="rN5-Cr-Qf8"/>
|
||||
<outlet property="shadowView" destination="HjO-jJ-set" id="bsl-df-8EO"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="137.68115942028987" y="135.60267857142856"/>
|
||||
<point key="canvasLocation" x="137.68115942028987" y="136.94196428571428"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
Reference in New Issue
Block a user