Update rail icons.

pull/2/head
Matthew Chen 6 years ago
parent 2f7880af8e
commit 66efcb4639

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "x-24@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "x-24@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "x-24@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

@ -1676,12 +1676,14 @@ public class ApprovalRailCellView: GalleryRailCellView {
strongSelf.approvalRailCellDelegate?.approvalRailCellView(strongSelf, didRemoveItem: attachmentItem) strongSelf.approvalRailCellDelegate?.approvalRailCellView(strongSelf, didRemoveItem: attachmentItem)
} }
button.setImage(#imageLiteral(resourceName: "ic_circled_x"), for: .normal) button.setImage(UIImage(named: "x-24")?.withRenderingMode(.alwaysTemplate), for: .normal)
button.tintColor = .white
let kInsetDistance: CGFloat = 5 button.layer.shadowColor = UIColor.black.cgColor
button.imageEdgeInsets = UIEdgeInsets(top: kInsetDistance, left: kInsetDistance, bottom: kInsetDistance, right: kInsetDistance) button.layer.shadowRadius = 2
button.layer.shadowOpacity = 0.66
let kButtonWidth: CGFloat = 24 + kInsetDistance * 2 button.layer.shadowOffset = .zero
let kButtonWidth: CGFloat = 24
button.autoSetDimensions(to: CGSize(width: kButtonWidth, height: kButtonWidth)) button.autoSetDimensions(to: CGSize(width: kButtonWidth, height: kButtonWidth))
return button return button
@ -1704,8 +1706,8 @@ public class ApprovalRailCellView: GalleryRailCellView {
if isSelected { if isSelected {
addSubview(deleteButton) addSubview(deleteButton)
deleteButton.autoPinEdge(toSuperviewEdge: .top, withInset: -12) deleteButton.autoPinEdge(toSuperviewEdge: .top, withInset: cellBorderWidth)
deleteButton.autoPinEdge(toSuperviewEdge: .trailing, withInset: -8) deleteButton.autoPinEdge(toSuperviewEdge: .trailing, withInset: cellBorderWidth + 4)
} else { } else {
deleteButton.removeFromSuperview() deleteButton.removeFromSuperview()
} }
@ -1726,8 +1728,8 @@ public class ApprovalRailCellView: GalleryRailCellView {
if hasCaption { if hasCaption {
addSubview(captionIndicator) addSubview(captionIndicator)
captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: 2) captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: cellBorderWidth)
captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: 6) captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: cellBorderWidth + 4)
} else { } else {
captionIndicator.removeFromSuperview() captionIndicator.removeFromSuperview()
} }

@ -63,17 +63,18 @@ public class GalleryRailCellView: UIView {
private(set) var isSelected: Bool = false private(set) var isSelected: Bool = false
public let cellBorderWidth: CGFloat = 2
func setIsSelected(_ isSelected: Bool) { func setIsSelected(_ isSelected: Bool) {
let borderWidth: CGFloat = 2
self.isSelected = isSelected self.isSelected = isSelected
// Reserve space for the selection border whether or not the cell is selected. // Reserve space for the selection border whether or not the cell is selected.
layoutMargins = UIEdgeInsets(top: 0, left: borderWidth, bottom: 0, right: borderWidth) layoutMargins = UIEdgeInsets(top: 0, left: cellBorderWidth, bottom: 0, right: cellBorderWidth)
if isSelected { if isSelected {
imageView.layer.borderColor = Theme.galleryHighlightColor.cgColor imageView.layer.borderColor = Theme.galleryHighlightColor.cgColor
imageView.layer.borderWidth = borderWidth imageView.layer.borderWidth = cellBorderWidth
imageView.layer.cornerRadius = borderWidth imageView.layer.cornerRadius = cellBorderWidth
} else { } else {
imageView.layer.borderWidth = 0 imageView.layer.borderWidth = 0
imageView.layer.cornerRadius = 0 imageView.layer.cornerRadius = 0

Loading…
Cancel
Save