Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-10691 add separators to the sheet informative list and adjusted m… #416

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ private extension ListFragmentView {
}

func fillListWithInformativeItems(_ items: [InformativeItem]) {
for item in items {
for (index, item) in items.enumerated() {
let rowView = InformativeRow(item: item)
stackView.addArrangedSubview(rowView)
let isLastItem = index == items.count - 1
addRow(rowView, withSeparator: !isLastItem)
}
}

Expand Down Expand Up @@ -129,16 +130,7 @@ private extension ListFragmentView {
self.stackView.addArrangedSubview(stackView)
}

func button(at index: Int, for action: ActionItem) -> Button {
let button = Button(
style: action.style,
title: action.title,
rightImage: action.rightImage
)
button.tag = index
button.addTarget(self, action: #selector(didTap(action:)), for: .touchUpInside)
return button
}
// MARK: User Interaction

@objc private func didTouchItem(_ sender: UILongPressGestureRecognizer) {
guard let touchable = sender.view as? Touchable else { return }
Expand Down Expand Up @@ -207,3 +199,27 @@ extension ListFragmentView: UIGestureRecognizerDelegate {
true
}
}

// MARK: Utilities

private extension ListFragmentView {
func addRow(_ row: UIView, withSeparator: Bool = false) {
stackView.addArrangedSubview(row)

if withSeparator {
let separator = SeparatorView(axis: .horizontal)
stackView.addArrangedSubview(separator)
}
}

func button(at index: Int, for action: ActionItem) -> Button {
let button = Button(
style: action.style,
title: action.title,
rightImage: action.rightImage
)
button.tag = index
button.addTarget(self, action: #selector(didTap(action:)), for: .touchUpInside)
return button
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class InformativeRow: UIView {
stackView.alignment = .leading
stackView.axis = .vertical
stackView.isLayoutMarginsRelativeArrangement = true
stackView.layoutMargins = .init(top: 16, left: 0, bottom: 0, right: 0)
stackView.layoutMargins = .init(top: 16, left: 0, bottom: 16, right: 0)
return stackView
}()

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.