Commit 84b9fdd1 authored by Jose Blaya's avatar Jose Blaya
Browse files

Change border color when highlighting the PIA Connection Button

parent ede17ee4
......@@ -14,6 +14,8 @@ private struct PIAConnectionButtonSettings {
static let outsideBorderWidth: CGFloat = 10.0
static let outsideBorderLightColor = UIColor.piaGrey2.cgColor
static let outsideBorderDarkColor = UIColor.piaGrey10.cgColor
static let highlightedOutsideBorderLightColor = UIColor.piaGrey2Light.cgColor
static let highlightedOutsideBorderDarkColor = UIColor.piaGrey7.cgColor
static let animatedShapeWidth: CGFloat = 4.0
static let startAngle: CGFloat = -0.25 * 2 * .pi
static let endAngle: CGFloat = PIAConnectionButtonSettings.startAngle + 2 * .pi
......@@ -195,8 +197,27 @@ class PIAConnectionButton: UIButton, Restylable {
// MARK: Restylable
@objc func viewShouldRestyle() {
self.layer.borderColor = Theme.current.palette.appearance == .dark ?
self.layer.borderColor = buttonBorderColor()
}
override open var isHighlighted: Bool {
didSet {
self.layer.borderColor = isHighlighted ?
highlightedButtonBorderColor() :
buttonBorderColor()
}
}
private func buttonBorderColor() -> CGColor {
return Theme.current.palette.appearance == .dark ?
PIAConnectionButtonSettings.outsideBorderDarkColor :
PIAConnectionButtonSettings.outsideBorderLightColor
}
private func highlightedButtonBorderColor() -> CGColor {
return Theme.current.palette.appearance == .dark ?
PIAConnectionButtonSettings.highlightedOutsideBorderDarkColor :
PIAConnectionButtonSettings.highlightedOutsideBorderLightColor
}
}
......@@ -53,7 +53,7 @@ end
def shared_main_pods
pod 'AlamofireImage'
#library_by_path('')
library_by_git('2b20125')
library_by_git('5f3119f')
#library_by_version('~> 1.1.3')
end
......
......@@ -114,10 +114,10 @@ DEPENDENCIES:
- FXPageControl
- HockeySDK
- iRate
- PIALibrary/Library (from `https://github.com/pia-foss/client-library-apple`, commit `2b20125`)
- PIALibrary/Mock (from `https://github.com/pia-foss/client-library-apple`, commit `2b20125`)
- PIALibrary/UI (from `https://github.com/pia-foss/client-library-apple`, commit `2b20125`)
- PIALibrary/VPN (from `https://github.com/pia-foss/client-library-apple`, commit `2b20125`)
- PIALibrary/Library (from `https://github.com/pia-foss/client-library-apple`, commit `5f3119f`)
- PIALibrary/Mock (from `https://github.com/pia-foss/client-library-apple`, commit `5f3119f`)
- PIALibrary/UI (from `https://github.com/pia-foss/client-library-apple`, commit `5f3119f`)
- PIALibrary/VPN (from `https://github.com/pia-foss/client-library-apple`, commit `5f3119f`)
- PIATunnel (from `https://github.com/pia-foss/tunnel-apple`, commit `bd53e0a`)
- PopupDialog
- SideMenu (= 3.1.5)
......@@ -154,7 +154,7 @@ SPEC REPOS:
EXTERNAL SOURCES:
PIALibrary:
:commit: 2b20125
:commit: 5f3119f
:git: https://github.com/pia-foss/client-library-apple
PIATunnel:
:commit: bd53e0a
......@@ -162,7 +162,7 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS:
PIALibrary:
:commit: 2b20125
:commit: 5f3119f
:git: https://github.com/pia-foss/client-library-apple
PIATunnel:
:commit: bd53e0a
......@@ -198,6 +198,6 @@ SPEC CHECKSUMS:
SwiftyBeaver: ccfcdf85a04d429f1633f668650b0ce8020bda3a
TPKeyboardAvoiding: cb69d5ddbe90ce0170e4bc2db1e5e41d4a3ad9a4
PODFILE CHECKSUM: 394cb2f95485403cfa88908e011a4b62d702af41
PODFILE CHECKSUM: 11650fadd102a4d505f26e8c75495168a08988bf
COCOAPODS: 1.5.3
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