Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

redesign/onboarding #541

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
decanus committed May 28, 2021
commit 43e31e97317ba527ac9fbed78c39fa371586050e
Original file line number Diff line number Diff line change
@@ -1,9 +1,58 @@
import UIKit

class PermissionButton: UIButton {
let emoji: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.font = .rounded(forTextStyle: .title1, weight: .semibold)
return label
}()

let title: UILabel = {
let label = UILabel()
label.textColor = .white
label.font = .rounded(forTextStyle: .headline, weight: .semibold)
return label
}()

let descriptionLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.font = .rounded(forTextStyle: .subheadline, weight: .regular)
label.numberOfLines = 0
return label
}()

init() {
super.init(frame: .zero)
translatesAutoresizingMaskIntoConstraints = false

addSubview(emoji)

let stack = UIStackView()
stack.translatesAutoresizingMaskIntoConstraints = false
stack.spacing = 0
stack.distribution = .fill
stack.alignment = .fill
stack.axis = .vertical
addSubview(stack)

stack.addArrangedSubview(title)
stack.addArrangedSubview(descriptionLabel)

addSubview(stack)

NSLayoutConstraint.activate([
emoji.leftAnchor.constraint(equalTo: leftAnchor),
emoji.centerYAnchor.constraint(equalTo: stack.centerYAnchor),
])

NSLayoutConstraint.activate([
stack.topAnchor.constraint(equalTo: topAnchor),
stack.bottomAnchor.constraint(equalTo: bottomAnchor),
stack.leftAnchor.constraint(equalTo: emoji.rightAnchor, constant: 20),
stack.rightAnchor.constraint(equalTo: rightAnchor, constant: -20),
])
}

required init?(coder _: NSCoder) {
@@ -28,6 +77,18 @@ class AuthenticationPermissionsViewController: UIViewController, AuthenticationS
super.init(nibName: nil, bundle: nil)

title = NSLocalizedString("Authentication.Permissions", comment: "")

let button = PermissionButton()
button.title.text = "Microphone"
button.emoji.text = "🎙"
button.descriptionLabel.text = "So your friends can hear your beautiful voice."
view.addSubview(button)

NSLayoutConstraint.activate([
button.centerYAnchor.constraint(equalTo: view.centerYAnchor),
button.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 20),
button.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -20),
])
}

required init?(coder _: NSCoder) {