Skip to content

Commit

Permalink
added large custom view to testapp
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabil Khalil committed Jan 14, 2025
1 parent 85ed4b7 commit 8ed1517
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ extension TableViewCellDemoController {
cell.bottomSeparatorType = .inset
}

if let customViewSize = section.customViewSize {
cell.customViewSize = customViewSize
}

cell.isInSelectionMode = section.allowsMultipleSelection ? isInSelectionMode : false

cell.tokenSet.replaceAllOverrides(with: overrideTokens)
Expand Down
11 changes: 11 additions & 0 deletions Demos/FluentUIDemo_iOS/FluentUI.Demo/TableViewCellSampleData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ class TableViewCellSampleData: TableViewSampleData {
],
hasFullLengthLabelAccessoryView: true
),
Section(
title: "Cell with large custom view",
items: [
Item(text1: "Contoso Survey",
text2: "Research Notes",
image: "excelIcon",
text2LeadingAccessoryView: { createIconsAccessoryView(images: ["ic_fluent_share_20_regular", "ic_fluent_lock_closed_20_regular"]) })
],
isUnreadDotVisible: true,
customViewSize: .large
),
Section(
title: "Cell without custom view",
items: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TableViewSampleData {
let hasCustomAccessoryView: Bool
let hasCustomLeadingView: Bool
let hasHandler: Bool
let customViewSize: MSFTableViewCellCustomViewSize?

init(title: String,
items: [Item] = [],
Expand All @@ -41,7 +42,8 @@ class TableViewSampleData {
hasCustomLinkHandler: Bool = false,
hasCustomAccessoryView: Bool = false,
hasCustomLeadingView: Bool = false,
hasHandler: Bool = false) {
hasHandler: Bool = false,
customViewSize: MSFTableViewCellCustomViewSize? = nil) {
self.title = title
self.items = items
self.isUnreadDotVisible = isUnreadDotVisible
Expand All @@ -58,6 +60,7 @@ class TableViewSampleData {
self.hasCustomAccessoryView = hasCustomAccessoryView
self.hasCustomLeadingView = hasCustomLeadingView
self.hasHandler = hasHandler
self.customViewSize = customViewSize
}
}

Expand Down

0 comments on commit 8ed1517

Please sign in to comment.