mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Revert "Some polish here and there in regards (#690)"
This reverts commit a84910f2aba114a6600337dd9d50d3d5e5c749c6.
This commit is contained in:
parent
93d3472ba3
commit
c8e0419dec
@ -102,8 +102,6 @@ class MastodonLoginViewController: UIViewController, NeedsDependency {
|
|||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
|
|
||||||
navigationController?.setNavigationBarHidden(true, animated: false)
|
|
||||||
|
|
||||||
viewModel.updateServers()
|
viewModel.updateServers()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,9 +68,6 @@ extension MastodonPickServerViewController {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
navigationController?.navigationBar.prefersLargeTitles = true
|
|
||||||
navigationController?.setNavigationBarHidden(false, animated: false)
|
|
||||||
|
|
||||||
setupOnboardingAppearance()
|
setupOnboardingAppearance()
|
||||||
defer { setupNavigationBarBackgroundView() }
|
defer { setupNavigationBarBackgroundView() }
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import MastodonLocalization
|
|||||||
final class WelcomeViewController: UIViewController, NeedsDependency {
|
final class WelcomeViewController: UIViewController, NeedsDependency {
|
||||||
|
|
||||||
private enum Constants {
|
private enum Constants {
|
||||||
static let topAnchorInset: CGFloat = 24
|
static let topAnchorInset: CGFloat = 20
|
||||||
}
|
}
|
||||||
|
|
||||||
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
|
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
|
||||||
@ -75,7 +75,7 @@ extension WelcomeViewController {
|
|||||||
definesPresentationContext = true
|
definesPresentationContext = true
|
||||||
preferredContentSize = CGSize(width: 547, height: 678)
|
preferredContentSize = CGSize(width: 547, height: 678)
|
||||||
|
|
||||||
navigationController?.navigationBar.prefersLargeTitles = false
|
navigationController?.navigationBar.prefersLargeTitles = true
|
||||||
view.overrideUserInterfaceStyle = .light
|
view.overrideUserInterfaceStyle = .light
|
||||||
|
|
||||||
setupOnboardingAppearance()
|
setupOnboardingAppearance()
|
||||||
@ -135,7 +135,7 @@ extension WelcomeViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
pageViewController.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: Constants.topAnchorInset),
|
pageViewController.view.topAnchor.constraint(equalTo: view.topAnchor, constant: computedTopAnchorInset),
|
||||||
pageViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
pageViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||||
view.trailingAnchor.constraint(equalTo: pageViewController.view.trailingAnchor),
|
view.trailingAnchor.constraint(equalTo: pageViewController.view.trailingAnchor),
|
||||||
buttonContainer.topAnchor.constraint(equalTo: pageViewController.view.bottomAnchor, constant: 16),
|
buttonContainer.topAnchor.constraint(equalTo: pageViewController.view.bottomAnchor, constant: 16),
|
||||||
@ -145,24 +145,11 @@ extension WelcomeViewController {
|
|||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
.sink { [weak self] needsShowDismissEntry in
|
.sink { [weak self] needsShowDismissEntry in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
|
self.navigationItem.leftBarButtonItem = needsShowDismissEntry ? self.dismissBarButtonItem : nil
|
||||||
if needsShowDismissEntry {
|
|
||||||
self.navigationItem.leftBarButtonItem = self.dismissBarButtonItem
|
|
||||||
self.navigationController?.setNavigationBarHidden(false, animated: false)
|
|
||||||
} else {
|
|
||||||
self.navigationController?.setNavigationBarHidden(true, animated: false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
|
||||||
super.viewWillAppear(animated)
|
|
||||||
|
|
||||||
navigationController?.navigationBar.prefersLargeTitles = false
|
|
||||||
navigationController?.setNavigationBarHidden(true, animated: false)
|
|
||||||
}
|
|
||||||
|
|
||||||
override func viewDidLayoutSubviews() {
|
override func viewDidLayoutSubviews() {
|
||||||
super.viewDidLayoutSubviews()
|
super.viewDidLayoutSubviews()
|
||||||
|
|
||||||
@ -187,6 +174,10 @@ extension WelcomeViewController {
|
|||||||
setupIllustrationLayout()
|
setupIllustrationLayout()
|
||||||
setupButtonShadowView()
|
setupButtonShadowView()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var computedTopAnchorInset: CGFloat {
|
||||||
|
(navigationController?.navigationBar.bounds.height ?? UINavigationBar().bounds.height) + Constants.topAnchorInset
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension WelcomeViewController {
|
extension WelcomeViewController {
|
||||||
@ -248,7 +239,17 @@ extension WelcomeViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - OnboardingViewControllerAppearance
|
// MARK: - OnboardingViewControllerAppearance
|
||||||
extension WelcomeViewController: OnboardingViewControllerAppearance {}
|
extension WelcomeViewController: OnboardingViewControllerAppearance {
|
||||||
|
func setupNavigationBarAppearance() {
|
||||||
|
// always transparent
|
||||||
|
let barAppearance = UINavigationBarAppearance()
|
||||||
|
barAppearance.configureWithTransparentBackground()
|
||||||
|
navigationItem.standardAppearance = barAppearance
|
||||||
|
navigationItem.compactAppearance = barAppearance
|
||||||
|
navigationItem.scrollEdgeAppearance = barAppearance
|
||||||
|
navigationItem.compactScrollEdgeAppearance = barAppearance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - UIAdaptivePresentationControllerDelegate
|
// MARK: - UIAdaptivePresentationControllerDelegate
|
||||||
extension WelcomeViewController: UIAdaptivePresentationControllerDelegate {
|
extension WelcomeViewController: UIAdaptivePresentationControllerDelegate {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user