From 4a692d3320fb8ece0b062c581f4488de132c80b7 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 17 Dec 2020 16:48:06 +0000 Subject: [PATCH 1/2] Roster view: Remove availability filter This frees up space for a title (coming). Availability filtering does not make much sense today when so many people have mobile devices that are usually offline, but support push notifications. --- SiskinIM/roster/RosterViewController.swift | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/SiskinIM/roster/RosterViewController.swift b/SiskinIM/roster/RosterViewController.swift index e55cb27c..9d0fcb68 100644 --- a/SiskinIM/roster/RosterViewController.swift +++ b/SiskinIM/roster/RosterViewController.swift @@ -24,8 +24,6 @@ import UIKit import TigaseSwift class RosterViewController: AbstractRosterViewController, UIGestureRecognizerDelegate { - - var availabilityFilterSelector: UISegmentedControl?; override func viewDidLoad() { super.viewDidLoad() @@ -42,10 +40,6 @@ class RosterViewController: AbstractRosterViewController, UIGestureRecognizerDel } navigationItem.leftBarButtonItem = self.editButtonItem - availabilityFilterSelector = UISegmentedControl(items: ["All", "Available"]); - navigationItem.titleView = availabilityFilterSelector; - availabilityFilterSelector?.selectedSegmentIndex = Settings.RosterAvailableOnly.getBool() ? 1 : 0; - availabilityFilterSelector?.addTarget(self, action: #selector(RosterViewController.availabilityFilterChanged), for: .valueChanged); setColors(); updateNavBarColors(); @@ -88,21 +82,14 @@ class RosterViewController: AbstractRosterViewController, UIGestureRecognizerDel func updateNavBarColors() { if #available(iOS 13.0, *) { if self.traitCollection.userInterfaceStyle == .dark { - availabilityFilterSelector?.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white], for: .selected); - availabilityFilterSelector?.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white], for: .normal); searchController.searchBar.setScopeBarButtonTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white], for: .selected) searchController.searchBar.setScopeBarButtonTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white], for: .normal); } else { - availabilityFilterSelector?.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor(named: "chatslistBackground")!], for: .selected); - availabilityFilterSelector?.setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white], for: .normal); searchController.searchBar.setScopeBarButtonTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor(named: "chatslistBackground")!], for: .selected) searchController.searchBar.setScopeBarButtonTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.white], for: .normal); } searchController.searchBar.searchTextField.textColor = UIColor.white; searchController.searchBar.searchTextField.backgroundColor = (self.traitCollection.userInterfaceStyle != .dark ? UIColor.black : UIColor.white).withAlphaComponent(0.2); - DispatchQueue.main.async { - self.availabilityFilterSelector?.selectedSegmentIndex = Settings.RosterAvailableOnly.getBool() ? 1 : 0; - } } } @@ -111,7 +98,7 @@ class RosterViewController: AbstractRosterViewController, UIGestureRecognizerDel return; } DispatchQueue.main.async { - self.initializeRosterProvider(availableOnly: (self.availabilityFilterSelector?.selectedSegmentIndex ?? 0) == 1, sortOrder: self.searchController.searchBar.selectedScopeButtonIndex == 0 ? .alphabetical : .availability); + self.initializeRosterProvider(availableOnly: false, sortOrder: self.searchController.searchBar.selectedScopeButtonIndex == 0 ? .alphabetical : .availability); self.tableView.reloadData(); } } From 890b25043e20ce43d8975301f3e13cd2c6ce490b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 17 Dec 2020 16:50:35 +0000 Subject: [PATCH 2/2] Add titles to Chats and Contacts screens The titles are set to white so they fit with the default theme. --- SiskinIM/Base.lproj/Main.storyboard | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/SiskinIM/Base.lproj/Main.storyboard b/SiskinIM/Base.lproj/Main.storyboard index 817b329a..1d6099fd 100644 --- a/SiskinIM/Base.lproj/Main.storyboard +++ b/SiskinIM/Base.lproj/Main.storyboard @@ -11,7 +11,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -447,7 +447,7 @@ - + @@ -470,6 +470,12 @@ + + + + + + @@ -493,6 +499,12 @@ + + + + + + @@ -526,6 +538,12 @@ + + + + + +