Commit 410ee42a authored by Jose Blaya's avatar Jose Blaya
Browse files

Updated to PIAX Region selection tableview

parent 08d41f57
...@@ -44,12 +44,15 @@ class RegionCell: UITableViewCell, Restylable { ...@@ -44,12 +44,15 @@ class RegionCell: UITableViewCell, Restylable {
func viewShouldRestyle() { func viewShouldRestyle() {
backgroundView = UIView() backgroundView = UIView()
backgroundView?.backgroundColor = Theme.current.palette.lightBackground
selectedBackgroundView = UIView() selectedBackgroundView = UIView()
selectedBackgroundView?.backgroundColor = Theme.current.palette.lightBackground
accessoryView = UIImageView(image: Asset.accessorySelected.image) accessoryView = UIImageView(image: Asset.accessorySelected.image)
Theme.current.applySolidLightBackground(backgroundView!)
Theme.current.applySelection(selectedBackgroundView!)
Theme.current.applyList(labelRegion, appearance: .dark) Theme.current.applyList(labelRegion, appearance: .dark)
Theme.current.applyTag(labelPingTime, appearance: .dark) Theme.current.applyTag(labelPingTime, appearance: .dark)
} }
} }
...@@ -35,11 +35,14 @@ class RegionsViewController: AutolayoutViewController { ...@@ -35,11 +35,14 @@ class RegionsViewController: AutolayoutViewController {
selectedServer = Client.preferences.displayedServer selectedServer = Client.preferences.displayedServer
NotificationCenter.default.addObserver(self, selector: #selector(pingsDidComplete(notification:)), name: .PIADaemonsDidPingServers, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(pingsDidComplete(notification:)), name: .PIADaemonsDidPingServers, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(viewHasRotated), name: .UIDeviceOrientationDidChange, object: nil)
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
styleNavigationBarWithTitle(L10n.Menu.Item.region)
let selectedRow = servers.index { (server) -> Bool in let selectedRow = servers.index { (server) -> Bool in
return (server.identifier == selectedServer.identifier) return (server.identifier == selectedServer.identifier)
} }
...@@ -51,7 +54,10 @@ class RegionsViewController: AutolayoutViewController { ...@@ -51,7 +54,10 @@ class RegionsViewController: AutolayoutViewController {
} }
// MARK: Actions // MARK: Actions
@objc private func viewHasRotated() {
styleNavigationBarWithTitle(L10n.Menu.Item.region)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let identifier = segue.identifier, let segue = StoryboardSegue.Main(rawValue: identifier) else { guard let identifier = segue.identifier, let segue = StoryboardSegue.Main(rawValue: identifier) else {
return return
...@@ -100,11 +106,14 @@ class RegionsViewController: AutolayoutViewController { ...@@ -100,11 +106,14 @@ class RegionsViewController: AutolayoutViewController {
override func viewShouldRestyle() { override func viewShouldRestyle() {
super.viewShouldRestyle() super.viewShouldRestyle()
styleNavigationBarWithTitle(L10n.Menu.Item.region)
if let viewContainer = viewContainer { if let viewContainer = viewContainer {
Theme.current.applyLightBackground(view)
Theme.current.applyLightBackground(viewContainer) Theme.current.applyLightBackground(viewContainer)
} }
Theme.current.applySolidLightBackground(tableView) Theme.current.applyLightBackground(tableView)
Theme.current.applyDividerToSeparator(tableView)
tableView.reloadData() tableView.reloadData()
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment