Browse Source

Add SwipeNavigationController and add themeBackgroundGray

pull/1/head
InKwon James Kim 5 years ago
parent
commit
aeee16a242
  1. 4
      GME Remit.xcodeproj/project.pbxproj
  2. 4
      GME Remit/Extensions/UIColor+Ext.swift
  3. 6
      GME Remit/Extensions/UIViewController+Ext.swift
  4. 6
      GME Remit/Modules/Home/User Interface/View/HomeViewController.swift
  5. 2
      GME Remit/Modules/LauncherScreen/User Interface/Wireframe/LauncherScreenWireframe.swift
  6. 8
      GME Remit/Modules/Main/User Interface/Wireframe/MainWireframe.swift
  7. 15
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Recipients.storyboard
  8. 21
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift
  9. 2
      GME Remit/Modules/RegisterModules/PennyTestSubmit/User Interface/View/PennyTestSubmitViewController.swift
  10. 12
      GME Remit/Modules/RewardModules/DetailOrder/User Interface/View/DetailOrderViewController.swift
  11. 3
      GME Remit/Modules/SideMenu/SideMenu.storyboard
  12. 2
      GME Remit/MultiLanguages/en.lproj/Localizable.strings
  13. 1
      GME Remit/Utilities/ConfirmAlert/ConfirmViewController.swift
  14. 1
      GME Remit/Utilities/GMEAlert/GMEAlertViewController.swift
  15. 83
      GME Remit/Utilities/SwipeNavigationController.swift
  16. 2
      GME Remit/Utilities/TablePresenter/User Interface/View/TablePresenterViewController.swift

4
GME Remit.xcodeproj/project.pbxproj

@ -198,6 +198,7 @@
731627A52301009800BA48A8 /* ExchangeRateRequestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 731627A42301009800BA48A8 /* ExchangeRateRequestModel.swift */; };
73168A1F22F3CC4C00878038 /* NativeCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73168A1E22F3CC4B00878038 /* NativeCountry.swift */; };
73168A2322F3D01A00878038 /* TablePresenterProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73168A2222F3D01900878038 /* TablePresenterProtocol.swift */; };
731703CC23221EA0005752DE /* SwipeNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 731703CB23221EA0005752DE /* SwipeNavigationController.swift */; };
73185314230E19DD00BA9AE3 /* ValidateAccountRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73185313230E19DD00BA9AE3 /* ValidateAccountRequest.swift */; };
73185316230EA5FB00BA9AE3 /* SaveResponseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73185315230EA5FB00BA9AE3 /* SaveResponseModel.swift */; };
7318534E230EACA400BA9AE3 /* SendMoneyTransFerReasonViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73185329230EACA300BA9AE3 /* SendMoneyTransFerReasonViewModel.swift */; };
@ -2420,6 +2421,7 @@
731627A42301009800BA48A8 /* ExchangeRateRequestModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeRateRequestModel.swift; sourceTree = "<group>"; };
73168A1E22F3CC4B00878038 /* NativeCountry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NativeCountry.swift; sourceTree = "<group>"; };
73168A2222F3D01900878038 /* TablePresenterProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TablePresenterProtocol.swift; sourceTree = "<group>"; };
731703CB23221EA0005752DE /* SwipeNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeNavigationController.swift; sourceTree = "<group>"; };
73185313230E19DD00BA9AE3 /* ValidateAccountRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValidateAccountRequest.swift; sourceTree = "<group>"; };
73185315230EA5FB00BA9AE3 /* SaveResponseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SaveResponseModel.swift; sourceTree = "<group>"; };
73185329230EACA300BA9AE3 /* SendMoneyTransFerReasonViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendMoneyTransFerReasonViewModel.swift; sourceTree = "<group>"; };
@ -10810,6 +10812,7 @@
73895FF522C2F208003FEA90 /* TablePresenter */,
D95B7044213FB5F00053CC3D /* WebLinks */,
738F04B02316238600BA5EE7 /* ShadowView.swift */,
731703CB23221EA0005752DE /* SwipeNavigationController.swift */,
);
path = Utilities;
sourceTree = "<group>";
@ -14384,6 +14387,7 @@
04E36E2021AE585200783685 /* PennyTestSubmitWireframeInput.swift in Sources */,
D90A9D5C2136942300A96E45 /* BankBranchPickerViewController.swift in Sources */,
D922D9682135145F00D43053 /* SendMoneyParentWireframe.swift in Sources */,
731703CC23221EA0005752DE /* SwipeNavigationController.swift in Sources */,
736A8C402277EB2A00337A50 /* BiometricNotificationModuleInterface.swift in Sources */,
73149F6422E5AF8000D66B26 /* LauncherScreenServiceType.swift in Sources */,
73071ACD2296CF9B008840FD /* HotLineViewInterface.swift in Sources */,

4
GME Remit/Extensions/UIColor+Ext.swift

@ -52,4 +52,8 @@ extension UIColor {
class var themeBackgroundColor: UIColor {
return .init(hex: "E7EDF2")
}
class var themeBackgroundGray: UIColor {
return UIColor.black.withAlphaComponent(0.5)
}
}

6
GME Remit/Extensions/UIViewController+Ext.swift

@ -267,14 +267,14 @@ extension UIViewController {
}
func showProgressHud(
backgroundColor: UIColor = .clear,
backgroundColor: UIColor = .themeBackgroundGray,
loadingColor: UIColor = .themeRed,
textColor: UIColor = .themeTextColor
textColor: UIColor = .white
) {
let activityData = ActivityData(
size: CGSize(width: 50, height: 50),
message: "loading_text".localized(),
messageFont: .sanfrancisco(.regular, size: 12),
messageFont: .sanfrancisco(.medium, size: 14),
messageSpacing: 2,
type: .lineScale,
color: loadingColor,

6
GME Remit/Modules/Home/User Interface/View/HomeViewController.swift

@ -105,7 +105,6 @@ class HomeViewController: UIViewController {
let supportImage = UIImage(named: "ic_support")?.withRenderingMode(.alwaysOriginal)
supportBarButton.image = supportImage
}
override func viewWillAppear(_ animated: Bool) {
@ -118,7 +117,7 @@ class HomeViewController: UIViewController {
name: NSNotification.Name(LCLLanguageChangeNotification),
object: nil
)
setNavBar(isUseMenu: false)
presenter?.viewIsReady()
presenter?.fetchHotLines()
}
@ -128,11 +127,12 @@ class HomeViewController: UIViewController {
self.navigationItem.title = ""
blobView.removeFromSuperview()
MainWireframe.shared?.isUseSwipeGesture = false
navigationController?.interactivePopGestureRecognizer?.isEnabled = true
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
navigationController?.interactivePopGestureRecognizer?.isEnabled = false
// if kyc is false then,
if self.didNotSubmitKycAndNotVerified() {
self.presenter?.showKyc()

2
GME Remit/Modules/LauncherScreen/User Interface/Wireframe/LauncherScreenWireframe.swift

@ -112,7 +112,7 @@ extension LauncherScreenWireframe: SecureKeypadDelegate {
// MARK: - Other Methods
extension LauncherScreenWireframe {
private func doLogin() {
biometricViewController?.showProgressHud(loadingColor: .white, textColor: .white)
biometricViewController?.showProgressHud(backgroundColor: .clear, loadingColor: .white, textColor: .white)
let loginService = LoginService()

8
GME Remit/Modules/Main/User Interface/Wireframe/MainWireframe.swift

@ -35,16 +35,16 @@ extension MainWireframe: MainWireframeInput {
private func getViewControllers() -> [UIViewController] {
let homeViewController = HomeWireframe().getMainView()
let navHomeViewController = UINavigationController(rootViewController: homeViewController)
let navHomeViewController = SwipeNavigationController(rootViewController: homeViewController)
navHomeViewController.hero.isEnabled = true
let sendMoneyViewController = RecipientsWireframe().getMainView()
sendMoneyViewController.setupTabItem()
let navSendMoneyViewController = UINavigationController(rootViewController: sendMoneyViewController)
let navSendMoneyViewController = SwipeNavigationController(rootViewController: sendMoneyViewController)
navSendMoneyViewController.hero.isEnabled = true
let contactsViewController = GmeContactsWireframe().getMainView()
let navContactsViewController = UINavigationController(rootViewController: contactsViewController)
let navContactsViewController = SwipeNavigationController(rootViewController: contactsViewController)
guard let profileViewController = UIStoryboard(name: "Profile", bundle: nil)
.instantiateViewController(withIdentifier: "ProfileViewController") as? ProfileViewController else {
return [navHomeViewController, navSendMoneyViewController, navContactsViewController]
@ -52,7 +52,7 @@ extension MainWireframe: MainWireframeInput {
profileViewController.setupTabItem()
let navProfileViewController = UINavigationController(rootViewController: profileViewController)
let navProfileViewController = SwipeNavigationController(rootViewController: profileViewController)
return [
navHomeViewController,

15
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Recipients.storyboard

@ -84,7 +84,21 @@
<view key="tableFooterView" contentMode="scaleToFill" id="IIt-Yb-InY">
<rect key="frame" x="0.0" y="445.5" width="315" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="There are no recipients." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Sv8-Ik-xEU">
<rect key="frame" x="0.0" y="0.0" width="315" height="44"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Sv8-Ik-xEU" firstAttribute="top" secondItem="IIt-Yb-InY" secondAttribute="top" id="2Oc-UJ-jUe"/>
<constraint firstAttribute="trailing" secondItem="Sv8-Ik-xEU" secondAttribute="trailing" id="SLn-yR-a8Q"/>
<constraint firstItem="Sv8-Ik-xEU" firstAttribute="leading" secondItem="IIt-Yb-InY" secondAttribute="leading" id="txD-ic-GIW"/>
<constraint firstAttribute="bottom" secondItem="Sv8-Ik-xEU" secondAttribute="bottom" id="wYx-Gk-Ssg"/>
</constraints>
</view>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="RecipientCell" rowHeight="170" id="hGj-Pf-Qj3" customClass="RecipientCell" customModule="GME_Remit" customModuleProvider="target">
@ -224,6 +238,7 @@
<outlet property="addRecipientTapGestureRecognizer" destination="LhF-Qk-byx" id="S5D-qr-6br"/>
<outlet property="labelSwipeInfo" destination="BNw-Op-I8T" id="8ly-s7-9xH"/>
<outlet property="newRecipeintLabel" destination="Wj9-qf-u2U" id="YQc-G8-tZa"/>
<outlet property="noRecipientLabel" destination="Sv8-Ik-xEU" id="0aW-iA-5Fi"/>
<outlet property="searchBar" destination="6U0-GV-UwI" id="vl5-Is-MML"/>
<outlet property="tableView" destination="vEB-d2-zNF" id="qhO-6Y-duq"/>
<outlet property="viewAddRecipient" destination="P7h-Wp-hN8" id="W9O-kc-kXA"/>

21
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift

@ -35,6 +35,8 @@ class RecipientsViewController: UIViewController {
@IBOutlet private weak var viewAddRecipient: UIView!
@IBOutlet private weak var labelSwipeInfo: UILabel!
@IBOutlet private weak var newRecipeintLabel: UILabel!
@IBOutlet private weak var noRecipientLabel: UILabel!
@IBOutlet private var addRecipientTapGestureRecognizer: UITapGestureRecognizer!
@IBOutlet private weak var searchBar: UISearchBar!
@ -80,10 +82,6 @@ extension RecipientsViewController {
private func setup() {
viewAddRecipient.hero.id = "setupRecipient"
navigationController?.interactivePopGestureRecognizer?.delegate = self
navigationController?.interactivePopGestureRecognizer?.isEnabled = true
// all setup should be done here
setBinding()
tableView.separatorColor = .themeBorderColor
@ -125,10 +123,9 @@ extension RecipientsViewController {
output
.recipients
.map { $0.count == 0 }
.map { $0.count != 0 }
.drive(onNext: {
self.searchBar.isHidden = $0
self.labelSwipeInfo.isHidden = $0
self.noRecipientLabel.isHidden = $0
})
.disposed(by: disposeBag)
@ -222,13 +219,3 @@ extension RecipientsViewController: UITableViewDelegate {
return [delete, edit]
}
}
// MARK: - UIGestureRecognizerDelegate
extension RecipientsViewController: UIGestureRecognizerDelegate {
func gestureRecognizer(
_ gestureRecognizer: UIGestureRecognizer,
shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer
) -> Bool {
return true
}
}

2
GME Remit/Modules/RegisterModules/PennyTestSubmit/User Interface/View/PennyTestSubmitViewController.swift

@ -250,7 +250,7 @@ class PennyTestSubmitViewController: UIViewController {
return
}
self.showLoading()
self.showProgressHud(backgroundColor: .clear, loadingColor: .white, textColor: .white)
loginService.accessCode(
userId: userID,

12
GME Remit/Modules/RewardModules/DetailOrder/User Interface/View/DetailOrderViewController.swift

@ -17,7 +17,7 @@ class DetailOrderViewController: UIViewController {
// MARK: Computed Properties
private var order: Order? {
didSet{
didSet {
guard
let order = order,
let statusCode = order.orderStatus,
@ -34,7 +34,8 @@ class DetailOrderViewController: UIViewController {
orderStatusLabel.text = status.message
orderDateLabel.text = order.createdDate
orderIDNumberLabel.text = order.orderID
orderTypeLabel.text = order.orderType == "9" ? "canceled_text".localized() : "pickup_from_branch_text".localized()
orderTypeLabel.text = order.orderType == "9" ?
"canceled_text".localized() : "pickup_from_branch_text".localized()
switch order.orderStatus {
case "9" :
@ -120,7 +121,7 @@ extension DetailOrderViewController {
navigationController?.interactivePopGestureRecognizer?.isEnabled = true
}
private func setMultiLanguage(){
private func setMultiLanguage() {
receiverNameTitleLabel.text = "receiver_text".localized()
mobileNumberTitleLabel.text = "mobile_number_text".localized()
pickupBranchTitleLabel.text = "pickup_banch_text".localized()
@ -135,7 +136,10 @@ extension DetailOrderViewController {
// MARK: - UIGestureRecognizerDelegate
extension DetailOrderViewController: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
func gestureRecognizer(
_ gestureRecognizer: UIGestureRecognizer,
shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer
) -> Bool {
return true
}
}

3
GME Remit/Modules/SideMenu/SideMenu.storyboard

@ -142,9 +142,10 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="KRW" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q40-hg-fAU">
<rect key="frame" x="18.5" y="30.5" width="28" height="17"/>
<rect key="frame" x="18.5" y="30.5" width="30" height="17"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="Zlb-nJ-1BU"/>
<constraint firstAttribute="height" constant="17" id="bXF-BK-zRn"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>

2
GME Remit/MultiLanguages/en.lproj/Localizable.strings

@ -542,6 +542,7 @@
"autodebit_account_required_message" = "Please add your Auto Debit account to start using GME services.";
// Dynamic recipient
"recipient_no_text" = "There are no recipients.";
"recipient_text" = "Recipient";
"country_text" = "Payout Country";
@ -602,3 +603,4 @@
// Indicator
"loading_text" = "Loading";

1
GME Remit/Utilities/ConfirmAlert/ConfirmViewController.swift

@ -75,6 +75,7 @@ class ConfirmViewController: UIViewController {
confirmButton.backgroundColor = .themeRed
cancelButton.setTitleColor(.themeRed, for: .normal)
transparentView.backgroundColor = .themeBackgroundGray
}
@objc func tapGesture(_ sender: UITapGestureRecognizer) {

1
GME Remit/Utilities/GMEAlert/GMEAlertViewController.swift

@ -79,6 +79,7 @@ class GMEAlertViewController: UIViewController {
titleLabel.textColor = type == .error ? .themeRed : .black
rightButton.backgroundColor = .themeRed
transParentView.backgroundColor = .themeBackgroundGray
}
override func viewWillAppear(_ animated: Bool) {

83
GME Remit/Utilities/SwipeNavigationController.swift

@ -0,0 +1,83 @@
//
// SwipeNavigationController.swift
// GME Remit
//
// Created by InKwon James Kim on 06/09/2019.
// Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
//
import UIKit
class SwipeNavigationController: UINavigationController {
// MARK: - Lifecycle
override init(rootViewController: UIViewController) {
super.init(rootViewController: rootViewController)
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
delegate = self
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
delegate = self
}
override func viewDidLoad() {
super.viewDidLoad()
// This needs to be in here, not in init
interactivePopGestureRecognizer?.delegate = self
}
deinit {
delegate = nil
interactivePopGestureRecognizer?.delegate = nil
}
// MARK: - Overrides
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
duringPushAnimation = true
super.pushViewController(viewController, animated: animated)
}
// MARK: - Private Properties
fileprivate var duringPushAnimation = false
}
// MARK: - UINavigationControllerDelegate
extension SwipeNavigationController: UINavigationControllerDelegate {
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
guard let swipeNavigationController = navigationController as? SwipeNavigationController else { return }
swipeNavigationController.duringPushAnimation = false
}
}
// MARK: - UIGestureRecognizerDelegate
extension SwipeNavigationController: UIGestureRecognizerDelegate {
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
guard gestureRecognizer == interactivePopGestureRecognizer else {
return true // default value
}
// Disable pop gesture in two situations:
// 1) when the pop animation is in progress
// 2) when user swipes quickly a couple of times and animations don't have time to be performed
return viewControllers.count > 1 && duringPushAnimation == false
}
}

2
GME Remit/Utilities/TablePresenter/User Interface/View/TablePresenterViewController.swift

@ -124,6 +124,8 @@ extension TablePresenterViewController {
closeButton.backgroundColor = .themeRed
presenter?.fetchModel(type: type)
transparentView.backgroundColor = .themeBackgroundGray
}
private func setConfiguration() {

Loading…
Cancel
Save