Skip to content
Permalink
Browse files

Lower shadow opacity on skip controls and remove border

  • Loading branch information...
GianniCarlo committed Aug 12, 2019
1 parent 8c48f9a commit f87845867dfbbd23c8e9e5a496495e7c0758ceaf
@@ -29,13 +29,14 @@ extension UIView {
self.layer.anchorPoint = anchorPoint
}

func addLayerMask(_ name: String, backgroundColor: UIColor) {
func addLayerMask(_ name: String, backgroundColor: UIColor, opacity: Float = 1.0) {
guard let image = UIImage(named: name),
let maskImage = image.cgImage else { return }

let layer = CALayer()
layer.frame = self.bounds
layer.backgroundColor = backgroundColor.cgColor
layer.opacity = opacity

let mask = CALayer(layer: maskImage)
mask.frame = self.bounds
@@ -25,6 +25,8 @@
<array/>
<key>CFBundleTypeName</key>
<string>Audiobook Archive</string>
<key>LSHandlerRank</key>
<string>Default</string>
<key>LSItemContentTypes</key>
<array>
<string>com.pkware.zip-archive</string>
@@ -187,7 +189,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
@@ -283,7 +283,6 @@ extension PlayerControlsViewController: Themeable {
self.progressSlider.maximumTrackTintColor = theme.lightHighlightColor

self.artworkControl.iconColor = .white
self.artworkControl.borderColor = theme.highlightColor

self.currentTimeLabel.textColor = theme.primaryColor
self.maxTimeButton.setTitleColor(theme.primaryColor, for: .normal)
@@ -42,16 +42,6 @@ class ArtworkControl: UIView, UIGestureRecognizerDelegate {
}
}

var borderColor: UIColor {
get {
return UIColor(cgColor: self.artworkImage.layer.borderColor!)
}

set {
self.artworkImage.layer.borderColor = newValue.withAlphaComponent(0.2).cgColor
}
}

var artwork: UIImage? {
get {
return self.artworkImage.image
@@ -138,6 +128,7 @@ class ArtworkControl: UIView, UIGestureRecognizerDelegate {
self.artworkImage.contentMode = .scaleAspectFit
self.artworkImage.layer.cornerRadius = 6.0
self.artworkImage.layer.masksToBounds = true
self.artworkImage.layer.borderColor = UIColor.clear.cgColor

self.artworkOverlay.clipsToBounds = false
self.artworkOverlay.contentMode = .scaleAspectFit
@@ -78,7 +78,7 @@ class PlayerJumpIconForward: PlayerJumpIcon {
override func setup() {
super.setup()

self.backgroundImageView.addLayerMask("playerIconShadow", backgroundColor: .playerControlsShadowColor)
self.backgroundImageView.addLayerMask("playerIconShadow", backgroundColor: .playerControlsShadowColor, opacity: 0.5)
self.backgroundImageView.addLayerMask("playerIconForwardArrowShadow", backgroundColor: .black)
self.backgroundImageView.addLayerMask("playerIconForward", backgroundColor: .white)
self.title = "+\(Int(PlayerManager.shared.forwardInterval.rounded()))s"
@@ -98,7 +98,7 @@ class PlayerJumpIconRewind: PlayerJumpIcon {
override func setup() {
super.setup()

self.backgroundImageView.addLayerMask("playerIconShadow", backgroundColor: .playerControlsShadowColor)
self.backgroundImageView.addLayerMask("playerIconShadow", backgroundColor: .playerControlsShadowColor, opacity: 0.5)
self.backgroundImageView.addLayerMask("playerIconRewindArrowShadow", backgroundColor: .black)
self.backgroundImageView.addLayerMask("playerIconRewind", backgroundColor: .white)
self.title = "\(Int(PlayerManager.shared.rewindInterval.rounded()))s"
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>3.3.1</string>
<string>3.4.0</string>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
<key>CLKComplicationPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ComplicationController</string>
<key>CLKComplicationSupportedFamilies</key>
@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>3.4.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>3.4.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>

0 comments on commit f878458

Please sign in to comment.
You can’t perform that action at this time.