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