new upgrade layout

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent b7cc1e9f56
commit 90b1db9eb4

@ -11,19 +11,23 @@ private class IntroductingProfilesExperienceUpgradeViewController: ExperienceUpg
assert(view != nil) assert(view != nil)
assert(bodyLabel != nil) assert(bodyLabel != nil)
// Privacy Settings Button // Button
let button = UIButton() let button = UIButton()
view.addSubview(button) view.addSubview(button)
let privacyTitle = NSLocalizedString("UPGRADE_EXPERIENCE_INTRODUCING_PROFILES_BUTTON", comment: "button label shown one time, after user upgrades app") let buttonTitle = NSLocalizedString("UPGRADE_EXPERIENCE_INTRODUCING_PROFILES_BUTTON", comment: "button label shown one time, after user upgrades app")
button.setTitle(privacyTitle, for: .normal) button.setTitle(buttonTitle, for: .normal)
button.setTitleColor(UIColor.ows_signalBrandBlue(), for: .normal) button.setTitleColor(UIColor.white, for: .normal)
button.backgroundColor = UIColor.ows_materialBlue()
button.isUserInteractionEnabled = true button.isUserInteractionEnabled = true
button.addTarget(self, action:#selector(didTapButton), for: .touchUpInside) button.addTarget(self, action:#selector(didTapButton), for: .touchUpInside)
button.titleLabel?.font = bodyLabel.font button.contentEdgeInsets = UIEdgeInsets(top: 10, left: 20, bottom: 10, right: 20)
// Privacy Settings Button layout button.titleLabel?.font = UIFont.ows_mediumFont(withSize: ScaleFromIPhone5(18))
button.autoPinWidthToSuperview(withMargin: bodyMargin)
button.autoPinEdge(.top, to: .bottom, of: bodyLabel, withOffset: ScaleFromIPhone5(12)) // Button layout
button.autoPinEdge(.top, to: .bottom, of: bodyLabel, withOffset: ScaleFromIPhone5(18))
button.autoPinWidthToSuperview(withMargin: ScaleFromIPhone5(32))
button.sizeToFit() button.sizeToFit()
} }
@ -152,7 +156,7 @@ private class ExperienceUpgradeViewController: OWSViewController {
// Image layout // Image layout
imageView.autoPinWidthToSuperview() imageView.autoPinWidthToSuperview()
imageView.autoSetDimension(.height, toSize: ScaleFromIPhone5To7Plus(200, 280)) imageView.autoSetDimension(.height, toSize: ScaleFromIPhone5To7Plus(200, 280))
imageView.autoPinEdge(.top, to: .bottom, of: titleLabel, withOffset: ScaleFromIPhone5(32)) imageView.autoPinEdge(.top, to: .bottom, of: titleLabel, withOffset: ScaleFromIPhone5To7Plus(36, 60))
imageView.autoPinEdge(.bottom, to: .top, of: bodyLabel, withOffset: -ScaleFromIPhone5To7Plus(18, 28)) imageView.autoPinEdge(.bottom, to: .top, of: bodyLabel, withOffset: -ScaleFromIPhone5To7Plus(18, 28))
} }
} }
@ -161,7 +165,7 @@ func setPageControlAppearance() {
if #available(iOS 9.0, *) { if #available(iOS 9.0, *) {
let pageControl = UIPageControl.appearance(whenContainedInInstancesOf: [UIPageViewController.self]) let pageControl = UIPageControl.appearance(whenContainedInInstancesOf: [UIPageViewController.self])
pageControl.pageIndicatorTintColor = UIColor.lightGray pageControl.pageIndicatorTintColor = UIColor.lightGray
pageControl.currentPageIndicatorTintColor = UIColor.white pageControl.currentPageIndicatorTintColor = UIColor.ows_materialBlue()
} else { } else {
// iOS8 won't see the page controls =( // iOS8 won't see the page controls =(
} }
@ -224,20 +228,14 @@ class ExperienceUpgradesPageViewController: OWSViewController, UIPageViewControl
view.addSubview(headerBackgroundView) view.addSubview(headerBackgroundView)
headerBackgroundView.backgroundColor = UIColor.ows_materialBlue() headerBackgroundView.backgroundColor = UIColor.ows_materialBlue()
// Footer Background
let footerBackgroundView = UIView()
view.addSubview(footerBackgroundView)
footerBackgroundView.backgroundColor = UIColor.ows_materialBlue()
// Dismiss button // Dismiss button
let dismissButton = UIButton() let dismissButton = UIButton()
view.addSubview(dismissButton) view.addSubview(dismissButton)
dismissButton.setTitle(CommonStrings.dismissButton, for: .normal) dismissButton.setTitle(CommonStrings.dismissButton, for: .normal)
dismissButton.setTitleColor(UIColor.white, for: .normal) dismissButton.setTitleColor(UIColor.ows_signalBrandBlue(), for: .normal)
dismissButton.isUserInteractionEnabled = true dismissButton.isUserInteractionEnabled = true
dismissButton.addTarget(self, action:#selector(didTapDismissButton), for: .touchUpInside) dismissButton.addTarget(self, action:#selector(didTapDismissButton), for: .touchUpInside)
dismissButton.titleLabel?.font = UIFont.ows_mediumFont(withSize: ScaleFromIPhone5(20)) dismissButton.titleLabel?.font = UIFont.ows_mediumFont(withSize: ScaleFromIPhone5(16))
let dismissInsetValue: CGFloat = ScaleFromIPhone5(10) let dismissInsetValue: CGFloat = ScaleFromIPhone5(10)
dismissButton.contentEdgeInsets = UIEdgeInsets(top: dismissInsetValue, left: dismissInsetValue, bottom: dismissInsetValue, right: dismissInsetValue) dismissButton.contentEdgeInsets = UIEdgeInsets(top: dismissInsetValue, left: dismissInsetValue, bottom: dismissInsetValue, right: dismissInsetValue)
@ -255,11 +253,6 @@ class ExperienceUpgradesPageViewController: OWSViewController, UIPageViewControl
headerBackgroundView.autoPinEdge(toSuperviewEdge: .top) headerBackgroundView.autoPinEdge(toSuperviewEdge: .top)
headerBackgroundView.autoSetDimension(.height, toSize: ScaleFromIPhone5(80)) headerBackgroundView.autoSetDimension(.height, toSize: ScaleFromIPhone5(80))
// Footer Background layout
footerBackgroundView.autoPinWidthToSuperview()
footerBackgroundView.autoPinEdge(toSuperviewEdge: .bottom)
footerBackgroundView.autoSetDimension(.height, toSize: ScaleFromIPhone5(95))
// Dismiss button layout // Dismiss button layout
dismissButton.autoHCenterInSuperview() dismissButton.autoHCenterInSuperview()
dismissButton.autoPinEdge(toSuperviewEdge: .bottom, withInset: ScaleFromIPhone5(10)) dismissButton.autoPinEdge(toSuperviewEdge: .bottom, withInset: ScaleFromIPhone5(10))
@ -269,7 +262,7 @@ class ExperienceUpgradesPageViewController: OWSViewController, UIPageViewControl
// negative inset so as to overlay the header text in the carousel view with the header background which // negative inset so as to overlay the header text in the carousel view with the header background which
// lives outside of the carousel. We do this so that the user can't bounce past the page view controllers // lives outside of the carousel. We do this so that the user can't bounce past the page view controllers
// width limits, exposing the edge of the header. // width limits, exposing the edge of the header.
carouselView.autoPin(toTopLayoutGuideOf: self, withInset: 16) carouselView.autoPin(toTopLayoutGuideOf: self, withInset: ScaleFromIPhone5To7Plus(14, 24))
carouselView.autoPinEdge(.bottom, to: .top, of: dismissButton, withOffset: ScaleFromIPhone5(-10)) carouselView.autoPinEdge(.bottom, to: .top, of: dismissButton, withOffset: ScaleFromIPhone5(-10))
} }

@ -1517,7 +1517,7 @@
"UPGRADE_EXPERIENCE_CALLKIT_TITLE" = "Just Swipe to Answer"; "UPGRADE_EXPERIENCE_CALLKIT_TITLE" = "Just Swipe to Answer";
/* button label shown one time, after user upgrades app */ /* button label shown one time, after user upgrades app */
"UPGRADE_EXPERIENCE_INTRODUCING_PROFILES_BUTTON" = "Set up your profile now."; "UPGRADE_EXPERIENCE_INTRODUCING_PROFILES_BUTTON" = "Set up Your Profile";
/* Description of new profile feature for upgrading (existing) users */ /* Description of new profile feature for upgrading (existing) users */
"UPGRADE_EXPERIENCE_INTRODUCING_PROFILES_DESCRIPTION" = "You can now share a photo and name with your friends on Signal."; "UPGRADE_EXPERIENCE_INTRODUCING_PROFILES_DESCRIPTION" = "You can now share a photo and name with your friends on Signal.";

Loading…
Cancel
Save