Skip to content

Commit

Permalink
feat(Sheet): IOS-10691 add separators to the sheet informative list
Browse files Browse the repository at this point in the history
* IOS-10691 add separators to the sheet informative list and adjusted margins

* IOS-10691 implement method to add rows with optional separators to the stack view

* Run swiftformat

* Record screenshots automatically launched from GH action

---------

Co-authored-by: L-Trujillo26 <L-Trujillo26@users.noreply.github.com>
  • Loading branch information
L-Trujillo26 and L-Trujillo26 authored Dec 4, 2024
1 parent 7f3620b commit d093f1f
Show file tree
Hide file tree
Showing 82 changed files with 29 additions and 13 deletions.
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.

0 comments on commit d093f1f

Please sign in to comment.