SP1.2: Invite to Space in room landing element-ios#5225

- Check user permissions to invite people
This commit is contained in:
Gil Eluard
2022-01-26 10:17:42 +01:00
parent d23f24b9ce
commit fb89b0092e
7 changed files with 129 additions and 40 deletions
@@ -26,6 +26,12 @@ class OptionListViewCell: UITableViewCell, NibReusable {
@IBOutlet private weak var detailLabel: UILabel!
@IBOutlet private weak var selectionView: UIView!
@IBOutlet private weak var chevronView: UIImageView!
var isEnabled: Bool = true {
didSet {
self.contentView.alpha = isEnabled ? 1 : 0.3
}
}
// MARK: - Private
@@ -42,10 +48,12 @@ class OptionListViewCell: UITableViewCell, NibReusable {
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
if isEnabled {
super.setSelected(selected, animated: animated)
UIView.animate(withDuration: animated ? 0.2 : 0.0) {
self.selectionView.transform = selected ? .init(scaleX: 0.95, y: 0.95) : .identity
UIView.animate(withDuration: animated ? 0.2 : 0.0) {
self.selectionView.transform = selected ? .init(scaleX: 0.95, y: 0.95) : .identity
}
}
}
@@ -56,6 +64,7 @@ class OptionListViewCell: UITableViewCell, NibReusable {
self.titleLabel.text = viewData.title
self.detailLabel.text = viewData.detail
self.chevronView.image = viewData.accessoryImage?.withRenderingMode(.alwaysTemplate)
self.isEnabled = viewData.enabled
}
func update(theme: Theme) {