Skip to content

Commit

Permalink
added configuration parameter to automatically expand the Quick Acces…
Browse files Browse the repository at this point in the history
…s folder in the share sheet picker view
  • Loading branch information
hosy committed Nov 20, 2023
1 parent fe051c2 commit b37f301
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class AccountController: NSObject, OCDataItem, OCDataItemVersioning, Acco
public var showQuickAccess: Bool
public var showActivity: Bool
public var autoSelectPersonalFolder: Bool
public var expandQuickAccess: Bool

public var sectionAppearance: UICollectionLayoutListConfiguration.Appearance = .sidebar

Expand All @@ -50,6 +51,7 @@ public class AccountController: NSObject, OCDataItem, OCDataItemVersioning, Acco
config.showSavedSearches = true
config.showQuickAccess = true
config.showActivity = false
config.expandQuickAccess = true

config.sectionAppearance = .insetGrouped

Expand All @@ -64,6 +66,7 @@ public class AccountController: NSObject, OCDataItem, OCDataItemVersioning, Acco
showSavedSearches = true
showQuickAccess = true
showActivity = true
expandQuickAccess = false

autoSelectPersonalFolder = true
}
Expand Down Expand Up @@ -472,6 +475,11 @@ public class AccountController: NSObject, OCDataItem, OCDataItemVersioning, Acco
if let quickAccessFolderDataSource = specialItemsDataSources[.quickAccessFolder] {
sources.append(quickAccessFolderDataSource)
}

if configuration.expandQuickAccess, let accountControllerSection = accountControllerSection,
let expandedItemRefs = accountControllerSection.collectionViewController?.wrap(references: [ specialItemsDataReferences[.quickAccessFolder]! ], forSection: accountControllerSection.identifier) {
accountControllerSection.expandedItemRefs = expandedItemRefs
}
}

// Extra items (Activity & Co via class extension in the app)
Expand Down

0 comments on commit b37f301

Please sign in to comment.