mirror of https://github.com/oxen-io/session-ios
add call missed tips
parent
912f8d80a6
commit
9e4e126ef3
@ -0,0 +1,57 @@
|
|||||||
|
import UIKit
|
||||||
|
|
||||||
|
@objc
|
||||||
|
final class CallMissedTipsModal : Modal {
|
||||||
|
private let caller: String
|
||||||
|
|
||||||
|
// MARK: Lifecycle
|
||||||
|
@objc
|
||||||
|
init(caller: String) {
|
||||||
|
self.caller = caller
|
||||||
|
super.init(nibName: nil, bundle: nil)
|
||||||
|
self.modalPresentationStyle = .overFullScreen
|
||||||
|
self.modalTransitionStyle = .crossDissolve
|
||||||
|
}
|
||||||
|
|
||||||
|
required init?(coder: NSCoder) {
|
||||||
|
preconditionFailure("Use init(onCallEnabled:) instead.")
|
||||||
|
}
|
||||||
|
|
||||||
|
override init(nibName: String?, bundle: Bundle?) {
|
||||||
|
preconditionFailure("Use init(onCallEnabled:) instead.")
|
||||||
|
}
|
||||||
|
|
||||||
|
override func populateContentView() {
|
||||||
|
// Tips icon
|
||||||
|
let tipsIconImageView = UIImageView(image: UIImage(named: "Tips")?.withTint(Colors.text))
|
||||||
|
tipsIconImageView.set(.width, to: 19)
|
||||||
|
tipsIconImageView.set(.height, to: 28)
|
||||||
|
// Title
|
||||||
|
let titleLabel = UILabel()
|
||||||
|
titleLabel.textColor = Colors.text
|
||||||
|
titleLabel.font = .boldSystemFont(ofSize: Values.largeFontSize)
|
||||||
|
titleLabel.text = NSLocalizedString("modal_call_missed_tips_title", comment: "")
|
||||||
|
titleLabel.textAlignment = .center
|
||||||
|
// Message
|
||||||
|
let messageLabel = UILabel()
|
||||||
|
messageLabel.textColor = Colors.text
|
||||||
|
messageLabel.font = .systemFont(ofSize: Values.smallFontSize)
|
||||||
|
let message = String(format: NSLocalizedString("modal_call_missed_tips_explanation", comment: ""), caller)
|
||||||
|
messageLabel.text = message
|
||||||
|
messageLabel.numberOfLines = 0
|
||||||
|
messageLabel.lineBreakMode = .byWordWrapping
|
||||||
|
messageLabel.textAlignment = .natural
|
||||||
|
// Cancel Button
|
||||||
|
cancelButton.setTitle(NSLocalizedString("OK", comment: ""), for: .normal)
|
||||||
|
// Main stack view
|
||||||
|
let mainStackView = UIStackView(arrangedSubviews: [ tipsIconImageView, titleLabel, messageLabel, cancelButton ])
|
||||||
|
mainStackView.axis = .vertical
|
||||||
|
mainStackView.alignment = .center
|
||||||
|
mainStackView.spacing = Values.largeSpacing
|
||||||
|
contentView.addSubview(mainStackView)
|
||||||
|
mainStackView.pin(.leading, to: .leading, of: contentView, withInset: Values.largeSpacing)
|
||||||
|
mainStackView.pin(.top, to: .top, of: contentView, withInset: Values.largeSpacing)
|
||||||
|
contentView.pin(.trailing, to: .trailing, of: mainStackView, withInset: Values.largeSpacing)
|
||||||
|
contentView.pin(.bottom, to: .bottom, of: mainStackView, withInset: Values.largeSpacing)
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "Tips.pdf",
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue