Clean up message detail screen

pull/77/head
Niels Andriesse 5 years ago
parent ae6015f5bf
commit ec3c619ff3

@ -56,9 +56,25 @@ public class LongTextViewController: OWSViewController {
public override func viewDidLoad() { public override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.navigationItem.title = NSLocalizedString("LONG_TEXT_VIEW_TITLE", // Loki: Set gradient background
comment: "Title for the 'long text message' view.") view.backgroundColor = .clear
let gradient = Gradients.defaultLokiBackground
view.setGradient(gradient)
// Loki: Set navigation bar background color
let navigationBar = navigationController!.navigationBar
navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
navigationBar.shadowImage = UIImage()
navigationBar.isTranslucent = false
navigationBar.barTintColor = Colors.navigationBarBackground
// Loki: Customize title
let titleLabel = UILabel()
titleLabel.text = NSLocalizedString("LONG_TEXT_VIEW_TITLE", comment: "")
titleLabel.textColor = Colors.text
titleLabel.font = .boldSystemFont(ofSize: Values.veryLargeFontSize)
navigationItem.titleView = titleLabel
createViews() createViews()
self.messageTextView.contentOffset = CGPoint(x: 0, y: self.messageTextView.contentInset.top) self.messageTextView.contentOffset = CGPoint(x: 0, y: self.messageTextView.contentInset.top)
@ -119,8 +135,8 @@ public class LongTextViewController: OWSViewController {
let messageTextView = OWSTextView() let messageTextView = OWSTextView()
self.messageTextView = messageTextView self.messageTextView = messageTextView
messageTextView.font = UIFont.ows_dynamicTypeBody messageTextView.font = .systemFont(ofSize: Values.mediumFontSize)
messageTextView.backgroundColor = Theme.backgroundColor messageTextView.backgroundColor = .clear
messageTextView.isOpaque = true messageTextView.isOpaque = true
messageTextView.isEditable = false messageTextView.isEditable = false
messageTextView.isSelectable = true messageTextView.isSelectable = true
@ -128,7 +144,8 @@ public class LongTextViewController: OWSViewController {
messageTextView.showsHorizontalScrollIndicator = false messageTextView.showsHorizontalScrollIndicator = false
messageTextView.showsVerticalScrollIndicator = true messageTextView.showsVerticalScrollIndicator = true
messageTextView.isUserInteractionEnabled = true messageTextView.isUserInteractionEnabled = true
messageTextView.textColor = Theme.primaryColor messageTextView.textColor = Colors.text
messageTextView.contentInset = UIEdgeInsets(top: Values.mediumSpacing, leading: 0, bottom: 0, trailing: 0)
if let displayableText = displayableText { if let displayableText = displayableText {
messageTextView.text = fullText messageTextView.text = fullText
messageTextView.ensureShouldLinkifyText(displayableText.shouldAllowLinkification) messageTextView.ensureShouldLinkifyText(displayableText.shouldAllowLinkification)
@ -138,8 +155,8 @@ public class LongTextViewController: OWSViewController {
} }
let linkTextAttributes: [NSAttributedString.Key: Any] = [ let linkTextAttributes: [NSAttributedString.Key: Any] = [
NSAttributedString.Key.foregroundColor: Theme.primaryColor, NSAttributedString.Key.foregroundColor: Colors.text,
NSAttributedString.Key.underlineColor: Theme.primaryColor, NSAttributedString.Key.underlineColor: Colors.text,
NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single.rawValue NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single.rawValue
] ]
messageTextView.linkTextAttributes = linkTextAttributes messageTextView.linkTextAttributes = linkTextAttributes

Loading…
Cancel
Save