mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
IOS-131: Remove blurry background, make pageControl background promintent, remove inset (#991)
This commit is contained in:
parent
751b17a374
commit
41d3d8a7c6
@ -15,7 +15,6 @@ class WelcomeContentCollectionViewCell: UICollectionViewCell {
|
|||||||
private let contentStackView: UIStackView
|
private let contentStackView: UIStackView
|
||||||
private let titleView: UILabel
|
private let titleView: UILabel
|
||||||
private let label: UILabel
|
private let label: UILabel
|
||||||
private let blurryBackgroundView: UIVisualEffectView
|
|
||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
titleView = UILabel()
|
titleView = UILabel()
|
||||||
@ -36,15 +35,9 @@ class WelcomeContentCollectionViewCell: UICollectionViewCell {
|
|||||||
contentStackView.alignment = .leading
|
contentStackView.alignment = .leading
|
||||||
contentStackView.spacing = 8
|
contentStackView.spacing = 8
|
||||||
|
|
||||||
blurryBackgroundView = UIVisualEffectView(effect: UIBlurEffect(style: .systemUltraThinMaterialLight))
|
|
||||||
blurryBackgroundView.translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
blurryBackgroundView.applyCornerRadius(radius: 8)
|
|
||||||
|
|
||||||
blurryBackgroundView.contentView.addSubview(contentStackView)
|
|
||||||
|
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
addSubview(blurryBackgroundView)
|
addSubview(contentStackView)
|
||||||
|
|
||||||
setupConstraints()
|
setupConstraints()
|
||||||
}
|
}
|
||||||
@ -53,15 +46,11 @@ class WelcomeContentCollectionViewCell: UICollectionViewCell {
|
|||||||
|
|
||||||
private func setupConstraints() {
|
private func setupConstraints() {
|
||||||
let constraints = [
|
let constraints = [
|
||||||
blurryBackgroundView.topAnchor.constraint(equalTo: topAnchor),
|
contentStackView.topAnchor.constraint(equalTo: topAnchor),
|
||||||
blurryBackgroundView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
|
contentStackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
|
||||||
trailingAnchor.constraint(equalTo: blurryBackgroundView.trailingAnchor, constant: 16),
|
contentStackView.bottomAnchor.constraint(equalTo: bottomAnchor),
|
||||||
bottomAnchor.constraint(greaterThanOrEqualTo: blurryBackgroundView.bottomAnchor),
|
trailingAnchor.constraint(equalTo: contentStackView.trailingAnchor, constant: 16),
|
||||||
|
bottomAnchor.constraint(greaterThanOrEqualTo: contentStackView.bottomAnchor),
|
||||||
contentStackView.topAnchor.constraint(equalTo: blurryBackgroundView.contentView.topAnchor, constant: 8),
|
|
||||||
contentStackView.leadingAnchor.constraint(equalTo: blurryBackgroundView.contentView.leadingAnchor, constant: 8),
|
|
||||||
blurryBackgroundView.contentView.trailingAnchor.constraint(equalTo: contentStackView.trailingAnchor),
|
|
||||||
blurryBackgroundView.contentView.bottomAnchor.constraint(equalTo: contentStackView.bottomAnchor),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
NSLayoutConstraint.activate(constraints)
|
NSLayoutConstraint.activate(constraints)
|
||||||
|
@ -78,6 +78,7 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
|
|||||||
|
|
||||||
private(set) var pageControl: UIPageControl = {
|
private(set) var pageControl: UIPageControl = {
|
||||||
let pageControl = UIPageControl(frame: .zero)
|
let pageControl = UIPageControl(frame: .zero)
|
||||||
|
pageControl.backgroundStyle = .prominent
|
||||||
pageControl.translatesAutoresizingMaskIntoConstraints = false
|
pageControl.translatesAutoresizingMaskIntoConstraints = false
|
||||||
return pageControl
|
return pageControl
|
||||||
}()
|
}()
|
||||||
@ -91,7 +92,7 @@ extension WelcomeViewController {
|
|||||||
definesPresentationContext = true
|
definesPresentationContext = true
|
||||||
preferredContentSize = CGSize(width: 547, height: 678)
|
preferredContentSize = CGSize(width: 547, height: 678)
|
||||||
|
|
||||||
navigationController?.navigationBar.prefersLargeTitles = true
|
navigationController?.navigationBar.prefersLargeTitles = false
|
||||||
view.overrideUserInterfaceStyle = .light
|
view.overrideUserInterfaceStyle = .light
|
||||||
|
|
||||||
setupOnboardingAppearance()
|
setupOnboardingAppearance()
|
||||||
@ -149,7 +150,7 @@ extension WelcomeViewController {
|
|||||||
scrollView.delegate = self
|
scrollView.delegate = self
|
||||||
|
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
pageCollectionView.topAnchor.constraint(equalTo: view.topAnchor, constant: computedTopAnchorInset),
|
pageCollectionView.topAnchor.constraint(equalTo: view.topAnchor),
|
||||||
pageCollectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
pageCollectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||||
view.trailingAnchor.constraint(equalTo: pageCollectionView.trailingAnchor),
|
view.trailingAnchor.constraint(equalTo: pageCollectionView.trailingAnchor),
|
||||||
pageControl.topAnchor.constraint(equalTo: pageCollectionView.bottomAnchor, constant: 16),
|
pageControl.topAnchor.constraint(equalTo: pageCollectionView.bottomAnchor, constant: 16),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user