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
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct CardFullWidthSingleButtonExample: View {
}

var body: some View {
ScrollView {
List {
Section {
Divider()
HStack {
Expand Down Expand Up @@ -119,7 +119,7 @@ struct CardFullWidthSingleButtonExample: View {
.padding(.horizontal, 16)
} else {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 0) {
HStack(spacing: 8) {
ForEach(0 ..< self._dataSource.count, id: \.self) { index in
let item = self._dataSource[index]
self.cardView(for: item)
Expand All @@ -139,9 +139,12 @@ struct CardFullWidthSingleButtonExample: View {
.padding()
.background(Color.preferredColor(.secondaryGroupedBackground))
}
.navigationTitle("Object Card - Full Width Single Button")
.navigationBarTitleDisplayMode(.inline)
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
.listRowSeparator(.hidden)
}
.listStyle(.grouped)
.navigationTitle("Object Card - Full Width Single Button")
.navigationBarTitleDisplayMode(.inline)
}

@ViewBuilder
Expand All @@ -165,11 +168,13 @@ struct CardFullWidthSingleButtonExample: View {
self.updateDataSource(id: item.id)
}, label: { _ in
Text(self.titleStr(item.loadingState))
.multilineTextAlignment(.center)
})
.fioriButtonStyle(FioriPrimaryButtonStyle(.infinity, loadingState: item.loadingState))
.disabled(item.loadingState != .unspecified)
}
.frame(width: 300, height: 192)
.frame(width: 300)
.fixedSize(horizontal: false, vertical: true)
.background(Color.white)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private struct CardFooterLayout: Layout {
cache.clear()

let subViewSizes = subviews.reversed().map {
$0.sizeThatFits(.unspecified)
$0.sizeThatFits(proposal)
}

self.calculateLayout(proposalWidth: proposal.width, subViewSizes: subViewSizes, layoutMode: layoutMode, cache: &cache)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public struct ProfileHeaderBaseStyle: ProfileHeaderStyle {
}
}
})
.frame(maxWidth: .infinity)
}
}

Expand Down Expand Up @@ -155,29 +156,37 @@ public struct ProfileHeaderBaseStyle: ProfileHeaderStyle {
self.detailImage(configuration)
VStack(alignment: .leading, spacing: 8 * oppositeValue) {
configuration.title
.fixedSize(horizontal: false, vertical: true)
.sizeReader(size: { size in
if size.different(with: self.titleSize) {
self.titleSize = size
}
})
ZStack {
self.subtitle(configuration)
.fixedSize(horizontal: false, vertical: true)
.opacity(oppositeValue)
.padding(.top, self.subtitlePadding(configuration))
}
.clipped()
.padding(.top, -8 * validTransitionValue)
}
.frame(maxWidth: .infinity)

Spacer()
if !configuration.description.isEmpty, validTransitionValue < 1 {
configuration.description
.fixedSize(horizontal: false, vertical: true)
.opacity(oppositeValue)
.frame(maxWidth: .infinity)
Spacer()
}
if !configuration.detailContent.isEmpty {
configuration.detailContent
.frame(maxWidth: .infinity)
}
}
.padding(.horizontal)
}

private func titlePadding(_ configuration: ProfileHeaderConfiguration) -> CGFloat {
Expand Down
Loading