Commit c70cbed2 authored by Jü's avatar

hidden donate button and added send to developer button

parent 7b692ae0
This diff is collapsed.
......@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<key>CFBundleVersion</key>
<string>1.1.0.1</string>
<string>1.1.0.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
......
......@@ -125,6 +125,7 @@ public class WalletCoordinator: RootViewCoordinator {
vc.instructionText = "Please choose a method"
vc.scanQRCodeButtonTitle = "Scan QR Code"
vc.pasteFromClipboardButtonTitle = "Paste from Clipboard"
vc.sendToDeveloperButtonTitle = "Send to Developer"
self.navigationController.pushViewController(vc, animated: true)
}
......@@ -230,7 +231,7 @@ extension WalletCoordinator: ReceipientVCDelegate {
self.navigationController.pushViewController(vc, animated: true)
}
func receipientPasteFromClipboardTouched(viewController: ReceipientVC) {
func receipientVCPasteFromClipboardTouched(viewController: ReceipientVC) {
guard let targetAddress = UIPasteboard.general.string else {
viewController.show(message: "Pasteboard is empty. Please open other app and copy the target wallet address into the pasteboard and then come back here.")
return
......@@ -246,6 +247,12 @@ extension WalletCoordinator: ReceipientVCDelegate {
self.showAmountViewController()
}
func receipientVCSendToDeveloperTouched(viewController: ReceipientVC) {
self.moneroBag.payment = self.getEmptyPayment()
self.moneroBag.payment?.targetAddress = Constants.donationWalletAddress
self.showAmountViewController()
}
private func showAmountViewController() {
let availableAmountInAtomicUnits = self.moneroBag.wallet?.balance ?? 0
let availableFormattedAmount = XMRFormatter.format(amount: availableAmountInAtomicUnits)
......
......@@ -12,7 +12,8 @@ import UIKit
protocol ReceipientVCDelegate: class {
func receipientVCBackTouched()
func receipientVCScanQRCodeTouched()
func receipientPasteFromClipboardTouched(viewController: ReceipientVC)
func receipientVCPasteFromClipboardTouched(viewController: ReceipientVC)
func receipientVCSendToDeveloperTouched(viewController: ReceipientVC)
}
......@@ -24,6 +25,7 @@ class ReceipientVC: UIViewController {
@IBOutlet weak var instructionTextLabel: UILabel!
@IBOutlet weak var scanQRCodeButton: UIButton!
@IBOutlet weak var pasteFromClipboardButton: UIButton!
@IBOutlet weak var sendToDeveloperButton: UIButton!
@IBAction func backButtonTouched() {
self.delegate?.receipientVCBackTouched()
......@@ -34,7 +36,11 @@ class ReceipientVC: UIViewController {
}
@IBAction func pasteFromClipboardButtonTouched() {
self.delegate?.receipientPasteFromClipboardTouched(viewController: self)
self.delegate?.receipientVCPasteFromClipboardTouched(viewController: self)
}
@IBAction func sendToDeveloperButtonTouched() {
self.delegate?.receipientVCSendToDeveloperTouched(viewController: self)
}
public weak var delegate: ReceipientVCDelegate?
......@@ -45,6 +51,7 @@ class ReceipientVC: UIViewController {
public var instructionText: String?
public var scanQRCodeButtonTitle: String?
public var pasteFromClipboardButtonTitle: String?
public var sendToDeveloperButtonTitle: String?
override func viewDidLoad() {
super.viewDidLoad()
......@@ -97,6 +104,9 @@ class ReceipientVC: UIViewController {
if let pasteFromClipboardButtonTitle = self.pasteFromClipboardButtonTitle {
self.pasteFromClipboardButton.setTitle(pasteFromClipboardButtonTitle, for: .normal)
}
if let sendToDeveloperButtonTitle = self.sendToDeveloperButtonTitle {
self.sendToDeveloperButton.setTitle(sendToDeveloperButtonTitle, for: .normal)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment