From 66efcb4639b75440cf84ca5d4994db232f8f4355 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 12 Mar 2019 13:27:35 -0400 Subject: [PATCH] Update rail icons. --- .../x-24.imageset/Contents.json | 23 ++++++++++++++++++ .../Images.xcassets/x-24.imageset/x-24@1x.png | Bin 0 -> 243 bytes .../Images.xcassets/x-24.imageset/x-24@2x.png | Bin 0 -> 398 bytes .../Images.xcassets/x-24.imageset/x-24@3x.png | Bin 0 -> 573 bytes .../AttachmentApprovalViewController.swift | 20 ++++++++------- SignalMessaging/Views/GalleryRailView.swift | 9 ++++--- 6 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 Signal/Images.xcassets/x-24.imageset/Contents.json create mode 100644 Signal/Images.xcassets/x-24.imageset/x-24@1x.png create mode 100644 Signal/Images.xcassets/x-24.imageset/x-24@2x.png create mode 100644 Signal/Images.xcassets/x-24.imageset/x-24@3x.png diff --git a/Signal/Images.xcassets/x-24.imageset/Contents.json b/Signal/Images.xcassets/x-24.imageset/Contents.json new file mode 100644 index 000000000..1f25af162 --- /dev/null +++ b/Signal/Images.xcassets/x-24.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/Signal/Images.xcassets/x-24.imageset/x-24@1x.png b/Signal/Images.xcassets/x-24.imageset/x-24@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..ee6d0b887443c3733f4bf3dc008a1adce365639a GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GGLLkg|>2BR0px{zZ z7sn8f&bOhtTn!35wXa#^ZYq~4CkHIZJIgEcH&fxt=UR_fi>^r-z4j>muhP(=B`A6@ zMkG5zJ7N#}d4>Zlbry_M>dr}>*=zbIi2c0g0`*-^VY4WGsShchAuJR{iW<~ m>yER_Cs;lH?|)y9K|JM*R^O4Q$E1M{X7F_Nb6Mw<&;$VBSYMt1 literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/x-24.imageset/x-24@2x.png b/Signal/Images.xcassets/x-24.imageset/x-24@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..ea502285caf8531820a4cffebcb866af3b2bc408 GIT binary patch literal 398 zcmV;90df9`P)bfi!V8w;*bPFyWC? z5LS4a@X95KOM1<-BQz4(0Pjyx5J(e{|41VdCQu`pAP^>?!>~qrny{|9Xltai361lc z#Wm8|1hkG41kePe2n@fZ6psG(6RI>m#!qZC{{F*g=!qfnTLRL&#bj$Gc`3=U%j$ibvB^93G-~AMAJcc sIWaMN0f1J`aZ=wK!$5Bg16@HxZh($ literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/x-24.imageset/x-24@3x.png b/Signal/Images.xcassets/x-24.imageset/x-24@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..cbb9bb263d56a3b51b69b48ace2bb48ad7eb0b3a GIT binary patch literal 573 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9FJ<{->y95KI&fr0V8 zr;B4q#hkZu8aodg2(X05J6in|3!3Hasj2z!^2zcA?g#mgso%Y+c4=;c__PV4ZqF49 zRlNO9SvF_AUVYPPud72F#|Z&ONhJkmmXwYL9>EEUOhzS~0bZG&ns;5C1ExlKpPjx+ zJGj@F?Sn=;;}6CH>*_xl)1|IQot}OC<>$4ny7>>DNGiO2@I-rp%LSu`)a!v69=sO+ zDr#cjvmIQp>6ZL{q^VZy^hrgSzU7eubkbjY5&$a7ew{4&Q(T=h@ zmC8JoaiyBL#fK=182>N(ejdpvYGyt^^=k8kn1>DC=eONqkln*Kb=&giM%%d;Ocu`! z_c+WbSrFHoJxPAatp^>|mP>V6MuwibE!$Oj*vBw`r`9vy>Z38=0?)KMAC0LB zJ9C!1Yv*5AL-PR5XJR%-?;Ke<<936nd)sC1NgPr082$J?lrm=WZ9_y@ literal 0 HcmV?d00001 diff --git a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift index 40e681eda..a442a68aa 100644 --- a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift @@ -1676,12 +1676,14 @@ public class ApprovalRailCellView: GalleryRailCellView { 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 + button.layer.shadowColor = UIColor.black.cgColor + button.layer.shadowRadius = 2 + button.layer.shadowOpacity = 0.66 + button.layer.shadowOffset = .zero - let kInsetDistance: CGFloat = 5 - button.imageEdgeInsets = UIEdgeInsets(top: kInsetDistance, left: kInsetDistance, bottom: kInsetDistance, right: kInsetDistance) - - let kButtonWidth: CGFloat = 24 + kInsetDistance * 2 + let kButtonWidth: CGFloat = 24 button.autoSetDimensions(to: CGSize(width: kButtonWidth, height: kButtonWidth)) return button @@ -1704,8 +1706,8 @@ public class ApprovalRailCellView: GalleryRailCellView { if isSelected { addSubview(deleteButton) - deleteButton.autoPinEdge(toSuperviewEdge: .top, withInset: -12) - deleteButton.autoPinEdge(toSuperviewEdge: .trailing, withInset: -8) + deleteButton.autoPinEdge(toSuperviewEdge: .top, withInset: cellBorderWidth) + deleteButton.autoPinEdge(toSuperviewEdge: .trailing, withInset: cellBorderWidth + 4) } else { deleteButton.removeFromSuperview() } @@ -1726,8 +1728,8 @@ public class ApprovalRailCellView: GalleryRailCellView { if hasCaption { addSubview(captionIndicator) - captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: 2) - captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: 6) + captionIndicator.autoPinEdge(toSuperviewEdge: .top, withInset: cellBorderWidth) + captionIndicator.autoPinEdge(toSuperviewEdge: .leading, withInset: cellBorderWidth + 4) } else { captionIndicator.removeFromSuperview() } diff --git a/SignalMessaging/Views/GalleryRailView.swift b/SignalMessaging/Views/GalleryRailView.swift index 66690ab2a..6f797ea6b 100644 --- a/SignalMessaging/Views/GalleryRailView.swift +++ b/SignalMessaging/Views/GalleryRailView.swift @@ -63,17 +63,18 @@ public class GalleryRailCellView: UIView { private(set) var isSelected: Bool = false + public let cellBorderWidth: CGFloat = 2 + func setIsSelected(_ isSelected: Bool) { - let borderWidth: CGFloat = 2 self.isSelected = isSelected // 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 { imageView.layer.borderColor = Theme.galleryHighlightColor.cgColor - imageView.layer.borderWidth = borderWidth - imageView.layer.cornerRadius = borderWidth + imageView.layer.borderWidth = cellBorderWidth + imageView.layer.cornerRadius = cellBorderWidth } else { imageView.layer.borderWidth = 0 imageView.layer.cornerRadius = 0