You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

105 lines
2.7 KiB

//
// RewardGroupViewController.swift
// GME Remit
//
// Created by InKwon Devik Kim on 13/05/2019.
//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
//
import UIKit
import XLPagerTabStrip
class RewardGroupViewController: ButtonBarPagerTabStripViewController {
// MARK: Properties
var presenter: RewardGroupModuleInterface?
// MARK: Computed Properties
// MARK: IBOutlets
@IBOutlet weak var closeBarButton: UIBarButtonItem!
// MARK: VC's Life cycle
override func viewDidLoad() {
super.viewDidLoad()
setup()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
title = "reward_group_title_text".localized()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
title = ""
}
override func viewControllers(
for pagerTabStripController: PagerTabStripViewController
) -> [UIViewController] {
let rewardViewController = RewardWireframe().getMainView()
let orderViewController = OrderHistoryWireframe().getMainView()
return [rewardViewController, orderViewController]
}
// MARK: IBActions
@IBAction func touchCloseButton(_ sender: UIBarButtonItem) {
dismiss(animated: true, completion: nil)
}
}
// MARK: RewardGroupViewInterface
extension RewardGroupViewController: RewardGroupViewInterface {
}
// MARK: Other Functions
extension RewardGroupViewController {
private func setup() {
// all setup should be done here
initXLPagerTabStrip()
closeBarButton.title = "penny_test_close_text".localized()
}
private func initXLPagerTabStrip() {
buttonBarView.backgroundColor = .init(hex: "#E7EDF2")
buttonBarView.selectedBar.backgroundColor = .themeRed
settings.style.selectedBarHeight = 1
settings.style.selectedBarBackgroundColor = .themeRed
settings.style.buttonBarItemFont = .sanfrancisco(.bold, size: 17)
settings.style.buttonBarBackgroundColor = .init(hex: "#E7EDF2")
settings.style.buttonBarItemBackgroundColor = .init(hex: "#E7EDF2")
settings.style.buttonBarLeftContentInset = 0
settings.style.buttonBarRightContentInset = 0
settings.style.buttonBarMinimumLineSpacing = 0
settings.style.buttonBarItemsShouldFillAvailiableWidth = true
changeCurrentIndexProgressive = {(
oldCell: ButtonBarViewCell?,
newCell: ButtonBarViewCell?,
progressPercentage: CGFloat,
changeCurrentIndex: Bool,
animated: Bool
) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = .init(hex: "#7b7a7a")
newCell?.label.textColor = .themeRed
}
}
}