Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #388 from matrix-org/groups
Browse files Browse the repository at this point in the history
Groups: self-management of membership of groups
  • Loading branch information
giomfo authored Dec 28, 2017
2 parents bb42832 + 0a84b82 commit c1802b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
4 changes: 0 additions & 4 deletions MatrixKit/Controllers/MXKGroupListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,6 @@ - (void)dataSource:(MXKDataSource *)dataSource didRemoveMatrixSession:(MXSession
}

#pragma mark - UITableView delegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [dataSource cellHeightAtIndexPath:indexPath];
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
Expand Down
6 changes: 3 additions & 3 deletions MatrixKit/Controllers/MXKGroupListViewController.xib
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down Expand Up @@ -33,7 +33,7 @@
<outlet property="delegate" destination="-1" id="ejZ-kN-jKv"/>
</connections>
</searchBar>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" keyboardDismissMode="interactive" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="orV-HH-88x">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" keyboardDismissMode="interactive" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="orV-HH-88x">
<rect key="frame" x="0.0" y="44" width="375" height="623"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</tableView>
Expand Down
8 changes: 0 additions & 8 deletions MatrixKit/Models/Group/MXKSessionGroupsDataSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@ extern NSString *const kMXKGroupCellIdentifier;
*/
- (NSIndexPath*)cellIndexPathWithGroupId:(NSString*)groupId;

/**
Get height of the cell at the given index.
@param indexPath the index of the cell in the table
@return the cell height
*/
- (CGFloat)cellHeightAtIndexPath:(NSIndexPath*)indexPath;

/**
Leave the group displayed at the provided path.
Expand Down
13 changes: 0 additions & 13 deletions MatrixKit/Models/Group/MXKSessionGroupsDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,6 @@ - (NSIndexPath*)cellIndexPathWithGroupId:(NSString*)groupId
return nil;
}

- (CGFloat)cellHeightAtIndexPath:(NSIndexPath*)indexPath
{
if (self.delegate)
{
id<MXKGroupCellDataStoring> cellData = [self cellDataAtIndex:indexPath];

Class<MXKCellRendering> class = [self.delegate cellViewClassForCellData:cellData];
return [class heightForCellData:cellData withMaximumWidth:0];
}

return 0;
}

#pragma mark - Groups processing

- (void)loadData
Expand Down
5 changes: 5 additions & 0 deletions MatrixKit/Views/MXKCellRendering.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
/**
Compute the height of the cell to display the passed data.
@TODO: To support correctly the dynamic fonts, we have to remove this method and
its use by enabling self sizing cells at the table view level.
When we create a self-sizing table view cell, we need to set the property `estimatedRowHeight` of the table view
and use constraints to define the cell’s size.
@param cellData the data object to render.
@param maxWidth the maximum available width.
@return the cell height
Expand Down

0 comments on commit c1802b5

Please sign in to comment.