This commit is contained in:
Kevin G Christiano 2020-03-24 10:09:15 -04:00
parent cc05171332
commit f0870bda5d
2 changed files with 12 additions and 5 deletions

View File

@ -116,8 +116,7 @@ import UIKit
set (newFeedback) {
feedbackLabel.text = newFeedback
feedbackLabel.accessibilityElementsHidden = feedbackLabel.text?.isEmpty ?? true
entryFieldContainer.refreshUI()
// delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
entryFieldContainer.refreshUI(moleculeLayoutUpdated: true)
}
}

View File

@ -260,14 +260,22 @@ import UIKit
refreshUI(bottomBarSize: 1)
}
open func refreshUI(bottomBarSize: CGFloat? = nil) {
open func refreshUI(bottomBarSize: CGFloat? = nil, moleculeLayoutUpdated: Bool = false) {
if !disableAllBorders {
let size: CGFloat = bottomBarSize ?? (showError ? 4 : 1)
var heightChanged = false
if let bottomHeight = bottomBar?.bounds.height {
heightChanged = size != bottomHeight
}
bottomBar?.frame = CGRect(x: 0, y: bounds.height - size, width: bounds.width, height: size)
delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
setNeedsDisplay()
if moleculeLayoutUpdated || heightChanged {
delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
setNeedsDisplay()
}
layoutIfNeeded()
}
}