|
|
|
@ -14,9 +14,6 @@ import Kingfisher
|
|
|
|
|
import ETNavBarTransparent
|
|
|
|
|
|
|
|
|
|
class HomeViewController: TableViewController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var homePagerView: HomePagerView = {
|
|
|
|
|
let homePagerView = HomePagerView.init()
|
|
|
|
|
|
|
|
|
@ -34,9 +31,6 @@ class HomeViewController: TableViewController {
|
|
|
|
|
navigationItem.title = "期刊推荐"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if let navigationBar = self.navigationController?.navigationBar as? NavigationBar {
|
|
|
|
|
navigationBar.touchDelegate = self
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -52,6 +46,18 @@ class HomeViewController: TableViewController {
|
|
|
|
|
tabbar.showAllBar(true, animated: true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if let navigationBar = self.navigationController?.navigationBar as? NavigationBar {
|
|
|
|
|
navigationBar.passthroughView = homePagerView
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
|
|
|
super.viewWillDisappear(animated)
|
|
|
|
|
|
|
|
|
|
if let navigationBar = self.navigationController?.navigationBar as? NavigationBar {
|
|
|
|
|
navigationBar.passthroughView = nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func makeUI() {
|
|
|
|
@ -101,8 +107,6 @@ class HomeViewController: TableViewController {
|
|
|
|
|
|
|
|
|
|
self?.navigator.show(segue: .journalDetail(viewModel: journalDetailViewModel), sender: self)
|
|
|
|
|
|
|
|
|
|
default: break
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}.disposed(by: rx.disposeBag)
|
|
|
|
|
|
|
|
|
@ -160,6 +164,7 @@ class HomeViewController: TableViewController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func updateNav(navBarBgAlpha: CGFloat) {
|
|
|
|
|
|
|
|
|
|
self.navBarBgAlpha = navBarBgAlpha
|
|
|
|
|
self.currentNavBarBgAlpha = navBarBgAlpha
|
|
|
|
|
// 创建一个UINavigationBarAppearance的实例
|
|
|
|
@ -273,7 +278,7 @@ extension HomeViewController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension HomeViewController: NavigationBarTouchDelegate {
|
|
|
|
|
extension HomeViewController {
|
|
|
|
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
|
|
|
|
var delta = scrollView.contentOffset.y / CGFloat(BaseDimensions.topHeight)
|
|
|
|
|
delta = CGFloat.maximum(delta, 0)
|
|
|
|
@ -282,16 +287,4 @@ extension HomeViewController: NavigationBarTouchDelegate {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func navigationBar(_ navigationBar: NavigationBar, hitTest point: CGPoint, with event: UIEvent?) {
|
|
|
|
|
|
|
|
|
|
let pagerViewPoint = view.convert(point, to: homePagerView)
|
|
|
|
|
if homePagerView.point(inside: pagerViewPoint, with: event) {
|
|
|
|
|
homePagerView.pagerView.selectItem(at: homePagerView.pagerView.currentIndex, animated: true)
|
|
|
|
|
homePagerView.pagerView.delegate?.pagerView?(homePagerView.pagerView, didHighlightItemAt: homePagerView.pagerView.currentIndex)
|
|
|
|
|
homePagerView.pagerView.delegate?.pagerView?(homePagerView.pagerView, didSelectItemAt: homePagerView.pagerView.currentIndex)
|
|
|
|
|
}
|
|
|
|
|
print("导航栏点击")
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|