Merge pull request #1710 from vector-im/groups

Groups enhancements
This commit is contained in:
giomfo
2017-12-28 13:42:30 +01:00
committed by GitHub
12 changed files with 227 additions and 92 deletions
@@ -24,6 +24,11 @@
@property (weak, nonatomic) IBOutlet UILabel *groupName;
@property (weak, nonatomic) IBOutlet UIView *groupNameMask;
@property (weak, nonatomic) IBOutlet UILabel *groupDescription;
@property (weak, nonatomic) IBOutlet UIView *countsContainer;
@property (weak, nonatomic) IBOutlet UIView *membersCountContainer;
@property (weak, nonatomic) IBOutlet UIView *roomsCountContainer;
@property (weak, nonatomic) IBOutlet UILabel *membersCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *roomsCountLabel;
@property (weak, nonatomic) IBOutlet UIView *inviteContainer;
@property (weak, nonatomic) IBOutlet UILabel *inviteLabel;
+64 -9
View File
@@ -122,11 +122,11 @@
[self.leftButton.layer setCornerRadius:5];
self.leftButton.clipsToBounds = YES;
self.leftButton.backgroundColor = kRiotColorGreen;
self.leftButton.backgroundColor = kRiotColorBlue;
[self.rightButton.layer setCornerRadius:5];
self.rightButton.clipsToBounds = YES;
self.rightButton.backgroundColor = kRiotColorGreen;
self.rightButton.backgroundColor = kRiotColorBlue;
}
- (UIStatusBarStyle)preferredStatusBarStyle
@@ -150,7 +150,7 @@
if (_group)
{
// Force a screen refresh
[self refreshDisplayWithGroup:[self.mxSession groupWithGroupId:_group.groupId]];
[self didUpdateGroupDetails:nil];
// Trigger a refresh on the group summary.
[self.mxSession updateGroupSummary:_group success:nil failure:^(NSError *error) {
@@ -158,6 +158,18 @@
NSLog(@"[GroupHomeViewController] viewWillAppear: group summary update failed %@", _group.groupId);
}];
// Trigger a refresh on the group members (ignore here the invited users).
[self.mxSession updateGroupUsers:_group success:nil failure:^(NSError *error) {
NSLog(@"[GroupHomeViewController] viewWillAppear: group members update failed %@", _group.groupId);
}];
// Trigger a refresh on the group rooms.
[self.mxSession updateGroupRooms:_group success:nil failure:^(NSError *error) {
NSLog(@"[GroupHomeViewController] viewWillAppear: group rooms update failed %@", _group.groupId);
}];
}
}
@@ -202,7 +214,9 @@
{
[self cancelRegistrationOnGroupChangeNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didUpdateGroupSummary:) name:kMXSessionDidUpdateGroupSummaryNotification object:self.mxSession];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didUpdateGroupDetails:) name:kMXSessionDidUpdateGroupSummaryNotification object:self.mxSession];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didUpdateGroupDetails:) name:kMXSessionDidUpdateGroupUsersNotification object:self.mxSession];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didUpdateGroupDetails:) name:kMXSessionDidUpdateGroupRoomsNotification object:self.mxSession];
}
- (void)cancelRegistrationOnGroupChangeNotifications
@@ -211,9 +225,12 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)didUpdateGroupSummary:(NSNotification *)notif
- (void)didUpdateGroupDetails:(NSNotification *)notif
{
[self refreshDisplayWithGroup:[self.mxSession groupWithGroupId:_group.groupId]];
// Update here the displayed group instance with the one stored in the session (if any).
MXGroup *group = [self.mxSession groupWithGroupId:_group.groupId];
[self refreshDisplayWithGroup:(group ? group : _group)];
}
- (void)refreshDisplayWithGroup:(MXGroup*)group
@@ -234,6 +251,40 @@
_groupDescription.text = _group.summary.profile.shortDescription;
if (_group.users.totalUserCountEstimate == 1)
{
_membersCountLabel.text = NSLocalizedStringFromTable(@"group_home_one_member_format", @"Vector", nil);
_membersCountContainer.hidden = NO;
}
else if (_group.users.totalUserCountEstimate > 1)
{
_membersCountLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"group_home_multi_members_format", @"Vector", nil), _group.users.totalUserCountEstimate];
_membersCountContainer.hidden = NO;
}
else
{
_membersCountLabel.text = nil;
_membersCountContainer.hidden = YES;
}
if (_group.rooms.totalRoomCountEstimate == 1)
{
_roomsCountLabel.text = NSLocalizedStringFromTable(@"group_home_one_room_format", @"Vector", nil);
_roomsCountContainer.hidden = NO;
}
else if (_group.rooms.totalRoomCountEstimate > 1)
{
_roomsCountLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"group_home_multi_rooms_format", @"Vector", nil), _group.rooms.totalRoomCountEstimate];
_roomsCountContainer.hidden = NO;
}
else
{
_roomsCountLabel.text = nil;
_roomsCountContainer.hidden = YES;
}
_countsContainer.hidden = (_membersCountContainer.isHidden && _roomsCountContainer.isHidden);
if (_group.membership == MXMembershipInvite)
{
self.inviteContainer.hidden = NO;
@@ -252,7 +303,7 @@
}
}
self.inviteLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"group_invitation_format", @"Vector", nil), _group.inviter];
self.inviteLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"group_invitation_format", @"Vector", nil), inviter];
}
else
{
@@ -303,6 +354,10 @@
_groupLongDescription.text = nil;
_separatorViewTopConstraint.constant = 0;
_membersCountLabel.text = nil;
_roomsCountLabel.text = nil;
_countsContainer.hidden = YES;
}
// Round image view for thumbnail
@@ -320,7 +375,7 @@
{
if (sender == self.rightButton)
{
// Decline the invite
// Accept the invite
__weak typeof(self) weakSelf = self;
[self startActivityIndicator];
@@ -353,7 +408,7 @@
}
else if (sender == self.leftButton)
{
// Accept the invite
// Decline the invite
__weak typeof(self) weakSelf = self;
[self startActivityIndicator];
+104 -22
View File
@@ -14,6 +14,7 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GroupHomeViewController">
<connections>
<outlet property="buttonsContainer" destination="EqU-yd-Ntb" id="SpC-UD-z6O"/>
<outlet property="countsContainer" destination="hkg-GN-Tej" id="cWs-i0-bVQ"/>
<outlet property="groupAvatar" destination="ehl-88-DfA" id="bKF-ij-hsH"/>
<outlet property="groupAvatarMask" destination="kYc-LP-Nip" id="u4M-Yf-wQy"/>
<outlet property="groupDescription" destination="jXh-2B-Bso" id="daH-OS-1BL"/>
@@ -24,7 +25,11 @@
<outlet property="inviteLabel" destination="UHk-6Y-MSO" id="JO0-8a-h78"/>
<outlet property="leftButton" destination="jTB-nL-KcP" id="iPW-qf-LbT"/>
<outlet property="mainHeaderContainer" destination="AKb-7n-nhQ" id="RUh-ZE-ul2"/>
<outlet property="membersCountContainer" destination="PgZ-iJ-yNZ" id="YKC-dF-QOE"/>
<outlet property="membersCountLabel" destination="qJ8-8X-Xzm" id="LRd-io-EFg"/>
<outlet property="rightButton" destination="xfk-oh-9db" id="JGC-zW-2vD"/>
<outlet property="roomsCountContainer" destination="xkH-zg-3jY" id="xo8-mh-emk"/>
<outlet property="roomsCountLabel" destination="XuG-pe-Lzn" id="Bbg-xa-lxp"/>
<outlet property="separatorView" destination="dlP-kX-cll" id="TMm-OR-eFJ"/>
<outlet property="separatorViewTopConstraint" destination="tSb-HY-8nq" id="jM0-gg-k1g"/>
<outlet property="view" destination="1TG-Rn-axS" id="WxL-e2-rVK"/>
@@ -36,10 +41,10 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AKb-7n-nhQ">
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="106.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kYc-LP-Nip">
<rect key="frame" x="8" y="10" width="80" height="80"/>
<rect key="frame" x="8" y="5" width="80" height="80"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="ehl-88-DfA" customClass="MXKImageView">
<rect key="frame" x="10" y="10" width="60" height="60"/>
@@ -60,35 +65,108 @@
<constraint firstAttribute="width" constant="80" id="zV6-TZ-Oan"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5UX-lR-Ac5">
<rect key="frame" x="92" y="18" width="45" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5UX-lR-Ac5">
<rect key="frame" x="92" y="18" width="43.5" height="20.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jXh-2B-Bso">
<rect key="frame" x="92" y="45.5" width="36" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jXh-2B-Bso">
<rect key="frame" x="92" y="44.5" width="37.5" height="18"/>
<accessibility key="accessibilityConfiguration" identifier="RoomTopic"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleSubhead"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mKE-ro-fuy">
<rect key="frame" x="87" y="15" width="55" height="26.5"/>
<rect key="frame" x="87" y="15" width="53.5" height="25.5"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration" identifier="ContactDetailsVCNameLabelMask"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hkg-GN-Tej">
<rect key="frame" x="88" y="78.5" width="279" height="20"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PgZ-iJ-yNZ">
<rect key="frame" x="0.0" y="0.0" width="86.5" height="20"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tab_groups_selected.png" translatesAutoresizingMaskIntoConstraints="NO" id="YI6-IK-PkI">
<rect key="frame" x="4" y="2.5" width="15" height="15"/>
<constraints>
<constraint firstAttribute="width" secondItem="YI6-IK-PkI" secondAttribute="height" multiplier="1:1" id="azu-dv-Abo"/>
<constraint firstAttribute="width" constant="15" id="zka-UU-93t"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 members" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qJ8-8X-Xzm">
<rect key="frame" x="23" y="3.5" width="63.5" height="14"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption1"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" secondItem="qJ8-8X-Xzm" secondAttribute="height" constant="6" id="Aao-5S-pox"/>
<constraint firstItem="qJ8-8X-Xzm" firstAttribute="leading" secondItem="YI6-IK-PkI" secondAttribute="trailing" constant="4" id="NOr-CS-0zv"/>
<constraint firstAttribute="trailing" secondItem="qJ8-8X-Xzm" secondAttribute="trailing" id="ZwB-qD-I8A"/>
<constraint firstItem="YI6-IK-PkI" firstAttribute="leading" secondItem="PgZ-iJ-yNZ" secondAttribute="leading" constant="4" id="bkS-hZ-KQv"/>
<constraint firstItem="qJ8-8X-Xzm" firstAttribute="centerY" secondItem="PgZ-iJ-yNZ" secondAttribute="centerY" id="jdb-bW-4Oy"/>
<constraint firstItem="YI6-IK-PkI" firstAttribute="centerY" secondItem="PgZ-iJ-yNZ" secondAttribute="centerY" id="vCJ-Yz-2eu"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xkH-zg-3jY">
<rect key="frame" x="94.5" y="0.0" width="68" height="20"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tab_rooms.png" translatesAutoresizingMaskIntoConstraints="NO" id="aZ9-Gu-utv">
<rect key="frame" x="4" y="2.5" width="15" height="15"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="3df-1e-XMS"/>
<constraint firstAttribute="width" secondItem="aZ9-Gu-utv" secondAttribute="height" multiplier="1:1" id="hnv-qQ-D9X"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 rooms" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XuG-pe-Lzn">
<rect key="frame" x="22" y="3.5" width="46" height="14.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption1"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="XuG-pe-Lzn" secondAttribute="trailing" id="021-fG-7GQ"/>
<constraint firstItem="XuG-pe-Lzn" firstAttribute="leading" secondItem="aZ9-Gu-utv" secondAttribute="trailing" constant="3" id="3p6-oX-xHD"/>
<constraint firstItem="XuG-pe-Lzn" firstAttribute="centerY" secondItem="xkH-zg-3jY" secondAttribute="centerY" id="GvC-ox-7fH"/>
<constraint firstItem="aZ9-Gu-utv" firstAttribute="leading" secondItem="xkH-zg-3jY" secondAttribute="leading" constant="4" id="bbe-FJ-udn"/>
<constraint firstItem="aZ9-Gu-utv" firstAttribute="centerY" secondItem="xkH-zg-3jY" secondAttribute="centerY" id="fwX-jo-52x"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="PgZ-iJ-yNZ" firstAttribute="leading" secondItem="hkg-GN-Tej" secondAttribute="leading" id="1Hr-5B-w2S"/>
<constraint firstItem="PgZ-iJ-yNZ" firstAttribute="width" relation="lessThanOrEqual" secondItem="hkg-GN-Tej" secondAttribute="width" multiplier="0.5" id="1pU-62-CzD"/>
<constraint firstItem="xkH-zg-3jY" firstAttribute="top" secondItem="hkg-GN-Tej" secondAttribute="top" id="46J-yD-cKS"/>
<constraint firstAttribute="height" secondItem="PgZ-iJ-yNZ" secondAttribute="height" id="5AD-Zs-aXU"/>
<constraint firstItem="xkH-zg-3jY" firstAttribute="leading" secondItem="PgZ-iJ-yNZ" secondAttribute="trailing" constant="8" id="Cds-AK-yuk"/>
<constraint firstItem="xkH-zg-3jY" firstAttribute="width" relation="lessThanOrEqual" secondItem="hkg-GN-Tej" secondAttribute="width" multiplier="0.5" id="Jjt-EP-UFP"/>
<constraint firstItem="xkH-zg-3jY" firstAttribute="height" secondItem="PgZ-iJ-yNZ" secondAttribute="height" id="JkC-AN-RWn"/>
<constraint firstItem="PgZ-iJ-yNZ" firstAttribute="top" secondItem="hkg-GN-Tej" secondAttribute="top" id="ZyS-oe-dDv"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="xkH-zg-3jY" secondAttribute="trailing" id="aLt-Y9-7ZP"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="jXh-2B-Bso" secondAttribute="bottom" constant="8" id="6hl-pO-UX7"/>
<constraint firstAttribute="bottom" secondItem="hkg-GN-Tej" secondAttribute="bottom" constant="8" id="04P-82-XhO"/>
<constraint firstItem="hkg-GN-Tej" firstAttribute="top" secondItem="jXh-2B-Bso" secondAttribute="bottom" constant="16" id="FVO-09-Pc5"/>
<constraint firstItem="5UX-lR-Ac5" firstAttribute="top" secondItem="AKb-7n-nhQ" secondAttribute="top" constant="18" id="FlH-ol-0TP"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="kYc-LP-Nip" secondAttribute="bottom" priority="750" constant="10" id="G39-KZ-VFJ"/>
<constraint firstItem="mKE-ro-fuy" firstAttribute="centerX" secondItem="5UX-lR-Ac5" secondAttribute="centerX" id="G8w-Th-eCj"/>
<constraint firstItem="kYc-LP-Nip" firstAttribute="top" secondItem="AKb-7n-nhQ" secondAttribute="top" constant="10" id="IJD-FB-fWm"/>
<constraint firstAttribute="bottom" secondItem="kYc-LP-Nip" secondAttribute="bottom" priority="250" constant="10" id="Kkx-2w-Yo2"/>
<constraint firstItem="kYc-LP-Nip" firstAttribute="top" secondItem="AKb-7n-nhQ" secondAttribute="top" constant="5" id="IJD-FB-fWm"/>
<constraint firstItem="jXh-2B-Bso" firstAttribute="leading" secondItem="kYc-LP-Nip" secondAttribute="trailing" constant="4" id="Ot2-58-G82"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="jXh-2B-Bso" secondAttribute="trailing" constant="8" id="QeR-3r-KrK"/>
<constraint firstAttribute="trailing" secondItem="hkg-GN-Tej" secondAttribute="trailing" constant="8" id="RHn-bj-Dld"/>
<constraint firstItem="kYc-LP-Nip" firstAttribute="leading" secondItem="AKb-7n-nhQ" secondAttribute="leading" constant="8" id="Y6V-cp-eRq"/>
<constraint firstItem="hkg-GN-Tej" firstAttribute="leading" secondItem="kYc-LP-Nip" secondAttribute="trailing" id="Z8J-Tk-BGi"/>
<constraint firstItem="5UX-lR-Ac5" firstAttribute="leading" secondItem="kYc-LP-Nip" secondAttribute="trailing" constant="4" id="fxX-Ak-zfG"/>
<constraint firstItem="mKE-ro-fuy" firstAttribute="height" secondItem="5UX-lR-Ac5" secondAttribute="height" constant="5" id="jtN-q7-iqn"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5UX-lR-Ac5" secondAttribute="trailing" constant="8" id="k8p-VY-5zr"/>
@@ -98,17 +176,17 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nR4-eE-qJo">
<rect key="frame" x="0.0" y="100" width="375" height="97.5"/>
<rect key="frame" x="0.0" y="106.5" width="375" height="105.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UHk-6Y-MSO">
<rect key="frame" x="167" y="8" width="41" height="19.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UHk-6Y-MSO">
<rect key="frame" x="167" y="15" width="42" height="20.5"/>
<accessibility key="accessibilityConfiguration" identifier="PreviewLabel"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EqU-yd-Ntb" userLabel="buttonsContainer">
<rect key="frame" x="30" y="47.5" width="315" height="30"/>
<rect key="frame" x="30" y="55.5" width="315" height="30"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jTB-nL-KcP" userLabel="Left Button">
<rect key="frame" x="0.0" y="0.0" width="151" height="30"/>
@@ -155,24 +233,24 @@
<constraint firstItem="EqU-yd-Ntb" firstAttribute="top" secondItem="UHk-6Y-MSO" secondAttribute="bottom" constant="20" id="T4l-2m-fsZ"/>
<constraint firstAttribute="trailing" secondItem="EqU-yd-Ntb" secondAttribute="trailing" constant="30" id="cCk-lA-SDz"/>
<constraint firstItem="UHk-6Y-MSO" firstAttribute="centerX" secondItem="nR4-eE-qJo" secondAttribute="centerX" id="dlW-cX-D6T"/>
<constraint firstItem="UHk-6Y-MSO" firstAttribute="top" secondItem="nR4-eE-qJo" secondAttribute="top" constant="8" id="oNr-AR-g3d"/>
<constraint firstItem="UHk-6Y-MSO" firstAttribute="top" secondItem="nR4-eE-qJo" secondAttribute="top" constant="15" id="oNr-AR-g3d"/>
<constraint firstItem="UHk-6Y-MSO" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="nR4-eE-qJo" secondAttribute="leading" constant="31" id="r7D-qk-LEG"/>
<constraint firstAttribute="bottom" secondItem="EqU-yd-Ntb" secondAttribute="bottom" constant="20" id="zlf-mL-iWH"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dlP-kX-cll">
<rect key="frame" x="0.0" y="198" width="375" height="1"/>
<rect key="frame" x="0.0" y="204.5" width="375" height="1"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<accessibility key="accessibilityConfiguration" identifier="BottomBorderView"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="tUj-3s-NIW"/>
</constraints>
</view>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oUL-bJ-tfM">
<rect key="frame" x="8" y="199" width="359" height="460"/>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oUL-bJ-tfM">
<rect key="frame" x="8" y="205.5" width="359" height="453.5"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
@@ -196,4 +274,8 @@
<point key="canvasLocation" x="26.5" y="51.5"/>
</view>
</objects>
<resources>
<image name="tab_groups_selected.png" width="25" height="25"/>
<image name="tab_rooms.png" width="25" height="25"/>
</resources>
</document>
@@ -218,7 +218,7 @@
if (_group)
{
// Force refresh
[self refreshDisplayWithGroup:[self.mxSession groupWithGroupId:_group.groupId]];
[self didUpdateGroupUsers:nil];
// Trigger a refresh on the group members and the invited users.
[self.mxSession updateGroupUsers:_group success:nil failure:^(NSError *error) {
@@ -324,7 +324,10 @@
- (void)didUpdateGroupUsers:(NSNotification *)notif
{
[self refreshDisplayWithGroup:[self.mxSession groupWithGroupId:_group.groupId]];
// Update here the displayed group instance with the one stored in the session (if any).
MXGroup *group = [self.mxSession groupWithGroupId:_group.groupId];
[self refreshDisplayWithGroup:(group ? group : _group)];
}
- (void)refreshDisplayWithGroup:(MXGroup *)group
@@ -83,6 +83,10 @@
// Hide line separators of empty cells
self.groupsTableView.tableFooterView = [[UIView alloc] init];
// Enable self sizing cells
self.groupsTableView.rowHeight = UITableViewAutomaticDimension;
self.groupsTableView.estimatedRowHeight = 74;
// Observe UIApplicationDidEnterBackgroundNotification to refresh bubbles when app leaves the foreground state.
UIApplicationDidEnterBackgroundNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidEnterBackgroundNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {