-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1142 from MixinNetwork/feature/deposit
Feature/deposit_not_supported
- Loading branch information
Showing
16 changed files
with
206 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -556,6 +556,7 @@ | |
7C225E8827C4C5FE00154143 /* GroupInCommonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C225E8627C4C5FE00154143 /* GroupInCommonCell.swift */; }; | ||
7C225E8927C4C5FE00154143 /* GroupInCommonCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7C225E8727C4C5FE00154143 /* GroupInCommonCell.xib */; }; | ||
7C2475C727795BC100112A30 /* DeleteAccountTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2475C627795BC100112A30 /* DeleteAccountTableHeaderView.swift */; }; | ||
7C2AC42928F2B384005F369A /* DepositNotSupportedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2AC42828F2B384005F369A /* DepositNotSupportedViewController.swift */; }; | ||
7C2ACDAE27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2ACDAD27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift */; }; | ||
7C2DEFF12824FCF500758208 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7C2DEFF02824FCF500758208 /* [email protected] */; }; | ||
7C2DEFF32824FF0600758208 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7C2DEFF22824FF0600758208 /* [email protected] */; }; | ||
|
@@ -1564,6 +1565,7 @@ | |
7C225E8627C4C5FE00154143 /* GroupInCommonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupInCommonCell.swift; sourceTree = "<group>"; }; | ||
7C225E8727C4C5FE00154143 /* GroupInCommonCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GroupInCommonCell.xib; sourceTree = "<group>"; }; | ||
7C2475C627795BC100112A30 /* DeleteAccountTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteAccountTableHeaderView.swift; sourceTree = "<group>"; }; | ||
7C2AC42828F2B384005F369A /* DepositNotSupportedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DepositNotSupportedViewController.swift; sourceTree = "<group>"; }; | ||
7C2ACDAD27D73F7C00E9DDB3 /* LeftAlignedCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedCollectionViewFlowLayout.swift; sourceTree = "<group>"; }; | ||
7C2DEFF02824FCF500758208 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "[email protected]"; sourceTree = "<group>"; }; | ||
7C2DEFF22824FF0600758208 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "[email protected]"; sourceTree = "<group>"; }; | ||
|
@@ -3429,6 +3431,7 @@ | |
DF16681D20A6F84200C45E31 /* AllTransactionsViewController.swift */, | ||
DF9E66E4205B9AF300F1A0B9 /* HiddenAssetViewController.swift */, | ||
DF5BF5601FBB2D490092AFB8 /* DepositViewController.swift */, | ||
7C2AC42828F2B384005F369A /* DepositNotSupportedViewController.swift */, | ||
7B894AF2205BF8660065A1B8 /* AddressViewController.swift */, | ||
DF06D91E222FAE1300FE7FBC /* TransferOutViewController.swift */, | ||
7B894AF4205BFC9B0065A1B8 /* NewAddressViewController.swift */, | ||
|
@@ -4640,6 +4643,7 @@ | |
7BFE47E22284394000FC4379 /* CheckmarkPeerCell.swift in Sources */, | ||
7B369208233A43C1007321A7 /* SegmentedControl.swift in Sources */, | ||
9427D51A25E0D42E00B1EF0E /* MusicInfoView.swift in Sources */, | ||
7C2AC42928F2B384005F369A /* DepositNotSupportedViewController.swift in Sources */, | ||
7B082D1A242CACA000C5E163 /* MultipleSelectionActionView.swift in Sources */, | ||
7BFE47DB228421D100FC4379 /* UserItemPeerViewController.swift in Sources */, | ||
7C4C03A128532575003DE0C0 /* AddContactViewController.swift in Sources */, | ||
|
22 changes: 22 additions & 0 deletions
22
Mixin/Assets.xcassets/ic_deposit_warning.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
Mixin/UserInterface/Controllers/Wallet/DepositNotSupportedViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import UIKit | ||
import MixinServices | ||
|
||
class DepositNotSupportedViewController: UIViewController { | ||
|
||
@IBOutlet weak var label: TextLabel! | ||
|
||
@IBOutlet weak var wrapperViewLeadingConstraint: NSLayoutConstraint! | ||
@IBOutlet weak var wrapperViewTrailingConstraint: NSLayoutConstraint! | ||
@IBOutlet weak var labelLeadingConstraint: NSLayoutConstraint! | ||
@IBOutlet weak var labelTrailingConstraint: NSLayoutConstraint! | ||
@IBOutlet weak var labelHeightConstraint: NSLayoutConstraint! | ||
|
||
private var asset: AssetItem! | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
container?.setSubtitle(subtitle: asset.symbol) | ||
view.layoutIfNeeded() | ||
|
||
label.delegate = self | ||
label.font = .systemFont(ofSize: 14, weight: .medium) | ||
label.lineSpacing = 10 | ||
label.textColor = R.color.red()! | ||
label.linkColor = .theme | ||
label.detectLinks = false | ||
let text = R.string.localizable.not_supported_deposit(asset.symbol, asset.symbol) | ||
label.text = text | ||
let linkRange = (text as NSString).range(of: R.string.localizable.learn_more(), options: [.backwards, .caseInsensitive]) | ||
if linkRange.location != NSNotFound && linkRange.length != 0 { | ||
label.additionalLinksMap = [linkRange: .notSupportedDeposit] | ||
} | ||
} | ||
|
||
override func viewDidLayoutSubviews() { | ||
super.viewDidLayoutSubviews() | ||
let labelWidth = view.bounds.width | ||
- labelLeadingConstraint.constant | ||
- labelTrailingConstraint.constant | ||
- wrapperViewLeadingConstraint.constant | ||
- wrapperViewTrailingConstraint.constant | ||
let sizeToFitLabel = CGSize(width: labelWidth, height: UIView.layoutFittingExpandedSize.height) | ||
let textLabelHeight = label.sizeThatFits(sizeToFitLabel).height | ||
labelHeightConstraint.constant = textLabelHeight | ||
} | ||
|
||
class func instance(asset: AssetItem) -> UIViewController { | ||
let vc = R.storyboard.wallet.deposit_not_supported()! | ||
vc.asset = asset | ||
return ContainerViewController.instance(viewController: vc, title: R.string.localizable.deposit()) | ||
} | ||
|
||
} | ||
|
||
extension DepositNotSupportedViewController: ContainerViewControllerDelegate { | ||
|
||
var prefersNavigationBarSeparatorLineHidden: Bool { | ||
true | ||
} | ||
|
||
func imageBarRightButton() -> UIImage? { | ||
R.image.ic_titlebar_help() | ||
} | ||
|
||
func barRightButtonTappedAction() { | ||
UIApplication.shared.openURL(url: .deposit) | ||
} | ||
|
||
} | ||
|
||
extension DepositNotSupportedViewController: CoreTextLabelDelegate { | ||
|
||
func coreTextLabel(_ label: CoreTextLabel, didSelectURL url: URL) { | ||
UIApplication.shared.open(url, options: [:], completionHandler: nil) | ||
} | ||
|
||
func coreTextLabel(_ label: CoreTextLabel, didLongPressOnURL url: URL) { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.