fix title view position

pull/560/head
Ryan Zhao 4 years ago
parent 57f0595dc3
commit 32790a9d99

@ -309,7 +309,8 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
settingsButton.accessibilityLabel = "Settings button"
settingsButton.isAccessibilityElement = true
rightBarButtonItems.append(settingsButton)
if !thread.isNoteToSelf() && (SSKPreferences.areCallsEnabled || !UserDefaults.standard[.hasSeenCallIPExposureWarning]) {
let shouldShowCallButton = !thread.isNoteToSelf() && (SSKPreferences.areCallsEnabled || !UserDefaults.standard[.hasSeenCallIPExposureWarning])
if shouldShowCallButton {
let callButton = UIBarButtonItem(image: UIImage(named: "Phone")!, style: .plain, target: self, action: #selector(startCall))
rightBarButtonItems.append(callButton)
}

@ -44,7 +44,8 @@ final class ConversationTitleView : UIView {
stackView.axis = .vertical
stackView.alignment = .center
stackView.isLayoutMarginsRelativeArrangement = true
let leftMargin: CGFloat = (thread is TSContactThread) ? 54 : 8 // Contact threads also have the call button to compensate for
let shouldShowCallButton = !thread.isNoteToSelf() && (SSKPreferences.areCallsEnabled || !UserDefaults.standard[.hasSeenCallIPExposureWarning])
let leftMargin: CGFloat = shouldShowCallButton ? 54 : 8 // Contact threads also have the call button to compensate for
stackView.layoutMargins = UIEdgeInsets(top: 0, left: leftMargin, bottom: 0, right: 0)
addSubview(stackView)
stackView.pin(to: self)

Loading…
Cancel
Save