Skip to content

Commit

Permalink
Adjust video buttons size by design
Browse files Browse the repository at this point in the history
  • Loading branch information
aseren committed Apr 10, 2024
1 parent 21c90e0 commit 2401e18
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand All @@ -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
}
Expand All @@ -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))
}
}
Expand Down

0 comments on commit 2401e18

Please sign in to comment.