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) { set (newFeedback) {
feedbackLabel.text = newFeedback feedbackLabel.text = newFeedback
feedbackLabel.accessibilityElementsHidden = feedbackLabel.text?.isEmpty ?? true feedbackLabel.accessibilityElementsHidden = feedbackLabel.text?.isEmpty ?? true
entryFieldContainer.refreshUI() entryFieldContainer.refreshUI(moleculeLayoutUpdated: true)
// delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
} }
} }

View File

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