From 0477835c8674fc16b437a0517e64e9f153aa4163 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 23 Apr 2018 13:35:35 +0800 Subject: [PATCH 1/5] Fix: cancel button in text sharing sheet, e.g. in transfer flow, is not visible --- Trust/Style/AppStyle.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Trust/Style/AppStyle.swift b/Trust/Style/AppStyle.swift index 5261b5100..4720866d0 100644 --- a/Trust/Style/AppStyle.swift +++ b/Trust/Style/AppStyle.swift @@ -23,6 +23,7 @@ func applyStyle() { //We could have set the backBarButtonItem with an empty title for every view controller, but we don't have a place to do it for Eureka view controllers. Using appearance here, while a hack is still more convenient though, since we don't have to do it for every view controller instance UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset(horizontal: -200, vertical: 0), for: .default) + UIBarButtonItem.appearance().tintColor = Colors.appWhite UIToolbar.appearance().tintColor = Colors.appBackground From c528058afcb65742dfe19b9598a4254586df540c Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 23 Apr 2018 13:42:38 +0800 Subject: [PATCH 2/5] Add missing localization strings --- Trust/Localization/en.lproj/Localizable.strings | 2 ++ .../ViewControllers/TicketRedemptionViewController.swift | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Trust/Localization/en.lproj/Localizable.strings b/Trust/Localization/en.lproj/Localizable.strings index 605a9e125..55af50f89 100644 --- a/Trust/Localization/en.lproj/Localizable.strings +++ b/Trust/Localization/en.lproj/Localizable.strings @@ -184,6 +184,8 @@ "a.wallet.ticketToken.redeem.selectQuantity.title" = "Select Quantity of Tickets"; "a.wallet.ticketToken.redeem.quantity.title" = "QUANTITY OF TICKETS"; "a.wallet.ticketToken.redeem.showQRCode.title" = "Show QR Code to Redemption Booth"; +"a.wallet.ticketToken.redeem.successful.title" = "Congrats"; +"a.wallet.ticketToken.redeem.successful.description" = "You have successfully redeemed your ticket(s)"; "a.wallet.ticketToken.sell.button.title" = "Sell"; "a.wallet.ticketToken.sell.selectTickets.title" = "Select Tickets To Sell:"; "a.wallet.ticketToken.sell.ethHelp.title" = "Set Ethereum price for magic link:"; diff --git a/Trust/Redeem/ViewControllers/TicketRedemptionViewController.swift b/Trust/Redeem/ViewControllers/TicketRedemptionViewController.swift index 9e1a98385..3a8122120 100644 --- a/Trust/Redeem/ViewControllers/TicketRedemptionViewController.swift +++ b/Trust/Redeem/ViewControllers/TicketRedemptionViewController.swift @@ -117,8 +117,9 @@ class TicketRedemptionViewController: UIViewController { private func showSuccessMessage() { invalidateTimer() - UIAlertController.alert(title: "Congrats", - message: "You have successfully redeemed your ticket(s)", + + UIAlertController.alert(title: R.string.localizable.aWalletTicketTokenRedeemSuccessfulTitle(), + message: R.string.localizable.aWalletTicketTokenRedeemSuccessfulDescription(), alertButtonTitles: [R.string.localizable.oK()], alertButtonStyles: [.cancel], viewController: self, From 1b00cf31819afa70b892a8750d2c85b4760a87a1 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 23 Apr 2018 13:46:30 +0800 Subject: [PATCH 3/5] Make quantity stepper have the same border width, 1, in all screens --- .../RedeemTicketsQuantitySelectionViewController.swift | 2 +- .../TransferTicketsQuantitySelectionViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Trust/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift b/Trust/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift index fda349899..e6f8d05f9 100644 --- a/Trust/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift +++ b/Trust/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift @@ -144,7 +144,7 @@ class RedeemTicketsQuantitySelectionViewController: UIViewController { ticketView.configure(viewModel: .init()) - quantityStepper.borderWidth = 2 + quantityStepper.borderWidth = 1 quantityStepper.clipsToBounds = true quantityStepper.borderColor = viewModel.stepperBorderColor quantityStepper.maximumValue = viewModel.maxValue diff --git a/Trust/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift b/Trust/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift index a024a311e..b4b49a57f 100644 --- a/Trust/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift +++ b/Trust/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift @@ -140,7 +140,7 @@ class TransferTicketsQuantitySelectionViewController: UIViewController { ticketView.configure(viewModel: .init()) - quantityStepper.borderWidth = 2 + quantityStepper.borderWidth = 1 quantityStepper.clipsToBounds = true quantityStepper.borderColor = viewModel.stepperBorderColor quantityStepper.maximumValue = viewModel.maxValue From a7099b3ce15ed8fa43c099108362fdedbeac8d0e Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 23 Apr 2018 14:28:37 +0800 Subject: [PATCH 4/5] Remove unused share mode button class --- Trust/Transfer/Views/ShareModeButton.swift | 90 ---------------------- 1 file changed, 90 deletions(-) delete mode 100644 Trust/Transfer/Views/ShareModeButton.swift diff --git a/Trust/Transfer/Views/ShareModeButton.swift b/Trust/Transfer/Views/ShareModeButton.swift deleted file mode 100644 index 97bbeb042..000000000 --- a/Trust/Transfer/Views/ShareModeButton.swift +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright © 2018 Stormbird PTE. LTD. - -import UIKit - -class ShareModeButton: UIControl { - var title: String = "" { - didSet { - label.text = title - } - } - var image: UIImage? { - didSet { - imageView.image = image - } - } - let background = UIControl() - let imageView = UIImageView() - let label = UILabel() - var callback: (()->())? - - init() { - super.init(frame: .zero) - - background.addTarget(self, action: #selector(touchDown), for: .touchDown) - background.addTarget(self, action: #selector(touchUpInside), for: .touchUpInside) - background.addTarget(self, action: #selector(touchUpOutside), for: .touchUpOutside) - - background.translatesAutoresizingMaskIntoConstraints = false - addSubview(background) - - background.backgroundColor = Colors.appWhite - background.layer.cornerRadius = 20 - background.layer.shadowRadius = 3 - background.layer.shadowColor = UIColor.black.cgColor - background.layer.shadowOffset = CGSize(width: 0, height: 0) - background.layer.shadowOpacity = 0.14 - background.layer.borderColor = UIColor.black.cgColor - - label.translatesAutoresizingMaskIntoConstraints = false - label.textAlignment = .center - label.numberOfLines = 0 - addSubview(label) - - imageView.translatesAutoresizingMaskIntoConstraints = false - imageView.contentMode = .scaleAspectFit - addSubview(imageView) - - let constraintForImageViewTop: NSLayoutConstraint - if ScreenChecker().isNarrowScreen() { - constraintForImageViewTop = imageView.topAnchor.constraint(equalTo: topAnchor, constant: 3) - } else { - constraintForImageViewTop = imageView.bottomAnchor.constraint(equalTo: centerYAnchor, constant: 7) - } - - NSLayoutConstraint.activate([ - background.leadingAnchor.constraint(equalTo: leadingAnchor), - background.trailingAnchor.constraint(equalTo: trailingAnchor), - background.topAnchor.constraint(equalTo: topAnchor), - background.bottomAnchor.constraint(equalTo: bottomAnchor), - - imageView.centerXAnchor.constraint(equalTo: centerXAnchor), - constraintForImageViewTop, - imageView.bottomAnchor.constraint(equalTo: label.topAnchor, constant: -3), - - imageView.widthAnchor.constraint(equalToConstant: 70), - imageView.heightAnchor.constraint(equalToConstant: 70), - - label.leftAnchor.constraint(equalTo: leftAnchor, constant: 10), - label.rightAnchor.constraint(equalTo: rightAnchor, constant: -10), - label.bottomAnchor.constraint(equalTo: bottomAnchor), - - widthAnchor.constraint(equalTo: heightAnchor) - ]) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - @objc func touchDown() { - background.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1) - } - @objc func touchUpInside() { - background.backgroundColor = Colors.appWhite - callback?() - } - @objc func touchUpOutside() { - background.backgroundColor = Colors.appWhite - } -} From 22c1a23d18aaaf7ca48160b2bb39760de896fad7 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 23 Apr 2018 14:40:58 +0800 Subject: [PATCH 5/5] Extract app store link to a constant --- Trust/Settings/Coordinators/HelpUsCoordinator.swift | 2 +- Trust/Settings/Types/Constants.swift | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Trust/Settings/Coordinators/HelpUsCoordinator.swift b/Trust/Settings/Coordinators/HelpUsCoordinator.swift index d7fa55330..a8c3c5638 100644 --- a/Trust/Settings/Coordinators/HelpUsCoordinator.swift +++ b/Trust/Settings/Coordinators/HelpUsCoordinator.swift @@ -31,7 +31,7 @@ class HelpUsCoordinator: Coordinator { func rateUs() { if #available(iOS 10.3, *) { SKStoreReviewController.requestReview() } else { - UIApplication.shared.openURL(URL(string: "itms-apps://itunes.apple.com/app/id1288339409")!) + UIApplication.shared.openURL(URL(string: Constants.appstoreURL)!) } appTracker.completedRating = true } diff --git a/Trust/Settings/Types/Constants.swift b/Trust/Settings/Types/Constants.swift index 9353fa0bf..b59b4cac4 100644 --- a/Trust/Settings/Types/Constants.swift +++ b/Trust/Settings/Types/Constants.swift @@ -14,6 +14,8 @@ public struct Constants { public static let twitterUsername = "Alpha_wallet" public static let redditGroupName = "r/AlphaWallet/" public static let facebookUsername = "AlphaWallet" + //TODO need to change this for launch + public static let appstoreURL = "itms-apps://itunes.apple.com/app/id1288339409" // support public static let supportEmail = "support@awallet.io"