Navigation Menu

Skip to content

Commit

Permalink
[+] Signers list visible on transaction details. Identicons added. Up…
Browse files Browse the repository at this point in the history
…dated dashboard screen. Labels and UI updated.
  • Loading branch information
light-cloud committed Oct 10, 2019
1 parent 641224c commit b20f6f8
Show file tree
Hide file tree
Showing 94 changed files with 2,721 additions and 1,147 deletions.
327 changes: 305 additions & 22 deletions LOBSTR Vault.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

28 changes: 12 additions & 16 deletions LOBSTR Vault.xcodeproj/xcshareddata/xcschemes/LOBSTR Vault.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1030"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
onlyGenerateCoverageForSpecifiedTargets = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92D3768D21BAA95B00504713"
BuildableName = "LOBSTR Vault.app"
BlueprintName = "LOBSTR Vault"
ReferencedContainer = "container:LOBSTR Vault.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -49,17 +58,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "92D3768D21BAA95B00504713"
BuildableName = "LOBSTR Vault.app"
BlueprintName = "LOBSTR Vault"
ReferencedContainer = "container:LOBSTR Vault.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -81,8 +79,6 @@
ReferencedContainer = "container:LOBSTR Vault.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
@@ -1,4 +1,5 @@
import UIKit
import PKHUD

class BiometricIDViewController: UIViewController, StoryboardCreation {
static var storyboardType: Storyboards = .biometricID
Expand Down Expand Up @@ -62,4 +63,8 @@ extension BiometricIDViewController: BiometricIDView {
AppearanceHelper.set(turnOnButton, with: L10n.buttonTitleTurnOn)
}
}

func setProgressAnimation(isDisplay: Bool) {
isDisplay ? HUD.show(.labeledProgress(title: nil, subtitle: L10n.animationWaiting)) : HUD.hide()
}
}
Expand Up @@ -9,20 +9,25 @@ protocol BiometricIDPresenter {
protocol BiometricIDView: class {
func setErrorAlert(for error: Error)
func setBiometricButton(with type: BiometricType)
func setProgressAnimation(isDisplay: Bool)
}

class BiometricIDPresenterImpl: BiometricIDPresenter {
private weak var view: BiometricIDView?
private let navigationController: UINavigationController
private var biometricAuthManager: BiometricAuthManager

private let transactionService: TransactionService

// MARK: - Init

init(view: BiometricIDView,
navigationController: UINavigationController,
transactionService: TransactionService = TransactionService(),
biometricAuthManager: BiometricAuthManager = BiometricAuthManagerImpl()) {
self.view = view
self.navigationController = navigationController
self.transactionService = transactionService
self.biometricAuthManager = biometricAuthManager
}
}
Expand All @@ -40,7 +45,8 @@ extension BiometricIDPresenterImpl {
switch result {
case .success:
self?.biometricAuthManager.isBiometricAuthEnabled = true
self?.transitionToPublicKey()
// self?.transitionToPublicKey()
self?.updateToken()
case .failure(let error):
guard let error = error as? VaultError.BiometricError else { return }
guard error == VaultError.BiometricError.notAvailable else { return }
Expand All @@ -50,7 +56,8 @@ extension BiometricIDPresenterImpl {
}

func skipButtonWasPressed() {
transitionToPublicKey()
// transitionToPublicKey()
updateToken()
}
}

Expand All @@ -63,4 +70,52 @@ extension BiometricIDPresenterImpl {
navigationController.pushViewController(publicKeyViewController,
animated: true)
}

private func updateToken() {
guard let viewController = view as? UIViewController else {
return
}

guard ConnectionHelper.checkConnection(viewController) else {
return
}

view?.setProgressAnimation(isDisplay: true)
AuthenticationService().updateToken { [weak self] result in
switch result {
case .success:
self?.transitionToNextScreen()
case .failure(let error):
self?.view?.setProgressAnimation(isDisplay: false)
print("Couldn't get token. \(error)")
}
}
}

private func transitionToNextScreen() {
transactionService.getSignedAccounts() { result in
switch result {
case .success(let signedAccounts):
self.view?.setProgressAnimation(isDisplay: false)
if signedAccounts.count > 0 {
UserDefaultsHelper.accountStatus = .created
self.transitionToHomeScreen()
} else {
self.transitionToPublicKey()
}
case .failure(let error):
self.view?.setProgressAnimation(isDisplay: false)
print("error: \(error)")
}
}
}

func transitionToHomeScreen() {
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate
else { return }

DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
appDelegate.applicationCoordinator.showHomeScreen()
}
}
}
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -14,19 +12,19 @@
<!--Mnemonic Generation View Controller-->
<scene sceneID="sCN-WI-Q2Z">
<objects>
<viewController storyboardIdentifier="MnemonicGenerationViewController" id="DQW-Ji-cHV" customClass="MnemonicGenerationViewController" customModule="LOBSTR_Vault" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="MnemonicGenerationViewController" extendedLayoutIncludesOpaqueBars="YES" id="DQW-Ji-cHV" customClass="MnemonicGenerationViewController" customModule="LOBSTR_Vault" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="qHw-0d-Zm7">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="description" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="5" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4EP-Zi-e8S">
<rect key="frame" x="18" y="40" width="339" height="18"/>
<rect key="frame" x="18" y="20" width="339" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" name="Colors/GrayOpacity70"/>
<nil key="highlightedColor"/>
</label>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="pQm-Wr-hKa">
<rect key="frame" x="18" y="80" width="339" height="140"/>
<rect key="frame" x="18" y="60" width="339" height="140"/>
<color key="backgroundColor" name="Colors/Background"/>
<constraints>
<constraint firstAttribute="height" constant="140" id="XeW-mN-Iao"/>
Expand Down Expand Up @@ -64,7 +62,7 @@
</cells>
</collectionView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DeZ-LZ-7FA">
<rect key="frame" x="16" y="552" width="343" height="48"/>
<rect key="frame" x="16" y="547" width="343" height="48"/>
<color key="backgroundColor" name="Colors/Main"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="vkM-Ze-Yfc"/>
Expand All @@ -78,7 +76,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KSX-OC-hl6">
<rect key="frame" x="317" y="228" width="40" height="28"/>
<rect key="frame" x="317" y="208" width="40" height="28"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="sbb-Ms-Giz"/>
</constraints>
Expand All @@ -91,20 +89,20 @@
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Icons/Other/icCopy" translatesAutoresizingMaskIntoConstraints="NO" id="Uyl-ju-ITs">
<rect key="frame" x="294" y="232" width="18" height="18"/>
<rect key="frame" x="294" y="212" width="18" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="18" id="UdX-pi-IWJ"/>
<constraint firstAttribute="height" constant="18" id="msv-SA-vhp"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="4" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YbO-Ei-Ebj">
<rect key="frame" x="16" y="232" width="258" height="16"/>
<rect key="frame" x="16" y="212" width="258" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="Colors/Gray"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dpZ-sV-uFf">
<rect key="frame" x="16" y="524.5" width="343" height="14.5"/>
<rect key="frame" x="16" y="519.5" width="343" height="14.5"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="Colors/Gray"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -170,13 +168,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Verify recovery phrase" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="5" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RPD-Bw-zj1">
<rect key="frame" x="18" y="40" width="154" height="18"/>
<rect key="frame" x="18" y="20" width="154" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" name="Colors/GrayOpacity70"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="a2Q-RD-1Uq">
<rect key="frame" x="18" y="72" width="339" height="200"/>
<rect key="frame" x="18" y="52" width="339" height="200"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="2tE-yP-9Zl">
<rect key="frame" x="15" y="15" width="309" height="170"/>
Expand Down Expand Up @@ -270,7 +268,7 @@
<nil key="highlightedColor"/>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Bn-hm-wpY">
<rect key="frame" x="182" y="38" width="175" height="22"/>
<rect key="frame" x="182" y="4" width="175" height="36"/>
<color key="tintColor" name="Colors/Main"/>
<state key="normal" title=" Clear" image="Icons/Other/delete">
<color key="titleColor" name="Colors/Main"/>
Expand Down
@@ -1,4 +1,5 @@
import UIKit
import PKHUD

class MnemonicRecoveryViewController: UIViewController, StoryboardCreation {

Expand Down Expand Up @@ -32,12 +33,14 @@ class MnemonicRecoveryViewController: UIViewController, StoryboardCreation {
}

override func viewDidLayoutSubviews() {
AppearanceHelper.setDashBorders(for: textView, with: Asset.Colors.gray.color.cgColor)
AppearanceHelper.setDashBorders(for: textView,
with: Asset.Colors.gray.color.cgColor)
}

// MARK: - IBActions

@IBAction func recoveryButtonAction(_ sender: Any) {
view?.endEditing(true)
presenter.recoveryButtonWasPressed()
}

Expand All @@ -49,7 +52,10 @@ class MnemonicRecoveryViewController: UIViewController, StoryboardCreation {

private func setAppearance() {
AppearanceHelper.set(nextButton, with: L10n.buttonTitleNext)
textView.textContainerInset = UIEdgeInsets(top: 20, left: 15, bottom: 20, right: 20)
textView.textContainerInset = UIEdgeInsets(top: 20,
left: 15,
bottom: 20,
right: 20)
}

private func setStaticStrings() {
Expand All @@ -63,6 +69,12 @@ class MnemonicRecoveryViewController: UIViewController, StoryboardCreation {

extension MnemonicRecoveryViewController: MnemonicRecoveryView {

func setProgressAnimation(enabled: Bool) {
enabled ?
HUD.show(.labeledProgress(title: nil, subtitle: L10n.animationWaiting)) :
HUD.hide()
}

func setRecoveryButtonStatus(isEnabled: Bool) {
var backgorundColor = Asset.Colors.main.color
if !isEnabled {
Expand Down

0 comments on commit b20f6f8

Please sign in to comment.