From 2401e18da6525484bb0e2972e6071c9e4c9d22e9 Mon Sep 17 00:00:00 2001 From: Aleksey Seren Date: Wed, 10 Apr 2024 11:04:41 -0500 Subject: [PATCH] Adjust video buttons size by design --- .../Backgrounds/NewTabPageBackgroundButtonsView.swift | 3 ++- .../Backgrounds/NewTabPageBackgroundView.swift | 2 +- .../Backgrounds/NewTabPageVideoButtonsView.swift | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift index 18d625107e19..f5af2d485415 100644 --- a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift +++ b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundButtonsView.swift @@ -306,8 +306,9 @@ extension NewTabPageBackgroundButtonsView { backgroundView.snp.makeConstraints { $0.edges.equalToSuperview() } - imageView.snp.makeConstraints { + $0.width.equalTo(40) + $0.height.equalTo(40) $0.edges.equalToSuperview().inset(UIEdgeInsets(equalInset: 10)) } } diff --git a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundView.swift b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundView.swift index 3035f859d9ae..f56cde20ee4b 100644 --- a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundView.swift +++ b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageBackgroundView.swift @@ -28,7 +28,7 @@ class NewTabPageBackgroundView: UIView { ) let resizeToFill = shouldResizeToFill(filename: backgroundVideoPath.lastPathComponent) - if resizeToFill && UIDevice.isPhone { + if resizeToFill { playerLayer.videoGravity = .resizeAspectFill } else { playerLayer.videoGravity = .resizeAspect diff --git a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageVideoButtonsView.swift b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageVideoButtonsView.swift index 77150d87e6b8..e94558e9d025 100644 --- a/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageVideoButtonsView.swift +++ b/ios/brave-ios/Sources/Brave/Frontend/Browser/New Tab Page/Backgrounds/NewTabPageVideoButtonsView.swift @@ -134,8 +134,9 @@ extension NewTabPageVideoButtonsView { backgroundView.snp.makeConstraints { $0.edges.equalToSuperview() } - imageView.snp.makeConstraints { + $0.width.equalTo(16) + $0.height.equalTo(16) $0.edges.equalToSuperview().inset(UIEdgeInsets(equalInset: 4)) } } @@ -154,7 +155,7 @@ extension NewTabPageVideoButtonsView { $0.clipsToBounds = true $0.isUserInteractionEnabled = false } - private var imageView = UIImageView().then { + private let imageView = UIImageView().then { $0.tintColor = .white $0.contentMode = .scaleAspectFit } @@ -171,8 +172,9 @@ extension NewTabPageVideoButtonsView { backgroundView.snp.makeConstraints { $0.edges.equalToSuperview() } - imageView.snp.makeConstraints { + $0.width.equalTo(40) + $0.height.equalTo(40) $0.edges.equalToSuperview().inset(UIEdgeInsets(equalInset: 10)) } }