Show logo on landing screen

pull/44/head
Niels Andriesse 6 years ago
parent 605d2d34af
commit 1313c9c8d3

@ -14,41 +14,41 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
view.backgroundColor = Theme.backgroundColor view.backgroundColor = Theme.backgroundColor
view.layoutMargins = .zero view.layoutMargins = .zero
let heroImage = UIImage(named: "onboarding_splash_hero")
let heroImageView = UIImageView(image: heroImage)
heroImageView.contentMode = .scaleAspectFit
heroImageView.layer.minificationFilter = .trilinear
heroImageView.layer.magnificationFilter = .trilinear
heroImageView.setCompressionResistanceLow()
heroImageView.setContentHuggingVerticalLow()
heroImageView.accessibilityIdentifier = "onboarding.splash." + "heroImageView"
let titleLabel = self.createTitleLabel(text: NSLocalizedString("Loki Messenger", comment: "")) let titleLabel = self.createTitleLabel(text: NSLocalizedString("Loki Messenger", comment: ""))
view.addSubview(titleLabel) view.addSubview(titleLabel)
titleLabel.autoPinEdges(toSuperviewMarginsExcludingEdge: .bottom) titleLabel.autoPinEdges(toSuperviewMarginsExcludingEdge: .bottom)
titleLabel.accessibilityIdentifier = "onboarding.splash." + "titleLabel" titleLabel.accessibilityIdentifier = "onboarding.splash." + "titleLabel"
let explanationLabel = UILabel() let lokiLogo = UIImage(named: "LokiLogo")
explanationLabel.text = NSLocalizedString("Privacy Policy", comment: "") let lokiLogoImageView = UIImageView(image: lokiLogo)
explanationLabel.textColor = .ows_materialBlue lokiLogoImageView.accessibilityIdentifier = "onboarding.splash." + "lokiLogoImageView"
explanationLabel.font = UIFont.ows_dynamicTypeSubheadlineClamped lokiLogoImageView.autoSetDimension(.height, toSize: 71)
explanationLabel.numberOfLines = 0 lokiLogoImageView.contentMode = .scaleAspectFit
explanationLabel.textAlignment = .center
explanationLabel.lineBreakMode = .byWordWrapping let lokiLogoContainer = UIView()
explanationLabel.isUserInteractionEnabled = true view.setContentHuggingVerticalLow()
explanationLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(explanationLabelTapped))) view.setCompressionResistanceVerticalLow()
explanationLabel.accessibilityIdentifier = "onboarding.splash." + "explanationLabel" lokiLogoContainer.addSubview(lokiLogoImageView)
let privacyPolicyLabel = UILabel()
privacyPolicyLabel.text = NSLocalizedString("Privacy Policy", comment: "")
privacyPolicyLabel.textColor = .ows_materialBlue
privacyPolicyLabel.font = UIFont.ows_dynamicTypeSubheadlineClamped
privacyPolicyLabel.numberOfLines = 0
privacyPolicyLabel.textAlignment = .center
privacyPolicyLabel.lineBreakMode = .byWordWrapping
privacyPolicyLabel.isUserInteractionEnabled = true
privacyPolicyLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(explanationLabelTapped)))
privacyPolicyLabel.accessibilityIdentifier = "onboarding.splash." + "explanationLabel"
let continueButton = self.createButton(title: NSLocalizedString("BUTTON_CONTINUE", let continueButton = self.createButton(title: NSLocalizedString("BUTTON_CONTINUE", comment: "Label for 'continue' button."), selector: #selector(continuePressed))
comment: "Label for 'continue' button."),
selector: #selector(continuePressed))
view.addSubview(continueButton) view.addSubview(continueButton)
continueButton.accessibilityIdentifier = "onboarding.splash." + "continueButton" continueButton.accessibilityIdentifier = "onboarding.splash." + "continueButton"
let stackView = UIStackView(arrangedSubviews: [ let stackView = UIStackView(arrangedSubviews: [
titleLabel, titleLabel,
UIView.vStretchingSpacer(), lokiLogoContainer,
explanationLabel, privacyPolicyLabel,
UIView.spacer(withHeight: 24), UIView.spacer(withHeight: 24),
continueButton continueButton
]) ])
@ -60,6 +60,7 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
stackView.autoPinWidthToSuperview() stackView.autoPinWidthToSuperview()
stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0) stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0)
stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0) stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0)
lokiLogoImageView.autoCenterInSuperview()
} }
// MARK: - Events // MARK: - Events

Loading…
Cancel
Save