Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
chore: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mumer92 committed Jul 4, 2023
1 parent 5f0c8cf commit 49c2acd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
16 changes: 13 additions & 3 deletions Source/NewCourseContentController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class NewCourseContentController: UIViewController, InterfaceOrientationOverridi
self.courseOutlineMode = courseOutlineMode ?? .full
courseQuerier = environment.dataManager.courseDataManager.querierForCourseWithID(courseID: courseID, environment: environment)
super.init(nibName: nil, bundle: nil)
setStatusBar(color: environment.styles.primaryLightColor())

if let resumeCourseBlockID = resumeCourseBlockID {
currentBlock = courseQuerier.blockWithID(id: resumeCourseBlockID).firstSuccess().value
Expand Down Expand Up @@ -101,14 +100,14 @@ class NewCourseContentController: UIViewController, InterfaceOrientationOverridi
override func viewDidLoad() {
super.viewDidLoad()

setStatusBar(color: environment.styles.primaryLightColor())
addSubViews()
setupComponentView()
setupCompletedBlocksView()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setStatusBar(color: environment.styles.primaryLightColor())
navigationController?.setNavigationBarHidden(true, animated: false)
}

Expand Down Expand Up @@ -220,7 +219,18 @@ class NewCourseContentController: UIViewController, InterfaceOrientationOverridi
}

override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
setStatusBar(color: environment.styles.primaryLightColor())

if currentOrientation() == .portrait {
setStatusBar(color: environment.styles.primaryLightColor())
} else {
removeStatusBar()
}

if headerViewState == .collapsed {
collapseHeaderView()
} else if headerViewState == .expanded {
expandHeaderView()
}
}
}

Expand Down
22 changes: 21 additions & 1 deletion Source/NewCourseDashboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,18 @@ class NewCourseDashboardViewController: UIViewController, InterfaceOrientationOv

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
setupContentView()
setStatusBar(color: environment.styles.primaryLightColor())

if currentOrientation() == .portrait {
setStatusBar(color: environment.styles.primaryLightColor())
} else {
removeStatusBar()
}

if headerViewState == .collapsed {
collapseHeaderView()
} else if headerViewState == .expanded {
expandHeaderView()
}
}

private func prepareTabViewData() {
Expand Down Expand Up @@ -607,4 +618,13 @@ public extension UIViewController {
overView.backgroundColor = color
}
}

func removeStatusBar() {
DispatchQueue.main.async { [weak self] in
let tag = 123454321
if let taggedView = self?.view.viewWithTag(tag) {
taggedView.removeFromSuperview()
}
}
}
}

0 comments on commit 49c2acd

Please sign in to comment.