[Spaces] M10.9 Space menu #4494

- Update after code review
- Fixed some points of design review
This commit is contained in:
Gil Eluard 2021-08-12 11:23:47 +02:00
parent 36be956f0e
commit 109152777c
4 changed files with 16 additions and 16 deletions

View file

@ -284,12 +284,6 @@ extension SideMenuCoordinator: SpaceListCoordinatorDelegate {
}
func spaceListCoordinator(_ coordinator: SpaceListCoordinatorType, didPressMoreForSpaceWithId spaceId: String, from sourceView: UIView) {
// if UIDevice.current.isPhone {
// self.parameters.appNavigator.sideMenu.dismiss(animated: true) {
// self.showMenu(forSpaceWithId: spaceId, from: sourceView)
// }
// } else {
self.showMenu(forSpaceWithId: spaceId, from: sourceView)
// }
self.showMenu(forSpaceWithId: spaceId, from: sourceView)
}
}

View file

@ -56,7 +56,7 @@ final class SpaceListViewCell: UITableViewCell, Themable, NibReusable {
func fill(with viewData: SpaceListItemViewData) {
self.avatarView.fill(with: viewData.avatarViewData)
self.titleLabel.text = viewData.title
self.moreButton.isHidden = viewData.spaceId == "home"
self.moreButton.isHidden = viewData.spaceId == SpaceListViewModel.Constants.homeSpaceId
}
func update(theme: Theme) {

View file

@ -20,6 +20,12 @@ import Foundation
final class SpaceListViewModel: SpaceListViewModelType {
// MARK: - Constants
enum Constants {
static let homeSpaceId: String = "home"
}
// MARK: - Properties
// MARK: Private
@ -112,7 +118,7 @@ final class SpaceListViewModel: SpaceListViewModelType {
private func createHomeViewData() -> SpaceListItemViewData {
let avatarViewData = AvatarViewData(avatarUrl: nil, mediaManager: self.session.mediaManager, fallbackImage: .image(Asset.Images.spaceHomeIcon.image, .center))
let homeViewData = SpaceListItemViewData(spaceId: "home",
let homeViewData = SpaceListItemViewData(spaceId: Constants.homeSpaceId,
title: VectorL10n.spacesHomeSpaceTitle, avatarViewData: avatarViewData)
return homeViewData
}

View file

@ -26,7 +26,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="myk-vQ-luc">
<rect key="frame" x="72" y="16.5" width="294" height="39"/>
<rect key="frame" x="72" y="16" width="294" height="40"/>
<subviews>
<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="3Mp-yr-jUa">
<rect key="frame" x="0.0" y="0.0" width="294" height="17"/>
@ -35,7 +35,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="subtitle" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Flc-Ew-aDd">
<rect key="frame" x="0.0" y="22" width="294" height="17"/>
<rect key="frame" x="0.0" y="23" width="294" height="17"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -43,7 +43,6 @@
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Flc-Ew-aDd" firstAttribute="top" secondItem="3Mp-yr-jUa" secondAttribute="bottom" constant="5" id="ASf-zc-g5A"/>
<constraint firstItem="Flc-Ew-aDd" firstAttribute="leading" secondItem="myk-vQ-luc" secondAttribute="leading" id="B6U-tJ-MC9"/>
<constraint firstAttribute="trailing" secondItem="3Mp-yr-jUa" secondAttribute="trailing" id="PPu-BD-UVo"/>
<constraint firstAttribute="trailing" secondItem="Flc-Ew-aDd" secondAttribute="trailing" id="RHK-rK-kat"/>
@ -53,7 +52,7 @@
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dxd-y5-bn4">
<rect key="frame" x="374" y="24" width="24" height="24"/>
<rect key="frame" x="374" y="16" width="24" height="24"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="TTq-xS-O71"/>
@ -70,7 +69,7 @@
</connections>
</button>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="TI7-FD-nIm">
<rect key="frame" x="0.0" y="71.5" width="414" height="720.5"/>
<rect key="frame" x="0.0" y="72" width="414" height="720"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="Y6W-OH-hqX" id="vqu-Hq-JFO"/>
@ -82,12 +81,13 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="dxd-y5-bn4" secondAttribute="trailing" constant="16" id="3FU-wC-Uy7"/>
<constraint firstItem="dxd-y5-bn4" firstAttribute="top" secondItem="aSn-OV-epF" secondAttribute="top" id="3zz-61-anc"/>
<constraint firstItem="aSn-OV-epF" firstAttribute="width" secondItem="aSn-OV-epF" secondAttribute="height" multiplier="1:1" id="6ng-Dc-MPf"/>
<constraint firstItem="vDu-zF-Fre" firstAttribute="bottom" secondItem="TI7-FD-nIm" secondAttribute="bottom" constant="16" id="8cn-Zi-aY3"/>
<constraint firstItem="dxd-y5-bn4" firstAttribute="centerY" secondItem="myk-vQ-luc" secondAttribute="centerY" id="CFc-48-0qy"/>
<constraint firstItem="myk-vQ-luc" firstAttribute="top" secondItem="aSn-OV-epF" secondAttribute="top" id="AIx-JH-kIS"/>
<constraint firstItem="myk-vQ-luc" firstAttribute="bottom" secondItem="aSn-OV-epF" secondAttribute="bottom" id="FOz-6J-q28"/>
<constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="TI7-FD-nIm" secondAttribute="trailing" id="MaJ-pd-2JV"/>
<constraint firstItem="dxd-y5-bn4" firstAttribute="leading" secondItem="myk-vQ-luc" secondAttribute="trailing" constant="8" id="NAU-vk-aWw"/>
<constraint firstItem="myk-vQ-luc" firstAttribute="centerY" secondItem="aSn-OV-epF" secondAttribute="centerY" id="W6I-xF-Rl2"/>
<constraint firstItem="myk-vQ-luc" firstAttribute="leading" secondItem="aSn-OV-epF" secondAttribute="trailing" constant="16" id="c15-Gj-GPi"/>
<constraint firstItem="TI7-FD-nIm" firstAttribute="top" secondItem="myk-vQ-luc" secondAttribute="bottom" constant="16" id="dQc-iP-twv"/>
<constraint firstItem="aSn-OV-epF" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="16" id="hem-oS-VnE"/>