Added a secondary fallback for the timestamp in the context menu

pull/856/head
Morgan Pretty 2 years ago
parent 0abb09c0cf
commit 349dc03e17

@ -71,10 +71,12 @@ final class ContextMenuVC: UIViewController {
private lazy var fallbackTimestampLabel: UILabel = { private lazy var fallbackTimestampLabel: UILabel = {
let result: UILabel = UILabel() let result: UILabel = UILabel()
result.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
result.font = .systemFont(ofSize: Values.verySmallFontSize) result.font = .systemFont(ofSize: Values.verySmallFontSize)
result.text = cellViewModel.dateForUI.formattedForDisplay result.text = cellViewModel.dateForUI.formattedForDisplay
result.themeTextColor = .textPrimary result.themeTextColor = .textPrimary
result.alpha = 0 result.alpha = 0
result.numberOfLines = 2
return result return result
}() }()
@ -187,10 +189,14 @@ final class ContextMenuVC: UIViewController {
fallbackTimestampLabel.set(.height, to: ContextMenuVC.actionViewHeight) fallbackTimestampLabel.set(.height, to: ContextMenuVC.actionViewHeight)
if cellViewModel.variant == .standardOutgoing { if cellViewModel.variant == .standardOutgoing {
fallbackTimestampLabel.textAlignment = .right
fallbackTimestampLabel.pin(.right, to: .left, of: menuView, withInset: -Values.mediumSpacing) fallbackTimestampLabel.pin(.right, to: .left, of: menuView, withInset: -Values.mediumSpacing)
fallbackTimestampLabel.pin(.left, to: .left, of: view, withInset: Values.mediumSpacing)
} }
else { else {
fallbackTimestampLabel.textAlignment = .left
fallbackTimestampLabel.pin(.left, to: .right, of: menuView, withInset: Values.mediumSpacing) fallbackTimestampLabel.pin(.left, to: .right, of: menuView, withInset: Values.mediumSpacing)
fallbackTimestampLabel.pin(.right, to: .right, of: view, withInset: -Values.mediumSpacing)
} }
// Constrains // Constrains

Loading…
Cancel
Save