mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Merge branch 'develop' into element_3556
This commit is contained in:
+40
-15
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="79A-qb-tmk">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="79A-qb-tmk">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -19,16 +17,16 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="asO-rj-82y">
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tIM-sl-gwE">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="412.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="527"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IlB-Ch-LEo">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="412.5"/>
|
||||
<rect key="frame" x="27.5" y="0.0" width="320" height="527"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="d5Y-pj-XsI">
|
||||
<rect key="frame" x="20" y="20" width="335" height="84"/>
|
||||
<rect key="frame" x="20" y="20" width="280" height="84"/>
|
||||
<string key="text">Verify this session from one of your others sessions, granting it access to encrypted messages.
|
||||
|
||||
Use the latest Riot on your other devices:</string>
|
||||
@@ -37,7 +35,7 @@ Use the latest Riot on your other devices:</string>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="ANK-XS-dY7">
|
||||
<rect key="frame" x="27.5" y="144" width="320" height="95.5"/>
|
||||
<rect key="frame" x="0.0" y="144" width="320" height="95.5"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="3at-ql-vhb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="160" height="95.5"/>
|
||||
@@ -85,19 +83,43 @@ Riot X for Android</string>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="or another cross-signing capable Matrix client" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rFM-AQ-wAB">
|
||||
<rect key="frame" x="20" y="259.5" width="335" height="14.5"/>
|
||||
<rect key="frame" x="20" y="259.5" width="280" height="14.5"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
|
||||
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="8oJ-o6-DLK">
|
||||
<rect key="frame" x="20" y="294" width="335" height="118.5"/>
|
||||
<rect key="frame" x="20" y="294" width="280" height="233"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dXT-cL-ukJ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="280" height="114.5"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Checking for other verification capabilities ..." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A4x-sK-d5C">
|
||||
<rect key="frame" x="20" y="10" width="240" height="38.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="16"/>
|
||||
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<activityIndicatorView opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" style="medium" translatesAutoresizingMaskIntoConstraints="NO" id="esP-Lt-anU">
|
||||
<rect key="frame" x="0.0" y="64.5" width="280" height="20"/>
|
||||
</activityIndicatorView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="esP-Lt-anU" firstAttribute="leading" secondItem="dXT-cL-ukJ" secondAttribute="leading" id="1Rg-vU-DJm"/>
|
||||
<constraint firstItem="A4x-sK-d5C" firstAttribute="top" secondItem="dXT-cL-ukJ" secondAttribute="top" constant="10" id="7We-Ox-BZt"/>
|
||||
<constraint firstItem="A4x-sK-d5C" firstAttribute="leading" secondItem="dXT-cL-ukJ" secondAttribute="leading" constant="20" id="FuM-Cv-7mT"/>
|
||||
<constraint firstAttribute="trailing" secondItem="A4x-sK-d5C" secondAttribute="trailing" constant="20" id="Lk0-BP-Fdw"/>
|
||||
<constraint firstAttribute="trailing" secondItem="esP-Lt-anU" secondAttribute="trailing" id="SJY-m2-DP4"/>
|
||||
<constraint firstItem="esP-Lt-anU" firstAttribute="top" secondItem="A4x-sK-d5C" secondAttribute="bottom" constant="16" id="Tif-UR-9I2"/>
|
||||
<constraint firstAttribute="bottom" secondItem="esP-Lt-anU" secondAttribute="bottom" constant="30" id="gcZ-sx-3Ff"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nf8-Ye-b9r">
|
||||
<rect key="frame" x="0.0" y="0.0" width="335" height="118.5"/>
|
||||
<rect key="frame" x="0.0" y="114.5" width="280" height="118.5"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OEt-k0-vgM" customClass="RoundedButton" customModule="Riot" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="10" width="335" height="44"/>
|
||||
<rect key="frame" x="0.0" y="10" width="280" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="7ws-Nc-I7y"/>
|
||||
</constraints>
|
||||
@@ -110,7 +132,7 @@ Riot X for Android</string>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="If you can't accessing an existing session" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Ou-cM-K9C">
|
||||
<rect key="frame" x="20" y="64" width="295" height="24.5"/>
|
||||
<rect key="frame" x="20" y="64" width="240" height="24.5"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
|
||||
<color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -189,6 +211,9 @@ Riot X for Android</string>
|
||||
<outlet property="mobileClientImageView" destination="P0P-X4-uSQ" id="WtT-ix-yq8"/>
|
||||
<outlet property="mobileClientLabel" destination="gLH-sE-KCq" id="jQ0-7U-mr8"/>
|
||||
<outlet property="recoverSecretsAdditionalInformationLabel" destination="4Ou-cM-K9C" id="80N-lF-x2L"/>
|
||||
<outlet property="recoverSecretsAvailabilityActivityIndicatorView" destination="esP-Lt-anU" id="4jv-GA-Hm9"/>
|
||||
<outlet property="recoverSecretsAvailabilityLoadingContainerView" destination="dXT-cL-ukJ" id="rBM-Hj-c3o"/>
|
||||
<outlet property="recoverSecretsAvailabilityLoadingLabel" destination="A4x-sK-d5C" id="n5k-IO-RkV"/>
|
||||
<outlet property="recoverSecretsButton" destination="OEt-k0-vgM" id="RHU-ps-4m7"/>
|
||||
<outlet property="recoverSecretsContainerView" destination="nf8-Ye-b9r" id="4az-pe-0Uc"/>
|
||||
</connections>
|
||||
|
||||
+16
-1
@@ -40,7 +40,9 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
|
||||
|
||||
@IBOutlet private weak var additionalInformationLabel: UILabel!
|
||||
|
||||
|
||||
@IBOutlet private weak var recoverSecretsAvailabilityLoadingContainerView: UIView!
|
||||
@IBOutlet private weak var recoverSecretsAvailabilityLoadingLabel: UILabel!
|
||||
@IBOutlet private weak var recoverSecretsAvailabilityActivityIndicatorView: UIActivityIndicatorView!
|
||||
@IBOutlet private weak var recoverSecretsContainerView: UIView!
|
||||
@IBOutlet private weak var recoverSecretsButton: RoundedButton!
|
||||
@IBOutlet private weak var recoverSecretsAdditionalInformationLabel: UILabel!
|
||||
@@ -102,6 +104,8 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
|
||||
self.mobileClientLabel.textColor = theme.textPrimaryColor
|
||||
self.mobileClientImageView.tintColor = theme.tintColor
|
||||
self.additionalInformationLabel.textColor = theme.textSecondaryColor
|
||||
self.recoverSecretsAvailabilityLoadingLabel.textColor = theme.textSecondaryColor
|
||||
self.recoverSecretsAvailabilityActivityIndicatorView.color = theme.tintColor
|
||||
}
|
||||
|
||||
private func registerThemeServiceDidChangeThemeNotification() {
|
||||
@@ -141,6 +145,8 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
|
||||
switch viewState {
|
||||
case .loading:
|
||||
self.renderLoading()
|
||||
case .secretsRecoveryCheckingAvailability(let text):
|
||||
self.renderSecretsRecoveryCheckingAvailability(withText: text)
|
||||
case .loaded(let viewData):
|
||||
self.renderLoaded(viewData: viewData)
|
||||
case .cancelled(let reason):
|
||||
@@ -156,6 +162,13 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
|
||||
self.activityPresenter.presentActivityIndicator(on: self.view, animated: true)
|
||||
}
|
||||
|
||||
private func renderSecretsRecoveryCheckingAvailability(withText text: String?) {
|
||||
self.recoverSecretsAvailabilityLoadingLabel.text = text
|
||||
self.recoverSecretsAvailabilityActivityIndicatorView.startAnimating()
|
||||
self.recoverSecretsAvailabilityLoadingContainerView.isHidden = false
|
||||
self.recoverSecretsContainerView.isHidden = true
|
||||
}
|
||||
|
||||
private func renderLoaded(viewData: KeyVerificationSelfVerifyWaitViewData) {
|
||||
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
|
||||
|
||||
@@ -180,6 +193,8 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
self.recoverSecretsAvailabilityLoadingContainerView.isHidden = true
|
||||
self.recoverSecretsAvailabilityActivityIndicatorView.stopAnimating()
|
||||
self.recoverSecretsContainerView.isHidden = hideRecoverSecrets
|
||||
self.recoverSecretsButton.setTitle(recoverSecretsButtonTitle, for: .normal)
|
||||
}
|
||||
|
||||
+27
-2
@@ -28,7 +28,7 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
|
||||
private let keyVerificationService: KeyVerificationService
|
||||
private let verificationManager: MXKeyVerificationManager
|
||||
private let isNewSignIn: Bool
|
||||
private let secretsRecoveryAvailability: SecretsRecoveryAvailability
|
||||
private var secretsRecoveryAvailability: SecretsRecoveryAvailability
|
||||
private var keyVerificationRequest: MXKeyVerificationRequest?
|
||||
|
||||
// MARK: Public
|
||||
@@ -62,7 +62,8 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
|
||||
switch self.secretsRecoveryAvailability {
|
||||
case .notAvailable:
|
||||
fatalError("Should not happen: When recovery is not available button is hidden")
|
||||
case .available(let secretsRecoveryMode): self.coordinatorDelegate?.keyVerificationSelfVerifyWaitViewModel(self, wantsToRecoverSecretsWith: secretsRecoveryMode)
|
||||
case .available(let secretsRecoveryMode):
|
||||
self.coordinatorDelegate?.keyVerificationSelfVerifyWaitViewModel(self, wantsToRecoverSecretsWith: secretsRecoveryMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,7 +86,31 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
|
||||
}, failure: { [weak self] error in
|
||||
self?.update(viewState: .error(error))
|
||||
})
|
||||
|
||||
continueLoadData()
|
||||
} else {
|
||||
// be sure that session has completed its first sync
|
||||
if session.state >= MXSessionStateRunning {
|
||||
continueLoadData()
|
||||
} else {
|
||||
// show loader
|
||||
self.update(viewState: .secretsRecoveryCheckingAvailability(VectorL10n.deviceVerificationSelfVerifyWaitRecoverSecretsCheckingAvailability))
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(sessionStateChanged), name: .mxSessionStateDidChange, object: session)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
private func sessionStateChanged() {
|
||||
if session.state >= MXSessionStateRunning {
|
||||
NotificationCenter.default.removeObserver(self, name: .mxSessionStateDidChange, object: session)
|
||||
continueLoadData()
|
||||
}
|
||||
}
|
||||
|
||||
private func continueLoadData() {
|
||||
// update availability again
|
||||
self.secretsRecoveryAvailability = session.crypto.recoveryService.vc_availability
|
||||
|
||||
let viewData = KeyVerificationSelfVerifyWaitViewData(isNewSignIn: self.isNewSignIn, secretsRecoveryAvailability: self.secretsRecoveryAvailability)
|
||||
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ struct KeyVerificationSelfVerifyWaitViewData {
|
||||
/// KeyVerificationSelfVerifyWaitViewController view state
|
||||
enum KeyVerificationSelfVerifyWaitViewState {
|
||||
case loading
|
||||
case secretsRecoveryCheckingAvailability(_ text: String?)
|
||||
case loaded(_ viewData: KeyVerificationSelfVerifyWaitViewData)
|
||||
case cancelled(MXTransactionCancelCode)
|
||||
case cancelledByMe(MXTransactionCancelCode)
|
||||
|
||||
Reference in New Issue
Block a user