more concise constants post translation

pull/2/head
Michael Kirk 6 years ago
parent 57b1aaa3dc
commit cfebb53719

@ -172,7 +172,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView
let title = NSLocalizedString("INVITE_FLOW_REQUIRES_CONTACT_ACCESS_TITLE", comment: "Alert title when contacts disabled while trying to invite contacts to signal") let title = NSLocalizedString("INVITE_FLOW_REQUIRES_CONTACT_ACCESS_TITLE", comment: "Alert title when contacts disabled while trying to invite contacts to signal")
let body = NSLocalizedString("INVITE_FLOW_REQUIRES_CONTACT_ACCESS_BODY", comment: "Alert body when contacts disabled while trying to invite contacts to signal") let body = NSLocalizedString("INVITE_FLOW_REQUIRES_CONTACT_ACCESS_BODY", comment: "Alert body when contacts disabled while trying to invite contacts to signal")
let alert = UIAlertController(title: title, message: body, preferredStyle: UIAlertController.Style.alert) let alert = UIAlertController(title: title, message: body, preferredStyle: .alert)
let dismissText = CommonStrings.cancelButton let dismissText = CommonStrings.cancelButton

@ -204,8 +204,8 @@ public class ConversationMediaView: UIView {
animatedImageView.contentMode = .scaleAspectFill animatedImageView.contentMode = .scaleAspectFill
// Use trilinear filters for better scaling quality at // Use trilinear filters for better scaling quality at
// some performance cost. // some performance cost.
animatedImageView.layer.minificationFilter = CALayerContentsFilter.trilinear animatedImageView.layer.minificationFilter = .trilinear
animatedImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear animatedImageView.layer.magnificationFilter = .trilinear
animatedImageView.backgroundColor = Theme.offBackgroundColor animatedImageView.backgroundColor = Theme.offBackgroundColor
addSubview(animatedImageView) addSubview(animatedImageView)
animatedImageView.autoPinEdgesToSuperviewEdges() animatedImageView.autoPinEdgesToSuperviewEdges()
@ -263,8 +263,8 @@ public class ConversationMediaView: UIView {
stillImageView.contentMode = .scaleAspectFill stillImageView.contentMode = .scaleAspectFill
// Use trilinear filters for better scaling quality at // Use trilinear filters for better scaling quality at
// some performance cost. // some performance cost.
stillImageView.layer.minificationFilter = CALayerContentsFilter.trilinear stillImageView.layer.minificationFilter = .trilinear
stillImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear stillImageView.layer.magnificationFilter = .trilinear
stillImageView.backgroundColor = Theme.offBackgroundColor stillImageView.backgroundColor = Theme.offBackgroundColor
addSubview(stillImageView) addSubview(stillImageView)
stillImageView.autoPinEdgesToSuperviewEdges() stillImageView.autoPinEdgesToSuperviewEdges()
@ -318,8 +318,8 @@ public class ConversationMediaView: UIView {
stillImageView.contentMode = .scaleAspectFill stillImageView.contentMode = .scaleAspectFill
// Use trilinear filters for better scaling quality at // Use trilinear filters for better scaling quality at
// some performance cost. // some performance cost.
stillImageView.layer.minificationFilter = CALayerContentsFilter.trilinear stillImageView.layer.minificationFilter = .trilinear
stillImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear stillImageView.layer.magnificationFilter = .trilinear
stillImageView.backgroundColor = Theme.offBackgroundColor stillImageView.backgroundColor = Theme.offBackgroundColor
addSubview(stillImageView) addSubview(stillImageView)

@ -105,7 +105,7 @@ public class MediaDownloadView: UIView {
shapeLayer1.path = bezierPath1.cgPath shapeLayer1.path = bezierPath1.cgPath
let fillColor1: UIColor = UIColor(white: 1.0, alpha: 0.4) let fillColor1: UIColor = UIColor(white: 1.0, alpha: 0.4)
shapeLayer1.fillColor = fillColor1.cgColor shapeLayer1.fillColor = fillColor1.cgColor
shapeLayer1.fillRule = CAShapeLayerFillRule.evenOdd shapeLayer1.fillRule = .evenOdd
let bezierPath2 = UIBezierPath() let bezierPath2 = UIBezierPath()
bezierPath2.addArc(withCenter: center, radius: outerRadius, startAngle: startAngle, endAngle: endAngle, clockwise: true) bezierPath2.addArc(withCenter: center, radius: outerRadius, startAngle: startAngle, endAngle: endAngle, clockwise: true)

@ -110,7 +110,7 @@ public class MediaUploadView: UIView {
bezierPath2.append(UIBezierPath(ovalIn: outerCircleBounds)) bezierPath2.append(UIBezierPath(ovalIn: outerCircleBounds))
shapeLayer2.path = bezierPath2.cgPath shapeLayer2.path = bezierPath2.cgPath
shapeLayer2.fillColor = UIColor(white: 1.0, alpha: 0.4).cgColor shapeLayer2.fillColor = UIColor(white: 1.0, alpha: 0.4).cgColor
shapeLayer2.fillRule = CAShapeLayerFillRule.evenOdd shapeLayer2.fillRule = .evenOdd
CATransaction.commit() CATransaction.commit()
} }

@ -184,7 +184,7 @@ import SignalMessaging
path.usesEvenOddFillRule = true path.usesEvenOddFillRule = true
layer.path = path.cgPath layer.path = path.cgPath
layer.fillRule = CAShapeLayerFillRule.evenOdd layer.fillRule = .evenOdd
layer.fillColor = UIColor.black.cgColor layer.fillColor = UIColor.black.cgColor
layer.opacity = 0.7 layer.opacity = 0.7
} }

@ -349,7 +349,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
path.append(UIBezierPath(rect: cellRect)) path.append(UIBezierPath(rect: cellRect))
layer.path = path.cgPath layer.path = path.cgPath
layer.fillRule = CAShapeLayerFillRule.evenOdd layer.fillRule = .evenOdd
layer.fillColor = UIColor.black.cgColor layer.fillColor = UIColor.black.cgColor
layer.opacity = 0.7 layer.opacity = 0.7
} }

@ -282,8 +282,8 @@ class MediaGalleryNavigationController: OWSNavigationController {
presentationView.isHidden = true presentationView.isHidden = true
presentationView.clipsToBounds = true presentationView.clipsToBounds = true
presentationView.layer.allowsEdgeAntialiasing = true presentationView.layer.allowsEdgeAntialiasing = true
presentationView.layer.minificationFilter = CALayerContentsFilter.trilinear presentationView.layer.minificationFilter = .trilinear
presentationView.layer.magnificationFilter = CALayerContentsFilter.trilinear presentationView.layer.magnificationFilter = .trilinear
presentationView.contentMode = .scaleAspectFit presentationView.contentMode = .scaleAspectFit
guard let navigationBar = self.navigationBar as? OWSNavigationBar else { guard let navigationBar = self.navigationBar as? OWSNavigationBar else {

@ -17,8 +17,8 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
let heroImage = UIImage(named: "onboarding_splash_hero") let heroImage = UIImage(named: "onboarding_splash_hero")
let heroImageView = UIImageView(image: heroImage) let heroImageView = UIImageView(image: heroImage)
heroImageView.contentMode = .scaleAspectFit heroImageView.contentMode = .scaleAspectFit
heroImageView.layer.minificationFilter = CALayerContentsFilter.trilinear heroImageView.layer.minificationFilter = .trilinear
heroImageView.layer.magnificationFilter = CALayerContentsFilter.trilinear heroImageView.layer.magnificationFilter = .trilinear
heroImageView.setCompressionResistanceLow() heroImageView.setCompressionResistanceLow()
heroImageView.setContentHuggingVerticalLow() heroImageView.setContentHuggingVerticalLow()
heroImageView.accessibilityIdentifier = "onboarding.splash." + "heroImageView" heroImageView.accessibilityIdentifier = "onboarding.splash." + "heroImageView"

@ -138,8 +138,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
let audioPlayButton = UIButton() let audioPlayButton = UIButton()
self.audioPlayButton = audioPlayButton self.audioPlayButton = audioPlayButton
setAudioIconToPlay() setAudioIconToPlay()
audioPlayButton.imageView?.layer.minificationFilter = CALayerContentsFilter.trilinear audioPlayButton.imageView?.layer.minificationFilter = .trilinear
audioPlayButton.imageView?.layer.magnificationFilter = CALayerContentsFilter.trilinear audioPlayButton.imageView?.layer.magnificationFilter = .trilinear
audioPlayButton.addTarget(self, action: #selector(audioPlayButtonPressed), for: .touchUpInside) audioPlayButton.addTarget(self, action: #selector(audioPlayButtonPressed), for: .touchUpInside)
let buttonSize = createHeroViewSize() let buttonSize = createHeroViewSize()
audioPlayButton.autoSetDimension(.width, toSize: buttonSize) audioPlayButton.autoSetDimension(.width, toSize: buttonSize)
@ -221,8 +221,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
} }
let imageView = UIImageView(image: image) let imageView = UIImageView(image: image)
imageView.layer.minificationFilter = CALayerContentsFilter.trilinear imageView.layer.minificationFilter = .trilinear
imageView.layer.magnificationFilter = CALayerContentsFilter.trilinear imageView.layer.magnificationFilter = .trilinear
let aspectRatio = image.size.width / image.size.height let aspectRatio = image.size.width / image.size.height
addSubviewWithScaleAspectFitLayout(view: imageView, aspectRatio: aspectRatio) addSubviewWithScaleAspectFitLayout(view: imageView, aspectRatio: aspectRatio)
contentView = imageView contentView = imageView
@ -243,8 +243,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
} }
let imageView = UIImageView(image: image) let imageView = UIImageView(image: image)
imageView.layer.minificationFilter = CALayerContentsFilter.trilinear imageView.layer.minificationFilter = .trilinear
imageView.layer.magnificationFilter = CALayerContentsFilter.trilinear imageView.layer.magnificationFilter = .trilinear
let aspectRatio = image.size.width / image.size.height let aspectRatio = image.size.width / image.size.height
addSubviewWithScaleAspectFitLayout(view: imageView, aspectRatio: aspectRatio) addSubviewWithScaleAspectFitLayout(view: imageView, aspectRatio: aspectRatio)
contentView = imageView contentView = imageView
@ -307,8 +307,8 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
let image = UIImage(named: imageName) let image = UIImage(named: imageName)
assert(image != nil) assert(image != nil)
let imageView = UIImageView(image: image) let imageView = UIImageView(image: image)
imageView.layer.minificationFilter = CALayerContentsFilter.trilinear imageView.layer.minificationFilter = .trilinear
imageView.layer.magnificationFilter = CALayerContentsFilter.trilinear imageView.layer.magnificationFilter = .trilinear
imageView.layer.shadowColor = UIColor.black.cgColor imageView.layer.shadowColor = UIColor.black.cgColor
let shadowScaling = 5.0 let shadowScaling = 5.0
imageView.layer.shadowRadius = CGFloat(2.0 * shadowScaling) imageView.layer.shadowRadius = CGFloat(2.0 * shadowScaling)

@ -32,8 +32,8 @@ public class AvatarImageView: UIImageView {
func configureView() { func configureView() {
self.autoPinToSquareAspectRatio() self.autoPinToSquareAspectRatio()
self.layer.minificationFilter = CALayerContentsFilter.trilinear self.layer.minificationFilter = .trilinear
self.layer.magnificationFilter = CALayerContentsFilter.trilinear self.layer.magnificationFilter = .trilinear
self.layer.masksToBounds = true self.layer.masksToBounds = true
self.layer.addSublayer(self.shadowLayer) self.layer.addSublayer(self.shadowLayer)
@ -57,7 +57,7 @@ public class AvatarImageView: UIImageView {
// This can be any color since the fill should be clipped. // This can be any color since the fill should be clipped.
self.shadowLayer.fillColor = UIColor.black.cgColor self.shadowLayer.fillColor = UIColor.black.cgColor
self.shadowLayer.path = shadowPath.cgPath self.shadowLayer.path = shadowPath.cgPath
self.shadowLayer.fillRule = CAShapeLayerFillRule.evenOdd self.shadowLayer.fillRule = .evenOdd
self.shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor self.shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor
self.shadowLayer.shadowRadius = 0.5 self.shadowLayer.shadowRadius = 0.5
self.shadowLayer.shadowOpacity = 0.15 self.shadowLayer.shadowOpacity = 0.15
@ -203,7 +203,7 @@ public class AvatarImageButton: UIButton {
// This can be any color since the fill should be clipped. // This can be any color since the fill should be clipped.
shadowLayer.fillColor = UIColor.black.cgColor shadowLayer.fillColor = UIColor.black.cgColor
shadowLayer.path = shadowPath.cgPath shadowLayer.path = shadowPath.cgPath
shadowLayer.fillRule = CAShapeLayerFillRule.evenOdd shadowLayer.fillRule = .evenOdd
shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor
shadowLayer.shadowRadius = 0.5 shadowLayer.shadowRadius = 0.5
shadowLayer.shadowOpacity = 0.15 shadowLayer.shadowOpacity = 0.15
@ -226,8 +226,8 @@ public class AvatarImageButton: UIButton {
autoPinToSquareAspectRatio() autoPinToSquareAspectRatio()
layer.minificationFilter = CALayerContentsFilter.trilinear layer.minificationFilter = .trilinear
layer.magnificationFilter = CALayerContentsFilter.trilinear layer.magnificationFilter = .trilinear
layer.masksToBounds = true layer.masksToBounds = true
layer.addSublayer(shadowLayer) layer.addSublayer(shadowLayer)

Loading…
Cancel
Save