apply new rounding/highlight design

pull/2/head
Michael Kirk 6 years ago
parent 4af9fa6789
commit a1e008f930

@ -27,6 +27,7 @@ public class GalleryRailCellView: UIView {
clipsToBounds = false clipsToBounds = false
addSubview(contentContainer) addSubview(contentContainer)
contentContainer.autoPinEdgesToSuperviewMargins() contentContainer.autoPinEdgesToSuperviewMargins()
contentContainer.layer.cornerRadius = 4.8
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTap(sender:))) let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didTap(sender:)))
addGestureRecognizer(tapGesture) addGestureRecognizer(tapGesture)
@ -64,7 +65,7 @@ public class GalleryRailCellView: UIView {
private(set) var isSelected: Bool = false private(set) var isSelected: Bool = false
public let cellBorderWidth: CGFloat = 2 public let cellBorderWidth: CGFloat = 3
func setIsSelected(_ isSelected: Bool) { func setIsSelected(_ isSelected: Bool) {
self.isSelected = isSelected self.isSelected = isSelected
@ -75,10 +76,8 @@ public class GalleryRailCellView: UIView {
if isSelected { if isSelected {
contentContainer.layer.borderColor = Theme.galleryHighlightColor.cgColor contentContainer.layer.borderColor = Theme.galleryHighlightColor.cgColor
contentContainer.layer.borderWidth = cellBorderWidth contentContainer.layer.borderWidth = cellBorderWidth
contentContainer.layer.cornerRadius = cellBorderWidth
} else { } else {
contentContainer.layer.borderWidth = 0 contentContainer.layer.borderWidth = 0
contentContainer.layer.cornerRadius = 0
} }
} }
@ -179,7 +178,7 @@ public class GalleryRailView: UIView, GalleryRailCellViewDelegate {
self.cellViews = cellViews self.cellViews = cellViews
let stackView = UIStackView(arrangedSubviews: cellViews) let stackView = UIStackView(arrangedSubviews: cellViews)
stackView.axis = .horizontal stackView.axis = .horizontal
stackView.spacing = 2 stackView.spacing = 0
stackView.clipsToBounds = false stackView.clipsToBounds = false
scrollView.addSubview(stackView) scrollView.addSubview(stackView)

Loading…
Cancel
Save