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

overview UI and implementation of account mixer #727

Merged
merged 39 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
69e3580
overview UI and implementation of account mixer
macsleven Oct 7, 2020
8a49196
Privacy: design initial setup new feature card on overview screen
macsleven Dec 27, 2019
4e60b94
Privacy: design setup intro screen
macsleven Dec 26, 2019
b71c2ec
implement setup functionalities, custom dialog and authentication
macsleven Dec 28, 2020
6efa42c
privacy: design ready to mix UI card
macsleven Dec 29, 2020
18207ad
design privacy with switch off defaults screen
macsleven Dec 29, 2020
7881057
Privacy: design and implement wallet mixing,status and controller
macsleven Dec 30, 2020
e6458b2
design UI card on overview for mixer while running
macsleven Dec 31, 2020
40dd039
Privacy: add check mixer status on wallet page and control
macsleven Dec 31, 2020
4e7ca60
update custom dialog for simple pop up on privacy page
macsleven Jan 9, 2021
3e44052
localize privacy strings and UIs
macsleven Jan 12, 2021
a5032a0
design and implement auto accout mixer setup
macsleven Jan 26, 2021
e4c182d
initial design for manual account mixer setup screen and controller
macsleven Jan 27, 2021
d268922
adjust and fix misplayed view in manual setup screen
macsleven Jan 28, 2021
ec52e28
implement overview unctionality for single account mixer operations
macsleven Feb 2, 2021
dd55bec
implement account page functionalities and navigation for account mix…
macsleven Feb 3, 2021
9195661
Design and implemented custom tooltip on wallet page
macsleven Feb 3, 2021
4866fe5
calculate and update wallet page desgin placement
macsleven Feb 4, 2021
8f3bb13
refactor view on overview page
macsleven Feb 4, 2021
249c2c8
finalize autosetup privacy
macsleven Feb 27, 2021
c068a92
design and update custom simple alert dialog with title and image
macsleven Mar 2, 2021
cd83b1c
privacy: check account name for conflict before creating privacy acco…
macsleven Mar 3, 2021
614f34d
redesign manual privacy view using wallet account view and update its…
macsleven Mar 4, 2021
679b9f1
finalise privacy manual setup
macsleven Mar 5, 2021
8c5a48f
Implement Privacy view controller, adjusted custom views and utility …
macsleven Mar 9, 2021
cd9fdf8
fix privacy pop up logic and privacy view dismiss controller
macsleven Mar 9, 2021
b84aecc
fix misplaced textview in privacy view controller and wallet to priva…
macsleven Mar 9, 2021
7226b9a
implement privacy actions on there views
macsleven Mar 13, 2021
e08e00c
Add mixers tableview in to overview page
JustinBeBoy Apr 14, 2021
671e5f2
Fix multiple wallet account mixing on overview and other changes
macsleven May 12, 2021
8d4218a
fix conflicts and merge local branch
macsleven May 15, 2021
1e017f9
Fix code and update code base with dcrlibwallet master
macsleven May 16, 2021
541f317
Removed danger zone on privacy view
macsleven May 16, 2021
4ab27e9
suffixed DCR after balance
macsleven May 16, 2021
44db6aa
Fix number of mixer running and localized strings for french
macsleven May 16, 2021
431c9de
Fix mixer arrow navifation function
macsleven May 16, 2021
5f5f779
Update mixer settings title
macsleven May 16, 2021
7288306
update transaction icon for on transfer
macsleven May 16, 2021
7b11d35
fix transaction type for mixing
macsleven May 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,152 changes: 2,094 additions & 2,058 deletions Decred Wallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
15 changes: 15 additions & 0 deletions Decred Wallet/Assets.xcassets/ic_alert.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "alert.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
16 changes: 16 additions & 0 deletions Decred Wallet/Assets.xcassets/ic_arrow_next.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "nextpdf.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Shape.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "ic_confirmed_12px.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "ic_colapse.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
16 changes: 16 additions & 0 deletions Decred Wallet/Assets.xcassets/ic_goto_arrow.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "goto.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Decred Wallet/Assets.xcassets/ic_mixer.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Icon.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
16 changes: 16 additions & 0 deletions Decred Wallet/Assets.xcassets/ic_mixer_new.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "Icon-2.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Image.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.
24 changes: 8 additions & 16 deletions Decred Wallet/Assets.xcassets/left-arrow.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_back.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_back@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_back@3x.png",
"scale" : "3x"
"filename" : "Path.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Decred Wallet/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ struct GlobalConstants {
static let MAINNET_HD_PATH = "m / 44' / 42' /"
static let LEGACY_MAINNET_HD_PATH = "m / 44' / 20' /"
static let DEFAULT = "default"
static let MIXED = "mixed"
static let UNMIXED = "unmixed"
}

struct Wallet {
Expand Down
173 changes: 173 additions & 0 deletions Decred Wallet/Custom Views/ToolTipView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
//
// ToolTipView.swift
// Decred Wallet
//
// Copyright (c) 2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

import UIKit

@IBDesignable
class TooltipView: UIView {

//MARK: - IBInspectable

@IBInspectable var arrowTopLeft: Bool = false
@IBInspectable var arrowTopCenter: Bool = true
@IBInspectable var arrowTopRight: Bool = false
@IBInspectable var arrowBottomLeft: Bool = false
@IBInspectable var arrowBottomCenter: Bool = false
@IBInspectable var arrowBottomRight: Bool = false

@IBInspectable var fillColor: UIColor = UIColor.white

@IBInspectable var borderColor: UIColor = UIColor(red:0, green:0, blue:0, alpha:0.05)
@IBInspectable var borderRadius: CGFloat = 7
@IBInspectable var borderWidth: CGFloat = 1

@IBInspectable var shadowColor: UIColor = UIColor(red:0, green:0, blue:0, alpha:0.14)
@IBInspectable var shadowOffsetX: CGFloat = 0
@IBInspectable var shadowOffsetY: CGFloat = 2
@IBInspectable var shadowBlur: CGFloat = 10

//MARK: - Global Variables

var tooltipWidth = 0
var tooltipHeight = 0

//MARK: - Initialization

override func draw(_ rect: CGRect) {
drawTooltip()
}

//MARK: - Private Methods

// Orientation methods

private func topLeft(_ x: CGFloat, _ y: CGFloat) -> CGPoint {
return CGPoint(x: x, y: y)
}

private func topRight(_ x: CGFloat, _ y: CGFloat) -> CGPoint {
return CGPoint(x: CGFloat(tooltipWidth) - x, y: y)
}

private func bottomLeft(_ x: CGFloat, _ y: CGFloat) -> CGPoint {
return CGPoint(x: x, y: CGFloat(tooltipHeight) - y)
}

private func bottomRight(_ x: CGFloat, _ y: CGFloat) -> CGPoint {
return CGPoint(x: CGFloat(tooltipWidth) - x, y: CGFloat(tooltipHeight) - y)
}

// Draw methods

private func drawTooltip() {

tooltipWidth = Int(bounds.width)
tooltipHeight = Int(bounds.height)

// Define Bubble Shape

let bubblePath = UIBezierPath()

// Top left corner

bubblePath.move(to: topLeft(0, borderRadius))
bubblePath.addCurve(to: topLeft(borderRadius, 0), controlPoint1: topLeft(0, borderRadius / 2), controlPoint2: topLeft(borderRadius / 2, 0))

// Top right corner

bubblePath.addLine(to: topRight(borderRadius, 0))
bubblePath.addCurve(to: topRight(0, borderRadius), controlPoint1: topRight(borderRadius / 2, 0), controlPoint2: topRight(0, borderRadius / 2))

// Bottom right corner

bubblePath.addLine(to: bottomRight(0, borderRadius))
bubblePath.addCurve(to: bottomRight(borderRadius, 0), controlPoint1: bottomRight(0, borderRadius / 2), controlPoint2: bottomRight(borderRadius / 2, 0))

// Bottom left corner

bubblePath.addLine(to: bottomLeft(borderRadius, 0))
bubblePath.addCurve(to: bottomLeft(0, borderRadius), controlPoint1: bottomLeft(borderRadius / 2, 0), controlPoint2: bottomLeft(0, borderRadius / 2))
bubblePath.close()

// Arrow

if(arrowTopLeft) {
bubblePath.move(to: topLeft(3, 10))
bubblePath.addLine(to: topLeft(3, -4))
bubblePath.addLine(to: topLeft(16, 2))
bubblePath.close()
}

if(arrowTopCenter) {
bubblePath.move(to: topLeft(CGFloat((tooltipWidth / 2) - 5), 0))
bubblePath.addLine(to: topLeft(CGFloat(tooltipWidth / 2), -8))
bubblePath.addLine(to: topLeft(CGFloat(tooltipWidth / 2 + 5), 0))
bubblePath.close()
}

if(arrowTopRight) {
bubblePath.move(to: topRight(16, 2))
bubblePath.addLine(to: topRight(3, -4))
bubblePath.addLine(to: topRight(3, 10))
bubblePath.close()

}

if(arrowBottomLeft) {
bubblePath.move(to: bottomLeft(16, 2))
bubblePath.addLine(to: bottomLeft(3, -4))
bubblePath.addLine(to: bottomLeft(3, 10))
bubblePath.close()
}

if(arrowBottomCenter) {
bubblePath.move(to: bottomLeft(CGFloat((tooltipWidth / 2) - 5), 0))
bubblePath.addLine(to: bottomLeft(CGFloat(tooltipWidth / 2), -8))
bubblePath.addLine(to: bottomLeft(CGFloat(tooltipWidth / 2 + 5), 0))
bubblePath.close()
}

if(arrowBottomRight) {
bubblePath.move(to: bottomRight(3, 10))
bubblePath.addLine(to: bottomRight(3, -4))
bubblePath.addLine(to: bottomRight(16, 2))
bubblePath.close()
}

// Shadow Layer

let shadowShape = CAShapeLayer()
shadowShape.path = bubblePath.cgPath
shadowShape.fillColor = fillColor.cgColor
shadowShape.shadowColor = shadowColor.cgColor
shadowShape.shadowOffset = CGSize(width: CGFloat(shadowOffsetX), height: CGFloat(shadowOffsetY))
shadowShape.shadowRadius = CGFloat(shadowBlur)
shadowShape.shadowOpacity = 0.8

// Border Layer

let borderShape = CAShapeLayer()
borderShape.path = bubblePath.cgPath
borderShape.fillColor = fillColor.cgColor
borderShape.strokeColor = borderColor.cgColor
borderShape.lineWidth = CGFloat(borderWidth*2)

// Fill Layer

let fillShape = CAShapeLayer()
fillShape.path = bubblePath.cgPath
fillShape.fillColor = fillColor.cgColor

// Add Sublayers

self.layer.insertSublayer(shadowShape, at: 0)
self.layer.insertSublayer(borderShape, at: 0)
self.layer.insertSublayer(fillShape, at: 0)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import Dcrlibwallet
}

var showWatchOnlyWallet = true
var showMixedAccount = true
var showUnMixedAccount = true

var onAccountSelectionChanged: ((_ selectedWallet: DcrlibwalletWallet, _ selectedAccount: DcrlibwalletAccount) -> Void)?

Expand Down Expand Up @@ -78,6 +80,8 @@ import Dcrlibwallet
title: accountSelectorDialogTitle,
selectedWallet: self.selectedWallet,
selectedAccount: self.selectedAccount, showWatchOnlyWallet: showWatchOnlyWallet,
showUnMixedAccount: showUnMixedAccount,
showMixedAccount: showMixedAccount,
callback: self.updateSelectedAccount)
}

Expand Down
Loading