mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 15:22:39 +00:00
Add space beta announce cell.
This commit is contained in:
parent
c3ea97b6a4
commit
a7dd15c797
4 changed files with 243 additions and 4 deletions
|
@ -1619,8 +1619,13 @@ Tap the + to start adding people.";
|
|||
// Mark: - Spaces
|
||||
|
||||
"space_feature_unavailable_title" = "Not available";
|
||||
"space_feature_unavailable_general_info" = "Spaces are only available in Beta on Web, desktop or Android";
|
||||
"space_feature_unavailable_general_info" = "Spaces are a beta feature, for now only available on web, desktop and Android.\n\n";
|
||||
"space_feature_unavailable_invite_info" = "You’re trying to manage a Space invite. Please use your computer to manage the space invite";
|
||||
"space_feature_unavailable_open_space" = "You’re trying to open a Space. Please use your computer to open the space";
|
||||
"space_feature_unavailable_space_link_info" = "You’re trying to open a link to a Space. Please use your computer to open the link";
|
||||
"space_feature_unavailable_share_link_action" = "Share link";
|
||||
"space_feature_unavailable_share_link_action" = "Send link";
|
||||
|
||||
"space_beta_announce_badge" = "BETA";
|
||||
"space_beta_announce_title" = "Meet Spaces";
|
||||
"space_beta_announce_subtitle" = "The new version of communities";
|
||||
"space_beta_announce_information" = "Spaces are new ways to group rooms and people. You can try them out now on Android, or on your computer.";
|
||||
|
|
|
@ -4494,7 +4494,23 @@ internal enum VectorL10n {
|
|||
internal static var socialLoginListTitleSignUp: String {
|
||||
return VectorL10n.tr("Vector", "social_login_list_title_sign_up")
|
||||
}
|
||||
/// Spaces are only available in Beta on Web, desktop or Android
|
||||
/// BETA
|
||||
internal static var spaceBetaAnnounceBadge: String {
|
||||
return VectorL10n.tr("Vector", "space_beta_announce_badge")
|
||||
}
|
||||
/// Spaces are new ways to group rooms and people. You can try them out now on Android, or on your computer.
|
||||
internal static var spaceBetaAnnounceInformation: String {
|
||||
return VectorL10n.tr("Vector", "space_beta_announce_information")
|
||||
}
|
||||
/// The new version of communities
|
||||
internal static var spaceBetaAnnounceSubtitle: String {
|
||||
return VectorL10n.tr("Vector", "space_beta_announce_subtitle")
|
||||
}
|
||||
/// Meet Spaces
|
||||
internal static var spaceBetaAnnounceTitle: String {
|
||||
return VectorL10n.tr("Vector", "space_beta_announce_title")
|
||||
}
|
||||
/// Spaces are a beta feature, for now only available on web, desktop and Android.\n\n
|
||||
internal static var spaceFeatureUnavailableGeneralInfo: String {
|
||||
return VectorL10n.tr("Vector", "space_feature_unavailable_general_info")
|
||||
}
|
||||
|
@ -4506,7 +4522,7 @@ internal enum VectorL10n {
|
|||
internal static var spaceFeatureUnavailableOpenSpace: String {
|
||||
return VectorL10n.tr("Vector", "space_feature_unavailable_open_space")
|
||||
}
|
||||
/// Share link
|
||||
/// Send link
|
||||
internal static var spaceFeatureUnavailableShareLinkAction: String {
|
||||
return VectorL10n.tr("Vector", "space_feature_unavailable_share_link_action")
|
||||
}
|
||||
|
|
94
Riot/Modules/Spaces/BetaAnnounceCell.swift
Normal file
94
Riot/Modules/Spaces/BetaAnnounceCell.swift
Normal file
|
@ -0,0 +1,94 @@
|
|||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import Reusable
|
||||
|
||||
@objc protocol BetaAnnounceCellDelegate: class {
|
||||
func betaAnnounceCellDidTapCloseButton(_ cell: BetaAnnounceCell)
|
||||
}
|
||||
|
||||
/// BetaAnnounceCell enables to show coming beta feature
|
||||
final class BetaAnnounceCell: UITableViewCell, Themable {
|
||||
|
||||
// MARK: - Constants
|
||||
|
||||
private enum Constants {
|
||||
static let cardBackgroundViewCornersRadius: CGFloat = 8.0
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
@IBOutlet private weak var cardBackgroundView: UIView!
|
||||
@IBOutlet private weak var closeButton: CloseButton!
|
||||
@IBOutlet private weak var badgeView: UIView!
|
||||
@IBOutlet private weak var badgeLabel: UILabel!
|
||||
@IBOutlet private weak var titleLabel: UILabel!
|
||||
@IBOutlet private weak var subtitleLabel: UILabel!
|
||||
@IBOutlet private weak var informationLabel: UILabel!
|
||||
|
||||
@objc weak var delegate: BetaAnnounceCellDelegate?
|
||||
|
||||
// MARK: - Life cycle
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
// Initialization code
|
||||
|
||||
self.badgeLabel.text = VectorL10n.spaceBetaAnnounceBadge
|
||||
self.titleLabel.text = VectorL10n.spaceBetaAnnounceTitle
|
||||
self.subtitleLabel.text = VectorL10n.spaceBetaAnnounceSubtitle
|
||||
self.informationLabel.text = VectorL10n.spaceBetaAnnounceInformation
|
||||
|
||||
self.badgeView.layer.masksToBounds = true
|
||||
self.cardBackgroundView.layer.masksToBounds = true
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
self.cardBackgroundView.layer.cornerRadius = Constants.cardBackgroundViewCornersRadius
|
||||
self.badgeView.layer.cornerRadius = self.badgeView.frame.height/2
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
func update(theme: Theme) {
|
||||
self.closeButton.update(theme: theme)
|
||||
self.titleLabel.textColor = theme.textPrimaryColor
|
||||
self.subtitleLabel.textColor = theme.textPrimaryColor
|
||||
self.informationLabel.textColor = theme.textSecondaryColor
|
||||
self.cardBackgroundView.backgroundColor = theme.baseColor
|
||||
self.contentView.backgroundColor = theme.backgroundColor
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction private func closeButtonAction(_ sender: Any) {
|
||||
self.delegate?.betaAnnounceCellDidTapCloseButton(self)
|
||||
}
|
||||
}
|
||||
|
||||
// Copy past from NibReusable in order to expose these methods to ObjC
|
||||
extension BetaAnnounceCell {
|
||||
@objc static var reuseIdentifier: String {
|
||||
return String(describing: self)
|
||||
}
|
||||
|
||||
@objc static var nib: UINib {
|
||||
return UINib(nibName: String(describing: self), bundle: Bundle(for: self))
|
||||
}
|
||||
}
|
124
Riot/Modules/Spaces/BetaAnnounceCell.xib
Normal file
124
Riot/Modules/Spaces/BetaAnnounceCell.xib
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="327" id="KGk-i7-Jjw" customClass="BetaAnnounceCell" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="331" height="327"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="331" height="327"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vuH-Jo-iN1">
|
||||
<rect key="frame" x="20" y="20" width="291" height="287"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aTW-9I-M53">
|
||||
<rect key="frame" x="15" y="15" width="46" height="19"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BETA" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Szn-LE-OSt">
|
||||
<rect key="frame" x="8" y="2" width="30" height="15"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" systemColor="secondarySystemBackgroundColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBlueColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="Szn-LE-OSt" secondAttribute="bottom" constant="2" id="Dz7-J1-Fd9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Szn-LE-OSt" secondAttribute="trailing" constant="8" id="KQR-Wz-FzB"/>
|
||||
<constraint firstItem="Szn-LE-OSt" firstAttribute="leading" secondItem="aTW-9I-M53" secondAttribute="leading" constant="8" id="Kwa-X4-z2j"/>
|
||||
<constraint firstItem="Szn-LE-OSt" firstAttribute="top" secondItem="aTW-9I-M53" secondAttribute="top" constant="2" id="TwD-zu-wYb"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kel-VV-C0f" customClass="CloseButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="235" y="8" width="44" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="44" id="BOd-JJ-paV"/>
|
||||
<constraint firstAttribute="height" constant="44" id="tdl-KN-AnH"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" image="close_button"/>
|
||||
<connections>
|
||||
<action selector="closeButtonAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="yXe-P8-tRC"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Meet Spaces" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aSK-Uf-CjE">
|
||||
<rect key="frame" x="15" y="49" width="261" height="24"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="246" verticalCompressionResistancePriority="749" text="The new version of communities" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vu4-y4-3xv">
|
||||
<rect key="frame" x="15" y="83" width="261" height="87.5"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Spaces are new ways to group rooms and people. You can try them out now on Android, or on your computer." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="npW-wC-Sab">
|
||||
<rect key="frame" x="15" y="185.5" width="261" height="81.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemGray5Color"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="aSK-Uf-CjE" secondAttribute="trailing" constant="15" id="1T1-zJ-fup"/>
|
||||
<constraint firstAttribute="bottom" secondItem="npW-wC-Sab" secondAttribute="bottom" constant="20" id="2lh-cu-mmZ"/>
|
||||
<constraint firstAttribute="trailing" secondItem="kel-VV-C0f" secondAttribute="trailing" constant="12" id="CH2-5q-a51"/>
|
||||
<constraint firstItem="npW-wC-Sab" firstAttribute="trailing" secondItem="vu4-y4-3xv" secondAttribute="trailing" id="D0P-in-hDZ"/>
|
||||
<constraint firstItem="aTW-9I-M53" firstAttribute="leading" secondItem="vuH-Jo-iN1" secondAttribute="leading" constant="15" id="EiU-im-VWT"/>
|
||||
<constraint firstItem="npW-wC-Sab" firstAttribute="leading" secondItem="vu4-y4-3xv" secondAttribute="leading" id="MD1-a4-T1w"/>
|
||||
<constraint firstItem="aSK-Uf-CjE" firstAttribute="top" secondItem="aTW-9I-M53" secondAttribute="bottom" constant="15" id="ey5-aY-n3y"/>
|
||||
<constraint firstItem="aSK-Uf-CjE" firstAttribute="leading" secondItem="aTW-9I-M53" secondAttribute="leading" id="ihA-R5-fpd"/>
|
||||
<constraint firstItem="kel-VV-C0f" firstAttribute="top" secondItem="vuH-Jo-iN1" secondAttribute="top" constant="8" id="ilP-Uo-PLu"/>
|
||||
<constraint firstItem="npW-wC-Sab" firstAttribute="top" secondItem="vu4-y4-3xv" secondAttribute="bottom" constant="15" id="nbH-gK-EU6"/>
|
||||
<constraint firstItem="vu4-y4-3xv" firstAttribute="trailing" secondItem="aSK-Uf-CjE" secondAttribute="trailing" id="ox3-Gb-PVP"/>
|
||||
<constraint firstItem="vu4-y4-3xv" firstAttribute="leading" secondItem="aSK-Uf-CjE" secondAttribute="leading" id="pCR-Vy-sbf"/>
|
||||
<constraint firstItem="aTW-9I-M53" firstAttribute="top" secondItem="vuH-Jo-iN1" secondAttribute="top" constant="15" id="pkY-VS-aCB"/>
|
||||
<constraint firstItem="vu4-y4-3xv" firstAttribute="top" secondItem="aSK-Uf-CjE" secondAttribute="bottom" constant="10" id="rg4-3n-uSE"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="vuH-Jo-iN1" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="20" id="Gt7-qL-q6P"/>
|
||||
<constraint firstAttribute="trailing" secondItem="vuH-Jo-iN1" secondAttribute="trailing" constant="20" id="RJH-X8-eno"/>
|
||||
<constraint firstItem="vuH-Jo-iN1" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="20" id="exf-6Z-LN6"/>
|
||||
<constraint firstAttribute="bottom" secondItem="vuH-Jo-iN1" secondAttribute="bottom" constant="20" id="tAe-8X-9LN"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
|
||||
<connections>
|
||||
<outlet property="badgeLabel" destination="Szn-LE-OSt" id="Ts2-O8-9Hm"/>
|
||||
<outlet property="badgeView" destination="aTW-9I-M53" id="6iH-DI-CN1"/>
|
||||
<outlet property="cardBackgroundView" destination="vuH-Jo-iN1" id="bJL-Ib-scJ"/>
|
||||
<outlet property="closeButton" destination="kel-VV-C0f" id="h6d-is-LyE"/>
|
||||
<outlet property="informationLabel" destination="npW-wC-Sab" id="caK-gm-MRm"/>
|
||||
<outlet property="subtitleLabel" destination="vu4-y4-3xv" id="uRJ-2B-3nP"/>
|
||||
<outlet property="titleLabel" destination="aSK-Uf-CjE" id="S09-2y-xWL"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-25.362318840579711" y="53.90625"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="close_button" width="16" height="16"/>
|
||||
<systemColor name="secondarySystemBackgroundColor">
|
||||
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemBlueColor">
|
||||
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemGray5Color">
|
||||
<color red="0.89803921568627454" green="0.89803921568627454" blue="0.91764705882352937" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
Loading…
Reference in a new issue