mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Update strings and add localise. Use theme v2.
This commit is contained in:
parent
94b996fb12
commit
b71649e6ca
4 changed files with 59 additions and 21 deletions
|
@ -245,6 +245,10 @@ Tap the + to start adding people.";
|
|||
"contacts_address_book_permission_denied_alert_message" = "To enable contacts, go to your device settings.";
|
||||
"contacts_user_directory_section" = "USER DIRECTORY";
|
||||
"contacts_user_directory_offline_section" = "USER DIRECTORY (offline)";
|
||||
"contacts_access_footer_title" = "Start by listing your contacts";
|
||||
"contacts_access_footer_description" = "Let %@ show your contacts so you can quickly start chatting with those you know best.";
|
||||
"contacts_access_footer_button_title" = "Allow contacts access";
|
||||
"contacts_access_footer_footer" = "This can be disabled anytime from settings.";
|
||||
|
||||
// Chat participants
|
||||
"room_participants_title" = "Participants";
|
||||
|
|
|
@ -542,6 +542,22 @@ internal enum VectorL10n {
|
|||
internal static var collapse: String {
|
||||
return VectorL10n.tr("Vector", "collapse")
|
||||
}
|
||||
/// Allow contacts access
|
||||
internal static var contactsAccessFooterButtonTitle: String {
|
||||
return VectorL10n.tr("Vector", "contacts_access_footer_button_title")
|
||||
}
|
||||
/// Let %@ show your contacts so you can quickly start chatting with those you know best.
|
||||
internal static func contactsAccessFooterDescription(_ p1: String) -> String {
|
||||
return VectorL10n.tr("Vector", "contacts_access_footer_description", p1)
|
||||
}
|
||||
/// This can be disabled anytime from settings.
|
||||
internal static var contactsAccessFooterFooter: String {
|
||||
return VectorL10n.tr("Vector", "contacts_access_footer_footer")
|
||||
}
|
||||
/// Start by listing your contacts
|
||||
internal static var contactsAccessFooterTitle: String {
|
||||
return VectorL10n.tr("Vector", "contacts_access_footer_title")
|
||||
}
|
||||
/// Matrix users only
|
||||
internal static var contactsAddressBookMatrixUsersToggle: String {
|
||||
return VectorL10n.tr("Vector", "contacts_address_book_matrix_users_toggle")
|
||||
|
|
|
@ -24,6 +24,8 @@ import Reusable
|
|||
@objcMembers
|
||||
class RequestContactsAccessFooterView: UIView, NibLoadable, Themable {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
weak var delegate: RequestContactsAccessFooterViewDelegate?
|
||||
|
||||
@IBOutlet weak var containerView: UIView!
|
||||
|
@ -45,21 +47,34 @@ class RequestContactsAccessFooterView: UIView, NibLoadable, Themable {
|
|||
|
||||
containerView.layer.cornerRadius = 8
|
||||
requestAccessButton.layer.cornerRadius = 8
|
||||
|
||||
titleLabel.text = VectorL10n.contactsAccessFooterTitle
|
||||
descriptionLabel.text = VectorL10n.contactsAccessFooterDescription(BuildSettings.bundleDisplayName)
|
||||
requestAccessButton.setTitle(VectorL10n.contactsAccessFooterButtonTitle, for: .normal)
|
||||
footerLabel.text = VectorL10n.contactsAccessFooterFooter
|
||||
}
|
||||
|
||||
func update(theme: Theme) {
|
||||
tintColor = theme.tintColor
|
||||
tintColor = theme.colors.accent
|
||||
|
||||
containerView.backgroundColor = theme.textQuinaryColor
|
||||
containerView.backgroundColor = theme.colors.quinaryContent
|
||||
|
||||
titleLabel.textColor = theme.textPrimaryColor
|
||||
descriptionLabel.textColor = theme.textSecondaryColor
|
||||
footerLabel.textColor = theme.textTertiaryColor
|
||||
titleLabel.font = theme.fonts.bodySB
|
||||
titleLabel.textColor = theme.colors.primaryContent
|
||||
|
||||
requestAccessButton.backgroundColor = theme.tintColor
|
||||
requestAccessButton.setTitleColor(theme.backgroundColor, for: .normal)
|
||||
descriptionLabel.font = theme.fonts.body
|
||||
descriptionLabel.textColor = theme.colors.secondaryContent
|
||||
|
||||
requestAccessButton.titleLabel?.font = theme.fonts.body
|
||||
requestAccessButton.backgroundColor = theme.colors.accent
|
||||
requestAccessButton.setTitleColor(theme.colors.background, for: .normal)
|
||||
|
||||
footerLabel.font = theme.fonts.footnote.withSize(13)
|
||||
footerLabel.textColor = theme.colors.tertiaryContent
|
||||
}
|
||||
|
||||
// MARK: - Action
|
||||
|
||||
@IBAction private func requestContactsAccess(_ sender: Any) {
|
||||
delegate?.didRequestContactsAccess()
|
||||
}
|
||||
|
|
|
@ -12,39 +12,42 @@
|
|||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="RequestContactsAccessFooterView" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="385"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="424"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="67f-7H-bSH">
|
||||
<rect key="frame" x="16" y="22.5" width="288" height="346.5"/>
|
||||
<rect key="frame" x="16" y="45.5" width="288" height="362.5"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="contacts_request_facepile" translatesAutoresizingMaskIntoConstraints="NO" id="q3p-2U-JA5">
|
||||
<rect key="frame" x="89" y="40" width="110" height="46"/>
|
||||
<rect key="frame" x="89" y="46" width="110" height="46"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Start by listing your friends" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9oC-ce-hpT">
|
||||
<rect key="frame" x="20" y="126" width="248" height="21"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Start by listing your contacts" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9oC-ce-hpT">
|
||||
<rect key="frame" x="20" y="138" width="248" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Let Element show your contacts so you can quickly start chatting with those you know best." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B3j-1i-EAf">
|
||||
<rect key="frame" x="20" y="155" width="248" height="61"/>
|
||||
<rect key="frame" x="20" y="171" width="248" height="61"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="v93-cs-jXa" customClass="CustomRoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="16" y="241" width="256" height="45"/>
|
||||
<rect key="frame" x="16" y="257" width="256" height="45"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="45" id="Spc-d4-SvP"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Allow access to contacts"/>
|
||||
<state key="normal" title="Allow contacts access"/>
|
||||
<connections>
|
||||
<action selector="requestContactsAccess:" destination="iN0-l3-epB" eventType="touchUpInside" id="XLO-8r-P8S"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Your contacts will not be stored or shared without your permission." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0A6-6s-nu6">
|
||||
<rect key="frame" x="20" y="298" width="248" height="31.5"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="This can be disabled anytime from settings" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0A6-6s-nu6">
|
||||
<rect key="frame" x="20" y="314" width="248" height="31.5"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="29" id="MZF-wd-sd6"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
|
@ -53,7 +56,7 @@
|
|||
<color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="0A6-6s-nu6" firstAttribute="top" secondItem="v93-cs-jXa" secondAttribute="bottom" constant="12" id="9zY-sf-Hrg"/>
|
||||
<constraint firstItem="q3p-2U-JA5" firstAttribute="top" secondItem="67f-7H-bSH" secondAttribute="top" constant="40" id="Bpl-IE-fhm"/>
|
||||
<constraint firstItem="q3p-2U-JA5" firstAttribute="top" secondItem="67f-7H-bSH" secondAttribute="top" constant="46" id="Bpl-IE-fhm"/>
|
||||
<constraint firstAttribute="trailing" secondItem="9oC-ce-hpT" secondAttribute="trailing" constant="20" symbolic="YES" id="D9c-Dn-jPU"/>
|
||||
<constraint firstAttribute="bottom" secondItem="0A6-6s-nu6" secondAttribute="bottom" constant="17" id="EYu-Qu-iQn"/>
|
||||
<constraint firstAttribute="trailing" secondItem="B3j-1i-EAf" secondAttribute="trailing" constant="20" symbolic="YES" id="Hg6-yF-XYk"/>
|
||||
|
@ -62,12 +65,12 @@
|
|||
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="343" id="Ty6-Fa-X0Y"/>
|
||||
<constraint firstItem="v93-cs-jXa" firstAttribute="leading" secondItem="67f-7H-bSH" secondAttribute="leading" constant="16" id="aF8-bI-HgQ"/>
|
||||
<constraint firstItem="9oC-ce-hpT" firstAttribute="leading" secondItem="67f-7H-bSH" secondAttribute="leading" constant="20" symbolic="YES" id="bli-Ms-T40"/>
|
||||
<constraint firstItem="B3j-1i-EAf" firstAttribute="top" secondItem="9oC-ce-hpT" secondAttribute="bottom" constant="8" symbolic="YES" id="dAh-bo-3yO"/>
|
||||
<constraint firstItem="B3j-1i-EAf" firstAttribute="top" secondItem="9oC-ce-hpT" secondAttribute="bottom" constant="12" id="dAh-bo-3yO"/>
|
||||
<constraint firstItem="q3p-2U-JA5" firstAttribute="centerX" secondItem="67f-7H-bSH" secondAttribute="centerX" id="giT-QS-qOz"/>
|
||||
<constraint firstAttribute="trailing" secondItem="v93-cs-jXa" secondAttribute="trailing" constant="16" id="mWk-gL-jIf"/>
|
||||
<constraint firstItem="B3j-1i-EAf" firstAttribute="leading" secondItem="67f-7H-bSH" secondAttribute="leading" constant="20" symbolic="YES" id="pgw-mQ-EiG"/>
|
||||
<constraint firstItem="0A6-6s-nu6" firstAttribute="leading" secondItem="67f-7H-bSH" secondAttribute="leading" constant="20" symbolic="YES" id="r3U-zK-ma2"/>
|
||||
<constraint firstItem="9oC-ce-hpT" firstAttribute="top" secondItem="q3p-2U-JA5" secondAttribute="bottom" constant="40" id="s1P-kS-bhX"/>
|
||||
<constraint firstItem="9oC-ce-hpT" firstAttribute="top" secondItem="q3p-2U-JA5" secondAttribute="bottom" constant="46" id="s1P-kS-bhX"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
|
@ -87,7 +90,7 @@
|
|||
<outlet property="requestAccessButton" destination="v93-cs-jXa" id="ANT-X6-MXQ"/>
|
||||
<outlet property="titleLabel" destination="9oC-ce-hpT" id="rOi-fH-kO0"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="63.768115942028992" y="321.76339285714283"/>
|
||||
<point key="canvasLocation" x="63.768115942028992" y="308.70535714285711"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
|
|
Loading…
Reference in a new issue