Skip to content

Commit 86f74ab

Browse files
authored
Fix UI overlap and padding issues (#224)
* ui progress fixed take 1 * Deleted comments Deleted comments to clean up code! * Updated Change Date Button Constraints Shrunk fixed button width and shrunk Calendar icon frame to show the full "Closed Today," and shrunk the right button inset to make Change Date button insets more even * Deleted Comment * Create Constant for Bottom Padding Total is 108
1 parent 1da0fe1 commit 86f74ab

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

Eatery Blue/UI/EateryScreen/MenuHeaderView.swift

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,17 @@ class MenuHeaderView: UIView {
6464
private func setUpButtonImageView() {
6565
buttonView.backgroundColor = UIColor.Eatery.gray00
6666
buttonView.layer.cornerRadius = 21
67-
buttonView.layoutMargins = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 16)
67+
buttonView.layoutMargins = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 14)
68+
let imageView = UIImageView()
69+
imageView.image = UIImage(named: "EateryCalendar")
70+
imageView.contentMode = .center
71+
72+
buttonView.addSubview(imageView)
73+
imageView.snp.makeConstraints { make in
74+
make.width.height.equalTo(36)
75+
make.leading.equalTo(buttonView.layoutMarginsGuide)
76+
make.centerY.equalTo(buttonView)
77+
}
6878

6979
let titleLabel = UILabel()
7080
titleLabel.text = "Change Date"
@@ -73,18 +83,8 @@ class MenuHeaderView: UIView {
7383

7484
buttonView.addSubview(titleLabel)
7585
titleLabel.snp.makeConstraints { make in
76-
make.trailing.equalTo(buttonView.layoutMarginsGuide)
77-
make.centerY.equalTo(buttonView)
78-
}
79-
80-
let imageView = UIImageView()
81-
imageView.image = UIImage(named: "EateryCalendar")
82-
imageView.contentMode = .center
83-
84-
buttonView.addSubview(imageView)
85-
imageView.snp.makeConstraints { make in
86-
make.width.height.equalTo(40)
87-
make.leading.equalTo(buttonView.layoutMarginsGuide)
86+
make.leading.equalTo(imageView.snp.trailing)
87+
make.trailing.lessThanOrEqualTo(buttonView.layoutMarginsGuide)
8888
make.centerY.equalTo(buttonView)
8989
}
9090

@@ -102,6 +102,7 @@ class MenuHeaderView: UIView {
102102
private func setUpConstraints() {
103103
titleLabel.snp.makeConstraints { make in
104104
make.top.leading.equalTo(layoutMarginsGuide)
105+
make.trailing.lessThanOrEqualTo(buttonView.snp.leading)
105106
}
106107

107108
subtitleLabel.snp.makeConstraints { make in

Eatery Blue/UI/HomeScreen/HomeViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class HomeViewController: UIViewController {
4646
static let loadingHeaderHeight: CGFloat = maxHeaderHeight + 52
4747
static let collectionViewTopPadding: CGFloat = 8
4848
static let collectionViewSectionPadding: CGFloat = 16
49+
static let collectionViewBottomPadding: CGFloat = 25
4950
static let isTesting = false
5051
}
5152

@@ -121,7 +122,8 @@ class HomeViewController: UIViewController {
121122
collectionView.backgroundColor = UIColor.Eatery.surface
122123
collectionView.contentInsetAdjustmentBehavior = .never
123124
collectionView.delegate = self
124-
collectionView.contentInset.bottom = tabBarController?.tabBar.frame.height ?? 0
125+
collectionView.contentInset.bottom = (tabBarController?.tabBar.frame.height ?? 0) + Constants
126+
.collectionViewBottomPadding
125127
collectionView.showsVerticalScrollIndicator = false
126128

127129
collectionView.register(

0 commit comments

Comments
 (0)