From f9e5b50ccc78dcf1df1057cd0262d8b75fff01b8 Mon Sep 17 00:00:00 2001 From: David <62899351+davidclaveau@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:04:01 -0800 Subject: [PATCH] add button to add other waterbody in waterpicker --- .../Waterbody picker/WaterbodyPicker.swift | 12 ++++- .../Waterbody picker/WaterbodyPicker.xib | 47 ++++++++++++++----- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/ipad/Views/Waterbody picker/WaterbodyPicker.swift b/ipad/Views/Waterbody picker/WaterbodyPicker.swift index 7da52ecd..52952217 100644 --- a/ipad/Views/Waterbody picker/WaterbodyPicker.swift +++ b/ipad/Views/Waterbody picker/WaterbodyPicker.swift @@ -50,6 +50,8 @@ class WaterbodyPicker: UIView, Theme { @IBOutlet weak var addManuallyButton: UIButton! @IBOutlet weak var selectionsHeightConstraint: NSLayoutConstraint! @IBOutlet weak var manualLocationField: UITextField! + @IBOutlet weak var footerContainer: UIView! + @IBOutlet weak var otherWaterbodies: UIButton! // MARK: Constants private let tableCells = [ @@ -83,6 +85,10 @@ class WaterbodyPicker: UIView, Theme { dismissWithAnimation() } + @IBAction func otherWaterbodyAction(_ sender: UIButton) { + self.showOtherDialog() + } + private func dismissWithAnimation() { UIView.animate(withDuration: 0.3, animations: { self.alpha = 0 @@ -106,7 +112,7 @@ class WaterbodyPicker: UIView, Theme { } /** - Displays Wateroicker in Container and returns DropdownModel Result + Displays Waterpicker in Container and returns DropdownModel Result */ func setup(result: @escaping([WaterBodyTableModel]) -> Void) { self.completion = result @@ -220,7 +226,7 @@ class WaterbodyPicker: UIView, Theme { } } - // Filter Reaults + // Filter Results private func filter(by text: String) { self.otherContainer.alpha = 0 self.filteredItems = items.filter{$0.display.lowercased().contains(text.lowercased())}.sorted(by: { (first, second) -> Bool in @@ -290,6 +296,8 @@ class WaterbodyPicker: UIView, Theme { self.selectButton.setTitleColor(.white, for: .normal) self.searchBar.barTintColor = Colors.primary self.titleLabel.textColor = UIColor.white + self.footerContainer.backgroundColor = Colors.primary + self.otherWaterbodies.setTitleColor(.white, for: .normal) searchBar.setPlaceholderTextColorTo(color: .white) searchBar.setMagnifyingGlassColorTo(color: .white) let attributes = [ diff --git a/ipad/Views/Waterbody picker/WaterbodyPicker.xib b/ipad/Views/Waterbody picker/WaterbodyPicker.xib index b7683c26..dd5ee1fb 100644 --- a/ipad/Views/Waterbody picker/WaterbodyPicker.xib +++ b/ipad/Views/Waterbody picker/WaterbodyPicker.xib @@ -16,16 +16,16 @@ - + + + + + + + + + + + + + @@ -169,7 +192,7 @@ Be sure to include the Lake Name, State/Province, Country and City. - + @@ -177,8 +200,10 @@ Be sure to include the Lake Name, State/Province, Country and City. + +