Room member details: Define a background color for the device cell buttons

This commit is contained in:
giomfo
2016-11-28 19:43:43 +01:00
parent a85ada5374
commit 423dbb4e93
3 changed files with 36 additions and 15 deletions
+10 -1
View File
@@ -19,7 +19,7 @@
#import "VectorDesignValues.h"
#import "MXRoom+Vector.h"
#define DEVICE_TABLEVIEW_ROW_CELL_HEIGHT_WITHOUT_LABEL_HEIGHT 53
#define DEVICE_TABLEVIEW_ROW_CELL_HEIGHT_WITHOUT_LABEL_HEIGHT 59
@implementation DeviceTableViewCell
@@ -30,12 +30,21 @@
[super awakeFromNib];
self.deviceName.textColor = kVectorTextColorBlack;
[self.verifyButton.layer setCornerRadius:5];
self.verifyButton.clipsToBounds = YES;
self.verifyButton.backgroundColor = kVectorColorGreen;
[self.blockButton.layer setCornerRadius:5];
self.blockButton.clipsToBounds = YES;
self.blockButton.backgroundColor = kVectorColorGreen;
}
- (void)render:(MXDeviceInfo *)deviceInfo
{
_deviceInfo = deviceInfo;
self.deviceName.numberOfLines = 0;
self.deviceName.text = (deviceInfo.displayName.length ? [NSString stringWithFormat:@"%@ (%@)", deviceInfo.displayName, deviceInfo.deviceId] : [NSString stringWithFormat:@"(%@)", deviceInfo.deviceId]);
switch (deviceInfo.verified)
+22 -12
View File
@@ -9,35 +9,43 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="L2L-l5-wPx" customClass="DeviceTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="600" height="74"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="80"/>
<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="79"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="Title" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lg1-xQ-AGn">
<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="15" y="12" width="34" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="e2e_verified.png" translatesAutoresizingMaskIntoConstraints="NO" id="z0D-Vp-W1P">
<rect key="frame" x="557" y="9" width="28" height="28"/>
<rect key="frame" x="557" y="8" width="28" height="28"/>
<constraints>
<constraint firstAttribute="width" constant="28" id="hgW-Sz-wvj"/>
<constraint firstAttribute="height" constant="28" id="pAK-bq-kQo"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eGB-gc-djy">
<rect key="frame" x="127" y="37" width="46" height="30"/>
<state key="normal" title="Button"/>
<rect key="frame" x="30" y="39" width="240" height="32"/>
<color key="backgroundColor" red="0.028153735480000001" green="0.82494870580000002" blue="0.051896891280000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<state key="normal" title="Button">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="onButtonPressed:" destination="L2L-l5-wPx" eventType="touchUpInside" id="w73-jF-wNt"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5oI-dt-g7V">
<rect key="frame" x="427" y="37" width="46" height="30"/>
<state key="normal" title="Button"/>
<rect key="frame" x="330" y="39" width="240" height="32"/>
<color key="backgroundColor" red="0.028153735480000001" green="0.82494870580000002" blue="0.051896891280000003" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<state key="normal" title="Button">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="onButtonPressed:" destination="L2L-l5-wPx" eventType="touchUpInside" id="e8K-NE-gUP"/>
</connections>
@@ -48,12 +56,14 @@
<constraint firstItem="Lg1-xQ-AGn" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="top" constant="12" id="6ka-Ly-Do9"/>
<constraint firstItem="z0D-Vp-W1P" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Lg1-xQ-AGn" secondAttribute="trailing" constant="8" id="7Zd-Db-aId"/>
<constraint firstAttribute="centerX" secondItem="5oI-dt-g7V" secondAttribute="centerX" multiplier="2/3" id="NQR-Ta-zo1"/>
<constraint firstAttribute="bottom" secondItem="5oI-dt-g7V" secondAttribute="bottom" constant="6" id="NbU-LJ-hiH"/>
<constraint firstItem="eGB-gc-djy" firstAttribute="top" secondItem="Lg1-xQ-AGn" secondAttribute="bottom" constant="4" id="P7Q-m8-H9P"/>
<constraint firstAttribute="bottom" secondItem="eGB-gc-djy" secondAttribute="bottom" constant="6" id="ekj-od-I4c"/>
<constraint firstItem="5oI-dt-g7V" firstAttribute="top" secondItem="Lg1-xQ-AGn" secondAttribute="bottom" constant="4" id="iTX-g9-8jX"/>
<constraint firstAttribute="bottom" secondItem="5oI-dt-g7V" secondAttribute="bottom" constant="8" id="NbU-LJ-hiH"/>
<constraint firstItem="eGB-gc-djy" firstAttribute="top" secondItem="Lg1-xQ-AGn" secondAttribute="bottom" constant="6" id="P7Q-m8-H9P"/>
<constraint firstAttribute="bottom" secondItem="eGB-gc-djy" secondAttribute="bottom" constant="8" id="ekj-od-I4c"/>
<constraint firstItem="5oI-dt-g7V" firstAttribute="top" secondItem="Lg1-xQ-AGn" secondAttribute="bottom" constant="6" id="iTX-g9-8jX"/>
<constraint firstItem="eGB-gc-djy" firstAttribute="width" secondItem="aXz-IR-jj5" secondAttribute="width" multiplier="0.4" id="jKx-IF-CXe"/>
<constraint firstAttribute="trailing" secondItem="z0D-Vp-W1P" secondAttribute="trailing" constant="15" id="oZI-9V-Jkt"/>
<constraint firstAttribute="centerX" secondItem="eGB-gc-djy" secondAttribute="centerX" multiplier="2" id="sIM-W6-ux0"/>
<constraint firstItem="5oI-dt-g7V" firstAttribute="width" secondItem="eGB-gc-djy" secondAttribute="width" id="x7l-cf-BvM"/>
<constraint firstItem="z0D-Vp-W1P" firstAttribute="centerY" secondItem="Lg1-xQ-AGn" secondAttribute="centerY" id="zHp-MT-UL5"/>
</constraints>
</tableViewCellContentView>