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.

106 lines
2.7 KiB

  1. //
  2. // RewardGroupViewController.swift
  3. // GME Remit
  4. //
  5. // Created by InKwon Devik Kim on 13/05/2019.
  6. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. import XLPagerTabStrip
  10. class RewardGroupViewController: ButtonBarPagerTabStripViewController {
  11. // MARK: Properties
  12. var presenter: RewardGroupModuleInterface?
  13. // MARK: Computed Properties
  14. // MARK: IBOutlets
  15. @IBOutlet weak var closeBarButton: UIBarButtonItem!
  16. // MARK: VC's Life cycle
  17. override func viewDidLoad() {
  18. super.viewDidLoad()
  19. setup()
  20. }
  21. override func viewWillAppear(_ animated: Bool) {
  22. super.viewWillAppear(animated)
  23. title = "reward_group_title_text".localized()
  24. setupNormalNavigation()
  25. }
  26. override func viewWillDisappear(_ animated: Bool) {
  27. super.viewWillDisappear(animated)
  28. title = ""
  29. }
  30. override func viewControllers(
  31. for pagerTabStripController: PagerTabStripViewController
  32. ) -> [UIViewController] {
  33. let rewardViewController = RewardWireframe().getMainView()
  34. let orderViewController = OrderHistoryWireframe().getMainView()
  35. return [rewardViewController, orderViewController]
  36. }
  37. // MARK: IBActions
  38. @IBAction func touchCloseButton(_ sender: UIBarButtonItem) {
  39. dismiss(animated: true, completion: nil)
  40. }
  41. }
  42. // MARK: RewardGroupViewInterface
  43. extension RewardGroupViewController: RewardGroupViewInterface {
  44. }
  45. // MARK: Other Functions
  46. extension RewardGroupViewController {
  47. private func setup() {
  48. // all setup should be done here
  49. initXLPagerTabStrip()
  50. closeBarButton.title = "penny_test_close_text".localized()
  51. }
  52. private func initXLPagerTabStrip() {
  53. buttonBarView.backgroundColor = .themeMainBackground
  54. buttonBarView.selectedBar.backgroundColor = .themeRed
  55. settings.style.selectedBarHeight = 1
  56. settings.style.selectedBarBackgroundColor = .themeRed
  57. settings.style.buttonBarItemFont = .sanfrancisco(.bold, size: 17)
  58. settings.style.buttonBarBackgroundColor = .themeMainBackground
  59. settings.style.buttonBarItemBackgroundColor = .themeMainBackground
  60. settings.style.buttonBarLeftContentInset = 0
  61. settings.style.buttonBarRightContentInset = 0
  62. settings.style.buttonBarMinimumLineSpacing = 0
  63. settings.style.buttonBarItemsShouldFillAvailiableWidth = true
  64. changeCurrentIndexProgressive = {(
  65. oldCell: ButtonBarViewCell?,
  66. newCell: ButtonBarViewCell?,
  67. progressPercentage: CGFloat,
  68. changeCurrentIndex: Bool,
  69. animated: Bool
  70. ) -> Void in
  71. guard changeCurrentIndex == true else { return }
  72. oldCell?.label.textColor = .init(hex: "#7b7a7a")
  73. newCell?.label.textColor = .themeRed
  74. }
  75. }
  76. }