Clean up onboarding

This commit is contained in:
Niels Andriesse 2021-04-29 16:30:39 +10:00
parent a9dcf93474
commit 06e4672a12
2 changed files with 6 additions and 12 deletions

View File

@ -12,14 +12,14 @@ final class PNModeVC : BaseVC, OptionViewDelegate {
// MARK: Components
private lazy var apnsOptionView: OptionView = {
let explanation = "Youll be notified of new messages reliably and immediately using Apples notification servers. The contents of your messages, and who youre messaging, are never exposed to Apple."
let explanation = "Youll be notified of new messages reliably and immediately using Apples notification servers."
let result = OptionView(title: "Fast Mode", explanation: explanation, delegate: self, isRecommended: true)
result.accessibilityLabel = "Fast mode option"
return result
}()
private lazy var backgroundPollingOptionView: OptionView = {
let explanation = "Session will occasionally check for new messages in the background. Full metadata protection is guaranteed, but message notifications will be unreliable."
let explanation = "Session will occasionally check for new messages in the background."
let result = OptionView(title: "Slow Mode", explanation: explanation, delegate: self)
result.accessibilityLabel = "Slow mode option"
return result
@ -41,13 +41,6 @@ final class PNModeVC : BaseVC, OptionViewDelegate {
titleLabel.text = "Message Notifications"
titleLabel.numberOfLines = 0
titleLabel.lineBreakMode = .byWordWrapping
// Set up explanation label
let explanationLabel = UILabel()
explanationLabel.textColor = Colors.text
explanationLabel.font = .systemFont(ofSize: Values.smallFontSize)
explanationLabel.text = "There are two ways Session can notify you of new messages."
explanationLabel.numberOfLines = 0
explanationLabel.lineBreakMode = .byWordWrapping
// Set up spacers
let topSpacer = UIView.vStretchingSpacer()
let bottomSpacer = UIView.vStretchingSpacer()
@ -66,8 +59,7 @@ final class PNModeVC : BaseVC, OptionViewDelegate {
optionsStackView.spacing = Values.smallSpacing
optionsStackView.alignment = .fill
// Set up top stack view
let topStackView = UIStackView(arrangedSubviews: [ titleLabel, UIView.spacer(withHeight: isIPhone6OrSmaller ? Values.mediumSpacing : Values.veryLargeSpacing),
explanationLabel, UIView.spacer(withHeight: isIPhone6OrSmaller ? Values.mediumSpacing : Values.veryLargeSpacing), optionsStackView ])
let topStackView = UIStackView(arrangedSubviews: [ titleLabel, UIView.spacer(withHeight: isIPhone6OrSmaller ? Values.mediumSpacing : Values.veryLargeSpacing), optionsStackView ])
topStackView.axis = .vertical
topStackView.alignment = .fill
// Set up top stack view container
@ -79,6 +71,8 @@ final class PNModeVC : BaseVC, OptionViewDelegate {
view.addSubview(mainStackView)
mainStackView.pin(to: view)
topSpacer.heightAnchor.constraint(equalTo: bottomSpacer.heightAnchor, multiplier: 1).isActive = true
// Preselect APNs mode
optionViews[0].isSelected = true
}
// MARK: Interaction

View File

@ -54,7 +54,7 @@
}
target:weakSelf
selector:@selector(didToggleAPNsSwitch:)]];
strategySection.footerTitle = @"Youll be notified of new messages reliably and immediately using Apples notification servers. The contents of your messages, and who youre messaging, are never exposed to Apple.";
strategySection.footerTitle = @"Youll be notified of new messages reliably and immediately using Apples notification servers.";
[contents addSection:strategySection];
// Sounds section.