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.cornerRadius = 0
configurableAvatarButton?.layer.cornerCurve = .circular configurableAvatarButton?.layer.cornerCurve = .circular
// accessibility
configurableAvatarImageView?.accessibilityIgnoresInvertColors = true
configurableAvatarButton?.accessibilityIgnoresInvertColors = true
defer { defer {
avatarConfigurableView(self, didFinishConfiguration: configuration) avatarConfigurableView(self, didFinishConfiguration: configuration)
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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