feat: ignore smart invert for photos

This commit is contained in:
CMK 2021-05-10 16:06:00 +08:00
parent b63ae6800b
commit 4901b50d3b
7 changed files with 18 additions and 3 deletions

View File

@ -47,6 +47,10 @@ extension AvatarConfigurableView {
configurableAvatarButton?.layer.cornerRadius = 0
configurableAvatarButton?.layer.cornerCurve = .circular
// accessibility
configurableAvatarImageView?.accessibilityIgnoresInvertColors = true
configurableAvatarButton?.accessibilityIgnoresInvertColors = true
defer {
avatarConfigurableView(self, didFinishConfiguration: configuration)
}

View File

@ -16,6 +16,8 @@ final class MediaPreviewImageView: UIScrollView {
imageView.contentMode = .scaleAspectFit
imageView.clipsToBounds = true
imageView.isUserInteractionEnabled = true
// accessibility
imageView.accessibilityIgnoresInvertColors = true
return imageView
}()

View File

@ -45,9 +45,8 @@ final class ProfileHeaderView: UIView {
imageView.backgroundColor = ProfileHeaderView.bannerImageViewPlaceholderColor
imageView.layer.masksToBounds = true
imageView.isUserInteractionEnabled = true
// #if DEBUG
// imageView.image = .placeholder(color: .red)
// #endif
// accessibility
imageView.accessibilityIgnoresInvertColors = true
return imageView
}()
let bannerImageViewOverlayView: UIView = {

View File

@ -15,6 +15,8 @@ protocol SettingsAppearanceTableViewCellDelegate: class {
class AppearanceView: UIView {
lazy var imageView: UIImageView = {
let view = UIImageView()
// accessibility
view.accessibilityIgnoresInvertColors = true
return view
}()
lazy var titleLabel: UILabel = {

View File

@ -65,6 +65,9 @@ extension MosaicImageViewContainer: ContentWarningOverlayViewDelegate {
extension MosaicImageViewContainer {
private func _init() {
// accessibility
accessibilityIgnoresInvertColors = true
container.translatesAutoresizingMaskIntoConstraints = false
container.axis = .horizontal
container.distribution = .fillEqually

View File

@ -46,6 +46,9 @@ final class PlayerContainerView: UIView {
extension PlayerContainerView {
private func _init() {
// accessibility
accessibilityIgnoresInvertColors = true
container.translatesAutoresizingMaskIntoConstraints = false
addSubview(container)
containerHeightLayoutConstraint = container.heightAnchor.constraint(equalToConstant: 162).priority(.required - 1)

View File

@ -73,6 +73,8 @@ extension MediaHostToMediaPreviewViewControllerAnimatedTransitioning {
imageView.contentMode = .scaleAspectFill
imageView.isUserInteractionEnabled = false
imageView.image = transitionItem.image
// accessibility
imageView.accessibilityIgnoresInvertColors = true
return imageView
}()
transitionItem.targetFrame = transitionTargetFrame