Merge pull request #88 from loki-project/copy

Fix Copy
This commit is contained in:
gmbnt 2020-02-07 13:02:49 +11:00 committed by GitHub
commit 0050d1b036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -176,7 +176,7 @@ private final class EnterChatURLVC : UIViewController {
// MARK: Components
private lazy var chatURLTextField: TextField = {
let result = TextField(placeholder: "https://chat.getsession.org")
let result = TextField(placeholder: "Enter an open group URL")
result.keyboardType = .URL
result.autocapitalizationType = .none
return result
@ -186,22 +186,14 @@ private final class EnterChatURLVC : UIViewController {
override func viewDidLoad() {
// Remove background color
view.backgroundColor = .clear
// Set up top explanation label
let topExplanationLabel = UILabel()
topExplanationLabel.textColor = Colors.text.withAlphaComponent(Values.unimportantElementOpacity)
topExplanationLabel.font = .systemFont(ofSize: Values.smallFontSize)
topExplanationLabel.text = NSLocalizedString("Enter an open group URL", comment: "")
topExplanationLabel.numberOfLines = 0
topExplanationLabel.textAlignment = .center
topExplanationLabel.lineBreakMode = .byWordWrapping
// Set up bottom explanation label
let bottomExplanationLabel = UILabel()
bottomExplanationLabel.textColor = Colors.text.withAlphaComponent(Values.unimportantElementOpacity)
bottomExplanationLabel.font = .systemFont(ofSize: Values.verySmallFontSize)
bottomExplanationLabel.text = NSLocalizedString("Open groups can be joined by anyone and do not provide full metadata protection", comment: "")
bottomExplanationLabel.numberOfLines = 0
bottomExplanationLabel.textAlignment = .center
bottomExplanationLabel.lineBreakMode = .byWordWrapping
// Set up explanation label
let explanationLabel = UILabel()
explanationLabel.textColor = Colors.text.withAlphaComponent(Values.unimportantElementOpacity)
explanationLabel.font = .systemFont(ofSize: Values.verySmallFontSize)
explanationLabel.text = NSLocalizedString("Open groups can be joined by anyone and do not provide full metadata protection", comment: "")
explanationLabel.numberOfLines = 0
explanationLabel.textAlignment = .center
explanationLabel.lineBreakMode = .byWordWrapping
// Next button
let nextButton = Button(style: .prominentOutline, size: .large)
nextButton.setTitle(NSLocalizedString("Next", comment: ""), for: UIControl.State.normal)
@ -213,7 +205,7 @@ private final class EnterChatURLVC : UIViewController {
nextButtonContainer.pin(.trailing, to: .trailing, of: nextButton, withInset: 80)
nextButtonContainer.pin(.bottom, to: .bottom, of: nextButton)
// Set up stack view
let stackView = UIStackView(arrangedSubviews: [ chatURLTextField, UIView.spacer(withHeight: Values.smallSpacing), topExplanationLabel, UIView.vStretchingSpacer(), nextButtonContainer, UIView.spacer(withHeight: Values.smallSpacing), bottomExplanationLabel ])
let stackView = UIStackView(arrangedSubviews: [ chatURLTextField, UIView.vStretchingSpacer(), nextButtonContainer, UIView.spacer(withHeight: Values.smallSpacing), explanationLabel ])
stackView.axis = .vertical
stackView.alignment = .fill
let bottomSpacing = isSmallScreen ? Values.smallSpacing : Values.largeSpacing