Fix minor UI issues

pull/376/head
Niels Andriesse 5 years ago
parent d4b745a322
commit dacbd3c52b

@ -85,8 +85,9 @@ final class OpenGroupSuggestionGrid : UIView, UICollectionViewDataSource, UIColl
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Cell.identifier, for: indexPath) as! Cell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Cell.identifier, for: indexPath) as! Cell
cell.showRightSeparator = (indexPath.row % 2 != 0) || (indexPath.row % 2 == 0 && indexPath.row == rooms.count - 1) let roomCount = min(rooms.count, 8)
cell.showBottomSeparator = (indexPath.row >= rooms.count - 2) cell.showRightSeparator = (indexPath.row % 2 != 0) || (indexPath.row % 2 == 0 && indexPath.row == roomCount - 1)
cell.showBottomSeparator = (indexPath.row >= roomCount - 2)
cell.room = rooms[indexPath.item] cell.room = rooms[indexPath.item]
return cell return cell
} }
@ -143,8 +144,8 @@ extension OpenGroupSuggestionGrid {
stackView.axis = .horizontal stackView.axis = .horizontal
stackView.spacing = Values.smallSpacing stackView.spacing = Values.smallSpacing
addSubview(stackView) addSubview(stackView)
stackView.center(in: self) stackView.center(.vertical, in: self)
stackView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor, constant: Values.smallSpacing).isActive = true stackView.pin(.leading, to: .leading, of: self, withInset: Values.smallSpacing)
trailingAnchor.constraint(greaterThanOrEqualTo: stackView.trailingAnchor, constant: Values.smallSpacing).isActive = true trailingAnchor.constraint(greaterThanOrEqualTo: stackView.trailingAnchor, constant: Values.smallSpacing).isActive = true
setUpSeparators() setUpSeparators()
} }

Loading…
Cancel
Save