Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2 UI for seed restore #527

Merged
merged 32 commits into from Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d119936
version 2 UI for seed restore
macsleven Oct 7, 2019
9f4cd3f
update pod and clean up
macsleven Oct 8, 2019
bbe0088
Remove development team in config
macsleven Oct 8, 2019
064258a
fix bug and UI flow while typing
macsleven Oct 24, 2019
4086c33
fix build info
macsleven Nov 1, 2019
5e319b0
fix inconsistent position of dropdown list and recovery button
macsleven Nov 23, 2019
5bab8b3
design for recovery view success and linked to after pass/pin creation
macsleven Nov 24, 2019
d88717b
modified dropdown list and finalize flow to wallet recovery
macsleven Nov 25, 2019
003ec56
code cleanup
macsleven Nov 26, 2019
af40f7e
revert test code
macsleven Nov 26, 2019
df5d622
implement error banner using custom view
macsleven Nov 26, 2019
437cabe
Merge branch 'master' into seedRestoreV2
macsleven Nov 26, 2019
6aa2dcd
fix review request
macsleven Nov 28, 2019
d847c8a
merge with master
macsleven Nov 28, 2019
c8570e8
update navigation code
macsleven Nov 28, 2019
3483993
fix changes requested
macsleven Nov 29, 2019
4c3d177
merge with master
macsleven Nov 29, 2019
fe50b53
fix wallet setup crash caused by project update
macsleven Nov 29, 2019
d1d0c36
Add a delay and auto switch to pass/pin creation after seed verication
macsleven Nov 29, 2019
da45f4a
fix conflicts
macsleven Dec 9, 2019
90b924f
Update banner code
macsleven Jan 2, 2020
a4a1329
Move design to a separate storyBoard and link components
macsleven Jan 2, 2020
e1c025c
update uniform colors
macsleven Jan 12, 2020
9399fcb
remove duplicate images
macsleven Jan 12, 2020
70ba116
add missing img
macsleven Jan 12, 2020
3c2571a
fix conflicts and merge with branch
macsleven Jan 12, 2020
47947a1
group recovery files
macsleven Jan 12, 2020
52dfc56
merge with master
macsleven Jan 13, 2020
65ddd36
Fix link from authentication to success page
macsleven Jan 13, 2020
5dc390b
Fix changes requested on UI
macsleven Jan 14, 2020
47fbbe5
Fix changes requested on code clean up
macsleven Jan 14, 2020
6622466
fix conflicts and merge with master
macsleven Jan 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions Decred Wallet.xcodeproj/project.pbxproj
Expand Up @@ -120,9 +120,12 @@
B3B46AC8228F120700A68EDD /* TransactionDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B46AC1228F120700A68EDD /* TransactionDetailCell.swift */; };
B3B46AC9228F120700A68EDD /* TransactiontInputDetailsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B46AC2228F120700A68EDD /* TransactiontInputDetailsCell.swift */; };
B3D21C9F2296E4F000609F23 /* ExchangeRates.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3D21C9E2296E4F000609F23 /* ExchangeRates.swift */; };
DD2370FD234C98090041D79B /* UIViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD2370FC234C98090041D79B /* UIViews.swift */; };
DD3DF86622C3F0BD00E168AB /* UILabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD3DF86522C3F0BD00E168AB /* UILabel.swift */; };
DD41737B22B1B31E00580935 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DD41737D22B1B31E00580935 /* Localizable.strings */; };
DD479C3F238DF02100D4A467 /* ErrorBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD479C3E238DF02000D4A467 /* ErrorBanner.swift */; };
DD4948EC22C0E400006A35F8 /* LocalizedStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD4948EB22C0E400006A35F8 /* LocalizedStrings.swift */; };
DD6855BD238C808A006B8BF4 /* RecoverySuccessViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD6855BC238C808A006B8BF4 /* RecoverySuccessViewController.swift */; };
DD75148A22BA67B10070E4F6 /* TransactionHistoryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DD75148922BA67B10070E4F6 /* TransactionHistoryViewController.xib */; };
DD8F9D3C22BE7A5600FF8594 /* Security.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DD8F9D3B22BE7A5600FF8594 /* Security.storyboard */; };
DDCF259222B89D96005FCBB9 /* WalletSetup.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DDCF259122B89D96005FCBB9 /* WalletSetup.storyboard */; };
Expand Down Expand Up @@ -258,13 +261,16 @@
B3B46AC2228F120700A68EDD /* TransactiontInputDetailsCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactiontInputDetailsCell.swift; sourceTree = "<group>"; };
B3D21C9E2296E4F000609F23 /* ExchangeRates.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeRates.swift; sourceTree = "<group>"; };
D59C7DB99807D17630259A55 /* Pods-Decred Wallet.testnet release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Decred Wallet.testnet release.xcconfig"; path = "Target Support Files/Pods-Decred Wallet/Pods-Decred Wallet.testnet release.xcconfig"; sourceTree = "<group>"; };
DD2370FC234C98090041D79B /* UIViews.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViews.swift; sourceTree = "<group>"; };
DD3DF86522C3F0BD00E168AB /* UILabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UILabel.swift; sourceTree = "<group>"; };
DD3DF86722C42B3E00E168AB /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
DD41737C22B1B31E00580935 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
DD41737E22B1B32500580935 /* ru-RU */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "ru-RU"; path = "ru-RU.lproj/Localizable.strings"; sourceTree = "<group>"; };
DD443DD422C768A000EEAB95 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = "<group>"; };
DD452ED922CA93CB00A12378 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
DD479C3E238DF02000D4A467 /* ErrorBanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorBanner.swift; sourceTree = "<group>"; };
DD4948EB22C0E400006A35F8 /* LocalizedStrings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedStrings.swift; sourceTree = "<group>"; };
DD6855BC238C808A006B8BF4 /* RecoverySuccessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecoverySuccessViewController.swift; sourceTree = "<group>"; };
DD75148922BA67B10070E4F6 /* TransactionHistoryViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TransactionHistoryViewController.xib; sourceTree = "<group>"; };
DD8F9D3B22BE7A5600FF8594 /* Security.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Security.storyboard; sourceTree = "<group>"; };
DDCF259122B89D96005FCBB9 /* WalletSetup.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = WalletSetup.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -421,6 +427,7 @@
B3A3EF87229375D100008A4E /* Date.swift */,
B36EFD352298617C002753B2 /* UIButton.swift */,
B3967B3C22A75BD400E14432 /* UITableView.swift */,
DD2370FC234C98090041D79B /* UIViews.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand All @@ -430,6 +437,7 @@
children = (
B3B469AD228F0F2600A68EDD /* Button.swift */,
B3635B81229FE5870052EB4D /* QRImageScanner.swift */,
DD479C3E238DF02000D4A467 /* ErrorBanner.swift */,
);
path = "Custom Views";
sourceTree = "<group>";
Expand Down Expand Up @@ -567,6 +575,7 @@
isa = PBXGroup;
children = (
DDCF259122B89D96005FCBB9 /* WalletSetup.storyboard */,
DD6855BC238C808A006B8BF4 /* RecoverySuccessViewController.swift */,
B3B469E3228F0F2600A68EDD /* CreateNewWalletViewController.swift */,
B3B469E4228F0F2600A68EDD /* ConfirmNewWalletSeedViewController.swift */,
B3B469E5228F0F2600A68EDD /* RecoverExistingWalletViewController.swift */,
Expand Down Expand Up @@ -872,6 +881,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DD479C3F238DF02100D4A467 /* ErrorBanner.swift in Sources */,
B3B46A10228F0F2700A68EDD /* UIView.swift in Sources */,
B3B469FE228F0F2700A68EDD /* Button.swift in Sources */,
B3B46A2A228F0F2700A68EDD /* WalletSetupBaseViewController.swift in Sources */,
Expand All @@ -880,6 +890,7 @@
B3B46A19228F0F2700A68EDD /* StartScreenViewController.swift in Sources */,
B3B46AA0228F0F7D00A68EDD /* SendCompletedViewController.swift in Sources */,
B3B46A20228F0F2700A68EDD /* PinPasswordStrength.swift in Sources */,
DD2370FD234C98090041D79B /* UIViews.swift in Sources */,
2557E18B2355C9F000B6A1B7 /* CustomTabMenuView.swift in Sources */,
B3B46A24228F0F2700A68EDD /* TransactionTableViewCell.swift in Sources */,
B3D21C9F2296E4F000609F23 /* ExchangeRates.swift in Sources */,
Expand Down Expand Up @@ -948,6 +959,7 @@
B35C55D8232FED610006A765 /* Transaction.swift in Sources */,
B3B46A8A228F0F7D00A68EDD /* customUImage.swift in Sources */,
B3B46AA6228F0F7D00A68EDD /* NetworkModeTableViewController.swift in Sources */,
DD6855BD238C808A006B8BF4 /* RecoverySuccessViewController.swift in Sources */,
B3B46AAA228F0F7D00A68EDD /* AccountViewController.swift in Sources */,
B3B469FB228F0F2700A68EDD /* Extensions.swift in Sources */,
B3B46A1C228F0F2700A68EDD /* PinInputView.swift in Sources */,
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:Decred Wallet.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Testnet Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:Decred Wallet.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Testnet Release"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:Decred Wallet.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Mainnet Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:Decred Wallet.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Mainnet Release"
Expand Down
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "backup_checkbox_checked.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "backup_checkbox_checked@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "backup_checkbox_checked@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "backup_checkbox_default.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "backup_checkbox_default@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "backup_checkbox_default@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "backup_success_icon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "backup_success_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "backup_success_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -2,17 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "left-arrow.png",
"filename" : "ic_back03_24px.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "left-arrow@2x.png",
"filename" : "ic_back03_24px@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "left-arrow@3x.png",
"filename" : "ic_back03_24px@3x.png",
"scale" : "3x"
}
],
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_checkmark02_24px.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_checkmark02_24px@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_checkmark02_24px@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions Decred Wallet/Custom Views/ErrorBanner.swift
@@ -0,0 +1,71 @@
//
// ErrorBanner.swift
// Decred Wallet
//
// Copyright (c) 2018-2019 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

import UIKit

class ErrorBanner: UIView {
private var parent:UIViewController?

init(parent: UIViewController) {
super.init(frame: .zero)
self.parent = parent
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public func show(text:String) {
guard let parent = self.parent else { return }
if self.superview == parent.view { return }

parent.view.addSubview(self)
let guide = parent.view.safeAreaLayoutGuide
self.translatesAutoresizingMaskIntoConstraints = false
self.leadingAnchor.constraint(equalTo: parent.view.leadingAnchor,constant: 8).isActive = true
self.trailingAnchor.constraint(equalTo: parent.view.trailingAnchor,constant: -8).isActive = true
self.topAnchor.constraint(equalTo: guide.topAnchor,constant: 84).isActive = true

self.backgroundColor = UIColor.appColors.decredOrange
self.layer.cornerRadius = 7;
self.layer.shadowColor = UIColor.appColors.shadowColor.cgColor
self.layer.shadowRadius = 4
self.layer.shadowOpacity = 0.24
self.layer.shadowOffset = CGSize(width: 0, height: 1)

let errorLabel = UILabel()
self.addSubview(errorLabel)
errorLabel.translatesAutoresizingMaskIntoConstraints = false
errorLabel.leadingAnchor.constraint(equalTo: self.leadingAnchor,constant: 10).isActive = true
errorLabel.trailingAnchor.constraint(equalTo: self.trailingAnchor,constant: -10).isActive = true
errorLabel.topAnchor.constraint(equalTo: self.topAnchor,constant: 5).isActive = true
errorLabel.bottomAnchor.constraint(equalTo: self.bottomAnchor,constant: -5).isActive = true
errorLabel.numberOfLines = 0
errorLabel.lineBreakMode = .byWordWrapping
errorLabel.textAlignment = .center
errorLabel.textColor = .white
errorLabel.font = UIFont(name: "SourceSansPro-Regular", size: 16)
errorLabel.text = text

let swipeUpGesture = UISwipeGestureRecognizer(target: self, action: #selector(dismiss))
swipeUpGesture.direction = .up
self.addGestureRecognizer(swipeUpGesture)

self.perform(#selector(self.dismiss), with: nil, afterDelay: 5)
}

@objc func dismiss() {
NSObject.cancelPreviousPerformRequests(withTarget: self,
selector: #selector(dismiss),
object: nil)
if let parent = self.parent,
self.superview == parent.view {
self.removeFromSuperview()
}
}
}
4 changes: 4 additions & 0 deletions Decred Wallet/Extensions/UIColor.swift
Expand Up @@ -26,6 +26,10 @@ extension UIColor {
static let thinGray = UIColor.init(hex: "#a4abb1")
static let darkGray = UIColor.init(hex: "#4e5f70")
static let transparentThinGray = UIColor.init(hex: "#a4abb1", alpha: 0.3)
static let darkBlue = UIColor.init(hex: "#3d5873")
static let lightGreen = UIColor.init(hex: "#41be53")
static let darkText = UIColor.init(hex: "#091440")
static let shadowColor = UIColor(hex: "#3D0914")
}

convenience init(hex: String) {
Expand Down
30 changes: 30 additions & 0 deletions Decred Wallet/Extensions/UIViews.swift
@@ -0,0 +1,30 @@
//
// UIView.swift
// Decred Wallet
//
// Copyright (c) 2018-2019 The Decred developers
macsleven marked this conversation as resolved.
Show resolved Hide resolved
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

import UIKit

extension UIView {
macsleven marked this conversation as resolved.
Show resolved Hide resolved
func roundCorners(corners: UIRectCorner, radius: CGFloat) {
let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
let mask = CAShapeLayer()
mask.path = path.cgPath
layer.mask = mask
}

func dropShadow(color: UIColor, opacity: Float = 0.2, offSet: CGSize, radius: CGFloat = 1, scale: Bool = true) {
layer.masksToBounds = false
layer.shadowColor = color.cgColor
layer.shadowOpacity = opacity
layer.shadowOffset = offSet
layer.shadowRadius = radius

layer.shadowPath = UIBezierPath(rect: self.bounds).cgPath
layer.shouldRasterize = true
layer.rasterizationScale = scale ? UIScreen.main.scale : 1
}
}