Adjust gradient behind all media thumbnail label.

This commit is contained in:
george-signal 2023-02-03 16:01:35 -08:00 committed by GitHub
parent 5fe81c0ad3
commit aaafdb024d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -11018,6 +11018,7 @@
D95C39EA296E108100A9DA23 /* UsernameSelectionViewController.swift in Sources */,
45B821F92981F7D400BB08BE /* VideoDurationHelper.swift in Sources */,
66AE5779298440A100E40CFA /* ViewControllerContext.swift in Sources */,
45B821F92981F7D400BB08BE /* VideoDurationHelper.swift in Sources */,
3434AE1C22AEDE7D002EE04E /* ViewOnceMessageViewController.swift in Sources */,
88928A7726419D6B009C9B30 /* VoiceMessageDraftView.swift in Sources */,
88928A7526418904009C9B30 /* VoiceMessageTooltip.swift in Sources */,

View File

@ -250,10 +250,10 @@ public class PhotoGridViewCell: UICollectionViewCell {
self.durationLabel = durationLabel
}
if durationLabelBackground == nil {
let gradientView = GradientView(from: .ows_blackAlpha40, to: .clear)
gradientView.gradientLayer.type = .radial
gradientView.gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.5)
gradientView.gradientLayer.endPoint = CGPoint(x: 0, y: 90/122) // 122 x 58 oval
let gradientView = GradientView(from: .clear, to: .ows_blackAlpha60)
gradientView.gradientLayer.type = .axial
gradientView.gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.0)
gradientView.gradientLayer.endPoint = CGPoint(x: 0.5, y: 1.0)
self.durationLabelBackground = gradientView
}
@ -268,10 +268,10 @@ public class PhotoGridViewCell: UICollectionViewCell {
}
if durationLabelBackground.superview == nil {
contentView.insertSubview(durationLabelBackground, belowSubview: durationLabel)
durationLabelBackground.autoPinEdge(.top, to: .top, of: durationLabel, withOffset: -10)
durationLabelBackground.autoPinEdge(.leading, to: .leading, of: durationLabel, withOffset: -24)
durationLabelBackground.centerXAnchor.constraint(equalTo: contentView.trailingAnchor).isActive = true
durationLabelBackground.centerYAnchor.constraint(equalTo: contentView.bottomAnchor).isActive = true
durationLabelBackground.topAnchor.constraint(equalTo: contentView.centerYAnchor).isActive = true
durationLabelBackground.autoPinEdge(toSuperviewEdge: .leading)
durationLabelBackground.autoPinEdge(toSuperviewEdge: .trailing)
durationLabelBackground.autoPinEdge(toSuperviewEdge: .bottom)
}
durationLabel.isHidden = false