Skip to content

Commit

Permalink
Merge pull request #20 from vergecurrency/Revamp-send-view
Browse files Browse the repository at this point in the history
Revamp send view
  • Loading branch information
SwenVanZanten authored Aug 24, 2018
2 parents c68ab16 + 6e8fdc0 commit d776b2e
Show file tree
Hide file tree
Showing 17 changed files with 817 additions and 154 deletions.
20 changes: 20 additions & 0 deletions VergeiOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@
A398B20F212B2886004ACB73 /* UIWindow+VisibleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A398B20E212B2886004ACB73 /* UIWindow+VisibleViewController.swift */; };
A398B213212EBDD7004ACB73 /* CreditsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A398B212212EBDD7004ACB73 /* CreditsTableViewController.swift */; };
A398B215212F0949004ACB73 /* DisconnectWalletViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A398B214212F0949004ACB73 /* DisconnectWalletViewController.swift */; };
A398B21B212F91F0004ACB73 /* ConfirmSendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A398B21A212F91F0004ACB73 /* ConfirmSendView.swift */; };
A398B21F21302DC5004ACB73 /* ConfirmSendView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A398B21E21302DC5004ACB73 /* ConfirmSendView.xib */; };
B2BD72F8A7F67D4C11416F74 /* RecipientDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2BD74068BD3DBE015E9B35E /* RecipientDelegate.swift */; };
B2BD76A67D70DB341C28F00B /* AmountDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2BD788873F8343FD7DB3E2C /* AmountDelegate.swift */; };
B2BD7F39EE96EB7B9E5A870A /* SendTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2BD780B0BE45F52AD3B526D /* SendTransaction.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -270,6 +275,11 @@
A398B20E212B2886004ACB73 /* UIWindow+VisibleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIWindow+VisibleViewController.swift"; sourceTree = "<group>"; };
A398B212212EBDD7004ACB73 /* CreditsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreditsTableViewController.swift; sourceTree = "<group>"; };
A398B214212F0949004ACB73 /* DisconnectWalletViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisconnectWalletViewController.swift; sourceTree = "<group>"; };
A398B21A212F91F0004ACB73 /* ConfirmSendView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmSendView.swift; sourceTree = "<group>"; };
A398B21E21302DC5004ACB73 /* ConfirmSendView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConfirmSendView.xib; sourceTree = "<group>"; };
B2BD74068BD3DBE015E9B35E /* RecipientDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecipientDelegate.swift; sourceTree = "<group>"; };
B2BD780B0BE45F52AD3B526D /* SendTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendTransaction.swift; sourceTree = "<group>"; };
B2BD788873F8343FD7DB3E2C /* AmountDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmountDelegate.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -309,6 +319,7 @@
07B9F4532107C9EB00871990 /* BlockchainInfo.swift */,
A3256664211A3B61006FB08A /* XvgInfo.swift */,
A302D2FA211F64FB00EA8091 /* Address.swift */,
B2BD780B0BE45F52AD3B526D /* SendTransaction.swift */,
);
path = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -459,6 +470,8 @@
isa = PBXGroup;
children = (
A305DDB92107BB8B00911B64 /* KeyboardDelegate.swift */,
B2BD74068BD3DBE015E9B35E /* RecipientDelegate.swift */,
B2BD788873F8343FD7DB3E2C /* AmountDelegate.swift */,
);
path = Delegates;
sourceTree = "<group>";
Expand Down Expand Up @@ -585,6 +598,8 @@
A302D2EE211F2E4900EA8091 /* SelectRecipientTableViewController.swift */,
A302D2F0211F3B4400EA8091 /* SetAmountViewController.swift */,
A302D306212036B400EA8091 /* ScanQRCodeViewController.swift */,
A398B21A212F91F0004ACB73 /* ConfirmSendView.swift */,
A398B21E21302DC5004ACB73 /* ConfirmSendView.xib */,
);
path = Send;
sourceTree = "<group>";
Expand Down Expand Up @@ -838,6 +853,7 @@
A325664B211373FF006FB08A /* Wallet.storyboard in Resources */,
A376411B2108F0C700E04521 /* Cartfile in Resources */,
A338E6B92110D60F000D44EE /* ChartWalletSlideView.xib in Resources */,
A398B21F21302DC5004ACB73 /* ConfirmSendView.xib in Resources */,
A32566562115AEDB006FB08A /* FiatBalanceView.xib in Resources */,
A325664321135A00006FB08A /* Settings.storyboard in Resources */,
A305DDA52106940E00911B64 /* .gitignore in Resources */,
Expand Down Expand Up @@ -963,6 +979,7 @@
A305DDC32107C83200911B64 /* NumberKey.swift in Sources */,
A302D3412122053300EA8091 /* PriceTicker.swift in Sources */,
A338E69C210D456D000D44EE /* ConfirmPaperkeyViewController.swift in Sources */,
A398B21B212F91F0004ACB73 /* ConfirmSendView.swift in Sources */,
A325664D211375E5006FB08A /* PinUnlockViewController.swift in Sources */,
A302D2F1211F3B4400EA8091 /* SetAmountViewController.swift in Sources */,
A32566542115AEBF006FB08A /* XVGBalanceView.swift in Sources */,
Expand Down Expand Up @@ -999,6 +1016,9 @@
A302D34D21260F1C00EA8091 /* UIScrollView+Pagination.swift in Sources */,
A33F6A7020EEE485001492C2 /* AppDelegate.swift in Sources */,
A302D2F9211F3F5700EA8091 /* XVGCardImageView.swift in Sources */,
B2BD72F8A7F67D4C11416F74 /* RecipientDelegate.swift in Sources */,
B2BD76A67D70DB341C28F00B /* AmountDelegate.swift in Sources */,
B2BD7F39EE96EB7B9E5A870A /* SendTransaction.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
16 changes: 16 additions & 0 deletions VergeiOS/Assets.xcassets/Icons/Checked.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "icons8-checked.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template",
"preserves-vector-representation" : true
}
}
Binary file not shown.
4 changes: 2 additions & 2 deletions VergeiOS/Components/UI/Buttons/SelectorButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import UIKit
self.layer.addSublayer(border)

// Max width needs to be more dynamic..
let labelRect = CGRect(x: rect.minX, y: rect.minY, width: rect.width, height: 14.0)
let labelRect = CGRect(x: rect.minX, y: rect.minY, width: rect.width - 8.0, height: 14.0)

self.labelLabel = UILabel(frame: labelRect)
self.labelLabel?.text = label
Expand All @@ -65,7 +65,7 @@ import UIKit

self.addSubview(self.labelLabel!)

let valueRect = CGRect(x: rect.minX, y: rect.minY + 19.0, width: rect.width, height: 22.0)
let valueRect = CGRect(x: rect.minX, y: rect.minY + 19.0, width: rect.width - 8.0, height: 22.0)

self.placeholderLabel = UILabel(frame: valueRect)
self.placeholderLabel?.text = placeholder
Expand Down
75 changes: 71 additions & 4 deletions VergeiOS/Components/UI/Layout/BorderPanelView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,84 @@ import UIKit

@IBDesignable class BorderPanelView: UIView {

@IBInspectable var width: Int = 1
@IBInspectable var borderColor: UIColor = UIColor.vergeGrey()
@IBInspectable var width: CGFloat = 0.5
@IBInspectable var borderColor: UIColor = UIColor(red: 0.85, green: 0.85, blue: 0.9, alpha: 1)

@IBInspectable var top: Bool = true
@IBInspectable var bottom: Bool = true
@IBInspectable var left: Bool = true
@IBInspectable var right: Bool = true

// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
let borderRect = CGRect(x: rect.minX, y: rect.height - CGFloat(width), width: rect.width, height: CGFloat(width))
if top {
addTopBorder(rect)
}
if bottom {
addBottomBorder(rect)
}
if left {
addLeftBorder(rect)
}
if right {
addRightBorder(rect)
}
}

func addTopBorder(_ rect: CGRect) {
let borderRect = CGRect(
x: rect.minX,
y: rect.minY,
width: rect.width,
height: width
)
let border: CALayer = CALayer(layer: self.layer)
border.frame = borderRect
border.backgroundColor = self.borderColor.cgColor


self.layer.addSublayer(border)
}

func addBottomBorder(_ rect: CGRect) {
let borderRect = CGRect(
x: rect.minX,
y: rect.minY + (rect.height - CGFloat(width)),
width: rect.width,
height: width
)
let border: CALayer = CALayer(layer: self.layer)
border.frame = borderRect
border.backgroundColor = self.borderColor.cgColor

self.layer.addSublayer(border)
}

func addLeftBorder(_ rect: CGRect) {
let borderRect = CGRect(
x: rect.minX,
y: rect.minY,
width: width,
height: rect.height
)
let border: CALayer = CALayer(layer: self.layer)
border.frame = borderRect
border.backgroundColor = self.borderColor.cgColor

self.layer.addSublayer(border)
}

func addRightBorder(_ rect: CGRect) {
let borderRect = CGRect(
x: rect.minX + rect.width,
y: rect.minY,
width: width,
height: rect.height
)
let border: CALayer = CALayer(layer: self.layer)
border.frame = borderRect
border.backgroundColor = self.borderColor.cgColor

self.layer.addSublayer(border)
}

Expand Down
18 changes: 14 additions & 4 deletions VergeiOS/Components/UI/Layout/PanelView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

import UIKit

class PanelView: UIView {
@IBDesignable class PanelView: UIView {

@IBInspectable var cornerRadius: CGFloat = 5.0

override init(frame: CGRect) {
super.init(frame: frame)
Expand All @@ -23,14 +25,22 @@ class PanelView: UIView {
}

func createView() {
self.backgroundColor = .white

self.layer.cornerRadius = 5
self.layer.cornerRadius = cornerRadius

self.layer.shadowColor = UIColor.black.cgColor
self.layer.shadowOpacity = 0.15
self.layer.shadowOffset = CGSize.zero
self.layer.shadowRadius = 15
}

override func draw(_ rect: CGRect) {
super.draw(rect)

self.layer.cornerRadius = cornerRadius

self.layer.shadowColor = UIColor.black.cgColor
self.layer.shadowOpacity = 0.15
self.layer.shadowOffset = CGSize.zero
self.layer.shadowRadius = 15
}
}
11 changes: 11 additions & 0 deletions VergeiOS/Delegates/AmountDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Created by Swen van Zanten on 24-08-18.
// Copyright (c) 2018 Verge Currency. All rights reserved.
//

import Foundation

protocol AmountDelegate {
func didChangeAmount(_ amount: NSNumber)
func currentAmount() -> NSNumber
}
11 changes: 11 additions & 0 deletions VergeiOS/Delegates/RecipientDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Created by Swen van Zanten on 24-08-18.
// Copyright (c) 2018 Verge Currency. All rights reserved.
//

import Foundation

protocol RecipientDelegate {
func didSelectRecipientAddress(_ address: String)
func selectedRecipientAddress() -> String
}
14 changes: 14 additions & 0 deletions VergeiOS/Model/SendTransaction.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Created by Swen van Zanten on 24-08-18.
// Copyright (c) 2018 Verge Currency. All rights reserved.
//

import Foundation

class SendTransaction {

var amount: NSNumber = 0.0
var address: String = ""
var memo: String = ""

}
Loading

0 comments on commit d776b2e

Please sign in to comment.