Make thread header stacked, fix #5358

This commit is contained in:
ismailgulek
2022-01-11 15:24:46 +03:00
parent ca8d9b4b50
commit 95b5f449b5
2 changed files with 64 additions and 52 deletions
@@ -25,11 +25,6 @@ enum ThreadRoomTitleViewMode {
@objcMembers
class ThreadRoomTitleView: RoomTitleView {
private enum Constants {
static let titleLeadingConstraintOnPortrait: CGFloat = 6
static let titleLeadingConstraintOnLandscape: CGFloat = 18
}
var mode: ThreadRoomTitleViewMode = .allThreads {
didSet {
update()
@@ -37,7 +32,6 @@ class ThreadRoomTitleView: RoomTitleView {
}
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var titleLabelLeadingConstraint: NSLayoutConstraint!
@IBOutlet private weak var roomAvatarView: RoomAvatarView!
@IBOutlet private weak var roomEncryptionBadgeView: UIImageView!
@IBOutlet private weak var roomNameLabel: UILabel!
@@ -100,16 +94,6 @@ class ThreadRoomTitleView: RoomTitleView {
registerThemeServiceDidChangeThemeNotification()
}
override func updateLayout(for orientation: UIInterfaceOrientation) {
super.updateLayout(for: orientation)
if orientation.isPortrait {
titleLabelLeadingConstraint.constant = Constants.titleLeadingConstraintOnPortrait
} else {
titleLabelLeadingConstraint.constant = Constants.titleLeadingConstraintOnLandscape
}
}
// MARK: - Private
private func registerThemeServiceDidChangeThemeNotification() {