From d2d4e3d42c930e922d7cd2ce37490f4f21b2af90 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Tue, 29 Oct 2019 13:40:25 -0400 Subject: [PATCH] hold for now. --- .../Atoms/TextFields/FormEntryField.swift | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/MVMCoreUI/Atoms/TextFields/FormEntryField.swift b/MVMCoreUI/Atoms/TextFields/FormEntryField.swift index 67cf3d62..a16cafc5 100644 --- a/MVMCoreUI/Atoms/TextFields/FormEntryField.swift +++ b/MVMCoreUI/Atoms/TextFields/FormEntryField.swift @@ -308,9 +308,7 @@ import UIKit bottomBar.backgroundColor = UIColor.black.cgColor descriptionLabel?.textColor = .mfBattleshipGrey() - resizeBottomBar(size: 1) - - refreshUI() + refreshUI(bottomBarSize: 1) } open func errorAppearance(showError: Bool = false) { @@ -326,9 +324,7 @@ import UIKit feedback = errorMessage } - resizeBottomBar(size: 4) - - refreshUI() + refreshUI(bottomBarSize: 4) } open func lockAppearance() { @@ -338,9 +334,7 @@ import UIKit hideBorder = true bottomBar.backgroundColor = UIColor.clear.cgColor - resizeBottomBar(size: 1) - - refreshUI() + refreshUI(bottomBarSize: 1) } open func selectedAppearance() { @@ -351,9 +345,7 @@ import UIKit borderStrokeColor = .black bottomBar.backgroundColor = UIColor.black.cgColor - resizeBottomBar(size: 1) - - refreshUI() + refreshUI(bottomBarSize: 1) } open func disabledAppearance() { @@ -365,12 +357,14 @@ import UIKit descriptionLabel?.textColor = self.isEnabled ? UIColor.mfBattleshipGrey() : UIColor.mfSilver() bottomBar.backgroundColor = self.isEnabled ? (self.showErrorMessage ? UIColor.mfPumpkin().cgColor : UIColor.black.cgColor) : UIColor.mfSilver().cgColor - resizeBottomBar(size: 1) - - refreshUI() + refreshUI(bottomBarSize: 1) } - open func refreshUI() { + open func refreshUI(bottomBarSize: CGFloat? = nil) { + + if let size = bottomBarSize, let fieldBounds = fieldContainer?.bounds { + bottomBar.frame = CGRect(x: 0, y: fieldBounds.height - size, width: fieldBounds.width, height: size) + } self.delegateObject?.moleculeDelegate?.moleculeLayoutUpdated?(self) setNeedsDisplay()