|
|
@ -106,18 +106,18 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
lazy var messagesTableView: MessagesTableView = {
|
|
|
|
lazy var messagesTableView: MessagesTableView = {
|
|
|
|
let tableView: MessagesTableView = MessagesTableView()
|
|
|
|
let result: MessagesTableView = MessagesTableView()
|
|
|
|
tableView.dataSource = self
|
|
|
|
result.dataSource = self
|
|
|
|
tableView.delegate = self
|
|
|
|
result.delegate = self
|
|
|
|
tableView.contentInsetAdjustmentBehavior = .never
|
|
|
|
result.contentInsetAdjustmentBehavior = .never
|
|
|
|
tableView.contentInset = UIEdgeInsets(
|
|
|
|
result.contentInset = UIEdgeInsets(
|
|
|
|
top: 0,
|
|
|
|
top: 0,
|
|
|
|
leading: 0,
|
|
|
|
leading: 0,
|
|
|
|
bottom: Values.mediumSpacing,
|
|
|
|
bottom: Values.mediumSpacing,
|
|
|
|
trailing: 0
|
|
|
|
trailing: 0
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
return tableView
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
lazy var snInputView = InputView(delegate: self)
|
|
|
|
lazy var snInputView = InputView(delegate: self)
|
|
|
@ -158,56 +158,56 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
lazy var footerControlsStackView: UIStackView = {
|
|
|
|
lazy var footerControlsStackView: UIStackView = {
|
|
|
|
let stackView: UIStackView = UIStackView()
|
|
|
|
let result: UIStackView = UIStackView()
|
|
|
|
stackView.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
result.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
stackView.axis = .vertical
|
|
|
|
result.axis = .vertical
|
|
|
|
stackView.alignment = .trailing
|
|
|
|
result.alignment = .trailing
|
|
|
|
stackView.distribution = .equalSpacing
|
|
|
|
result.distribution = .equalSpacing
|
|
|
|
stackView.spacing = 10
|
|
|
|
result.spacing = 10
|
|
|
|
stackView.layoutMargins = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
|
|
|
|
result.layoutMargins = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
|
|
|
|
stackView.isLayoutMarginsRelativeArrangement = true
|
|
|
|
result.isLayoutMarginsRelativeArrangement = true
|
|
|
|
|
|
|
|
|
|
|
|
return stackView
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
lazy var scrollButton = ScrollToBottomButton(delegate: self)
|
|
|
|
lazy var scrollButton = ScrollToBottomButton(delegate: self)
|
|
|
|
|
|
|
|
|
|
|
|
lazy var messageRequestView: UIView = {
|
|
|
|
lazy var messageRequestView: UIView = {
|
|
|
|
let view: UIView = UIView()
|
|
|
|
let result: UIView = UIView()
|
|
|
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
result.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
view.isHidden = !thread.isMessageRequest()
|
|
|
|
result.isHidden = !thread.isMessageRequest()
|
|
|
|
view.setGradient(Gradients.defaultBackground)
|
|
|
|
result.setGradient(Gradients.defaultBackground)
|
|
|
|
|
|
|
|
|
|
|
|
return view
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
private let messageRequestDescriptionLabel: UILabel = {
|
|
|
|
private let messageRequestDescriptionLabel: UILabel = {
|
|
|
|
let label: UILabel = UILabel()
|
|
|
|
let result: UILabel = UILabel()
|
|
|
|
label.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
result.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
label.font = UIFont.systemFont(ofSize: 12)
|
|
|
|
result.font = UIFont.systemFont(ofSize: 12)
|
|
|
|
label.text = NSLocalizedString("MESSAGE_REQUESTS_INFO", comment: "")
|
|
|
|
result.text = NSLocalizedString("MESSAGE_REQUESTS_INFO", comment: "")
|
|
|
|
label.textColor = Colors.sessionMessageRequestsInfoText
|
|
|
|
result.textColor = Colors.sessionMessageRequestsInfoText
|
|
|
|
label.textAlignment = .center
|
|
|
|
result.textAlignment = .center
|
|
|
|
label.numberOfLines = 2
|
|
|
|
result.numberOfLines = 2
|
|
|
|
|
|
|
|
|
|
|
|
return label
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
private let messageRequestAcceptButton: UIButton = {
|
|
|
|
private let messageRequestAcceptButton: UIButton = {
|
|
|
|
let button: UIButton = UIButton()
|
|
|
|
let result: UIButton = UIButton()
|
|
|
|
button.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
result.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
button.clipsToBounds = true
|
|
|
|
result.clipsToBounds = true
|
|
|
|
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
|
|
|
|
result.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
|
|
|
|
button.setTitle(NSLocalizedString("TXT_DELETE_ACCEPT", comment: ""), for: .normal)
|
|
|
|
result.setTitle(NSLocalizedString("TXT_DELETE_ACCEPT", comment: ""), for: .normal)
|
|
|
|
button.setTitleColor(Colors.sessionHeading, for: .normal)
|
|
|
|
result.setTitleColor(Colors.sessionHeading, for: .normal)
|
|
|
|
button.setBackgroundImage(
|
|
|
|
result.setBackgroundImage(
|
|
|
|
Colors.sessionHeading
|
|
|
|
Colors.sessionHeading
|
|
|
|
.withAlphaComponent(isDarkMode ? 0.2 : 0.06)
|
|
|
|
.withAlphaComponent(isDarkMode ? 0.2 : 0.06)
|
|
|
|
.toImage(isDarkMode: isDarkMode),
|
|
|
|
.toImage(isDarkMode: isDarkMode),
|
|
|
|
for: .highlighted
|
|
|
|
for: .highlighted
|
|
|
|
)
|
|
|
|
)
|
|
|
|
button.layer.cornerRadius = (ConversationVC.messageRequestButtonHeight / 2)
|
|
|
|
result.layer.cornerRadius = (ConversationVC.messageRequestButtonHeight / 2)
|
|
|
|
button.layer.borderColor = {
|
|
|
|
result.layer.borderColor = {
|
|
|
|
if #available(iOS 13.0, *) {
|
|
|
|
if #available(iOS 13.0, *) {
|
|
|
|
return Colors.sessionHeading
|
|
|
|
return Colors.sessionHeading
|
|
|
|
.resolvedColor(
|
|
|
|
.resolvedColor(
|
|
|
@ -218,27 +218,27 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
|
|
|
|
|
|
|
|
|
|
|
return Colors.sessionHeading.cgColor
|
|
|
|
return Colors.sessionHeading.cgColor
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
button.layer.borderWidth = 1
|
|
|
|
result.layer.borderWidth = 1
|
|
|
|
button.addTarget(self, action: #selector(acceptMessageRequest), for: .touchUpInside)
|
|
|
|
result.addTarget(self, action: #selector(acceptMessageRequest), for: .touchUpInside)
|
|
|
|
|
|
|
|
|
|
|
|
return button
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
private let messageRequestDeleteButton: UIButton = {
|
|
|
|
private let messageRequestDeleteButton: UIButton = {
|
|
|
|
let button: UIButton = UIButton()
|
|
|
|
let result: UIButton = UIButton()
|
|
|
|
button.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
result.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
button.clipsToBounds = true
|
|
|
|
result.clipsToBounds = true
|
|
|
|
button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
|
|
|
|
result.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
|
|
|
|
button.setTitle(NSLocalizedString("TXT_DELETE_TITLE", comment: ""), for: .normal)
|
|
|
|
result.setTitle(NSLocalizedString("TXT_DELETE_TITLE", comment: ""), for: .normal)
|
|
|
|
button.setTitleColor(Colors.destructive, for: .normal)
|
|
|
|
result.setTitleColor(Colors.destructive, for: .normal)
|
|
|
|
button.setBackgroundImage(
|
|
|
|
result.setBackgroundImage(
|
|
|
|
Colors.destructive
|
|
|
|
Colors.destructive
|
|
|
|
.withAlphaComponent(isDarkMode ? 0.2 : 0.06)
|
|
|
|
.withAlphaComponent(isDarkMode ? 0.2 : 0.06)
|
|
|
|
.toImage(isDarkMode: isDarkMode),
|
|
|
|
.toImage(isDarkMode: isDarkMode),
|
|
|
|
for: .highlighted
|
|
|
|
for: .highlighted
|
|
|
|
)
|
|
|
|
)
|
|
|
|
button.layer.cornerRadius = (ConversationVC.messageRequestButtonHeight / 2)
|
|
|
|
result.layer.cornerRadius = (ConversationVC.messageRequestButtonHeight / 2)
|
|
|
|
button.layer.borderColor = {
|
|
|
|
result.layer.borderColor = {
|
|
|
|
if #available(iOS 13.0, *) {
|
|
|
|
if #available(iOS 13.0, *) {
|
|
|
|
return Colors.destructive
|
|
|
|
return Colors.destructive
|
|
|
|
.resolvedColor(
|
|
|
|
.resolvedColor(
|
|
|
@ -249,10 +249,10 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
|
|
|
|
|
|
|
|
|
|
|
return Colors.destructive.cgColor
|
|
|
|
return Colors.destructive.cgColor
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
button.layer.borderWidth = 1
|
|
|
|
result.layer.borderWidth = 1
|
|
|
|
button.addTarget(self, action: #selector(deleteMessageRequest), for: .touchUpInside)
|
|
|
|
result.addTarget(self, action: #selector(deleteMessageRequest), for: .touchUpInside)
|
|
|
|
|
|
|
|
|
|
|
|
return button
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: Settings
|
|
|
|
// MARK: Settings
|
|
|
|