Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iBox/Sources/BoxList/AddBookmark/AddBookmarkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ class AddBookmarkView: UIView {
buttonLabel.snp.makeConstraints { make in
make.leading.equalTo(button.snp.leading).offset(20)
make.centerY.equalTo(button.snp.centerY)
make.width.equalTo(40)
make.height.equalTo(40)
}

selectedFolderLabel.snp.makeConstraints { make in
make.leading.equalTo(buttonLabel.snp.trailing).offset(10)
make.trailing.equalTo(chevronImageView.snp.leading).offset(-10)
make.centerY.equalTo(button.snp.centerY)
make.height.equalTo(40)
Expand Down
14 changes: 7 additions & 7 deletions iBox/Sources/BoxList/AddBookmark/FolderListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ class FolderListCell: UITableViewCell {
make.bottom.lessThanOrEqualToSuperview().offset(-10)
}

checkImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.trailing.equalToSuperview().offset(-20)
make.width.height.equalTo(24)
}

folderNameLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalTo(folderImageView.snp.trailing).offset(10)
make.trailing.lessThanOrEqualToSuperview().offset(-20)
make.trailing.equalTo(checkImageView.snp.leading).offset(-10)
make.top.greaterThanOrEqualToSuperview().offset(10)
make.bottom.lessThanOrEqualToSuperview().offset(-10)
}

checkImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.trailing.equalToSuperview().offset(-20)
make.width.height.equalTo(24)
}
}

func configureWith(folder: Folder, isSelected: Bool) {
Expand Down
21 changes: 19 additions & 2 deletions iBox/Sources/BoxList/BoxListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ class BoxListCell: UITableViewCell {
}

label.snp.makeConstraints { make in
make.top.trailing.bottom.equalToSuperview()
make.top.bottom.equalToSuperview()
make.trailing.equalToSuperview().inset(25)
make.leading.equalTo(cellImageView.snp.trailing).offset(10)
}
editButton.snp.makeConstraints { make in
make.top.bottom.trailing.equalToSuperview()
make.width.equalTo(30)
make.top.bottom.equalToSuperview()
make.trailing.equalToSuperview().offset(-10)
}
}

Expand All @@ -106,6 +109,20 @@ class BoxListCell: UITableViewCell {

func setEditButtonHidden(_ isHidden: Bool) {
editButton.isHidden = isHidden

if isHidden {
label.snp.remakeConstraints { make in
make.top.bottom.equalToSuperview()
make.trailing.equalToSuperview().inset(25)
make.leading.equalTo(cellImageView.snp.trailing).offset(10)
}
} else {
label.snp.remakeConstraints { make in
make.top.bottom.equalToSuperview()
make.trailing.equalTo(editButton.snp.leading).offset(-5)
make.leading.equalTo(cellImageView.snp.trailing).offset(10)
}
}
}

}
2 changes: 1 addition & 1 deletion iBox/Sources/BoxList/BoxListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ extension BoxListView: UITableViewDelegate {
make.top.bottom.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(15)
}
view.backgroundColor = .backgroundColor
view.backgroundColor = .tableViewBackgroundColor
line.backgroundColor = .quaternaryLabel
return view
}
Expand Down
19 changes: 15 additions & 4 deletions iBox/Sources/BoxList/EditFolder/EditFolderCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class EditFolderCell: UITableViewCell {
var onDelete: (() -> Void)?
var onEdit: (() -> Void)?

private let containerView = UIView()

private let folderView = FolderView()

private let editButton = UIButton().then{
Expand Down Expand Up @@ -53,16 +55,25 @@ class EditFolderCell: UITableViewCell {
}

private func setupHierarchy() {
contentView.addSubview(folderView)
folderView.addSubview(editButton)
contentView.addSubview(containerView)
containerView.addSubview(folderView)
containerView.addSubview(editButton)
}

private func setupLayout() {
folderView.snp.makeConstraints { make in
containerView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}

editButton.snp.makeConstraints { make in
make.top.bottom.trailing.equalToSuperview()
make.top.bottom.equalToSuperview()
make.trailing.equalToSuperview().offset(-10)
make.width.equalTo(30)
}

folderView.snp.makeConstraints { make in
make.top.bottom.leading.equalToSuperview()
make.trailing.equalTo(editButton.snp.leading)
}
}

Expand Down
10 changes: 6 additions & 4 deletions iBox/Sources/BoxList/FolderButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ class FolderButton: UIButton {
}

private func setupLayout() {
folderView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}

openCloseImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.width.height.equalTo(20)
make.trailing.equalToSuperview().offset(-20)
}

folderView.snp.makeConstraints { make in
make.top.bottom.leading.equalToSuperview()
make.trailing.equalTo(openCloseImageView.snp.leading)
}
}

func setFolderName(_ name: String) {
Expand Down
1 change: 1 addition & 0 deletions iBox/Sources/BoxList/FolderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class FolderView: UIView {
folderNameLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalTo(folderImageView.snp.trailing).offset(10)
make.trailing.equalToSuperview().inset(10)
}
}

Expand Down