筛选功能约束问题

This commit is contained in:
DDIsFriend
2024-01-04 18:13:24 +08:00
parent 91b99671f3
commit 8661e027d0
23 changed files with 750 additions and 490 deletions

View File

@@ -449,50 +449,51 @@ open class Entry {
attributes.statusBar = .light
SwiftEntryKit.display(entry: view, using: attributes)
}
func showSearchEntry(view: UIView, name: String? = nil) {
var attributes = EKAttributes()
attributes = .bottomFloat
attributes.name = name
attributes.precedence = .override(priority: .min, dropEnqueuedEntries: false)
attributes.displayMode = .inferred
attributes.displayDuration = .infinity
attributes.screenBackground = .color(color: .black.with(alpha: 0.3))
attributes.entryBackground = .color(color: .clear)
attributes.screenInteraction = .absorbTouches
attributes.entryInteraction = .absorbTouches
attributes.scroll = .disabled
attributes.entranceAnimation = .init(
translate: .init(
duration: 0.25,
spring: .init(damping: 1, initialVelocity: 0)
)
)
attributes.exitAnimation = .init(
translate: .init(duration: 0.25)
)
attributes.popBehavior = .animated(
animation: .init(
translate: .init(duration: 0.25)
)
)
attributes.shadow = .active(
with: .init(
color: .black,
opacity: 0.3,
radius: 6
)
)
attributes.positionConstraints.size = .init(
width: .fill,
height: .constant(value: auto(500))
)
attributes.positionConstraints.verticalOffset = 0
attributes.positionConstraints.safeArea = .overridden
attributes.positionConstraints.rotation.isEnabled = false
attributes.statusBar = .light
SwiftEntryKit.display(entry: view, using: attributes)
}
//
// func showSearchEntry(view: UIView, name: String? = nil) {
// var attributes = EKAttributes()
// attributes = .topToast
// attributes.name = name
// attributes.precedence = .override(priority: .min, dropEnqueuedEntries: false)
// attributes.displayMode = .inferred
// attributes.displayDuration = .infinity
// attributes.screenBackground = .color(color: .black.with(alpha: 0.3))
// attributes.entryBackground = .color(color: .clear)
// attributes.screenInteraction = .absorbTouches
// attributes.entryInteraction = .absorbTouches
// attributes.scroll = .disabled
// attributes.entranceAnimation = .init(
// translate: .init(
// duration: 0.25,
// spring: .init(damping: 1, initialVelocity: 0)
// )
// )
// attributes.exitAnimation = .init(
// translate: .init(duration: 0.25)
// )
// attributes.popBehavior = .animated(
// animation: .init(
// translate: .init(duration: 0.25)
// )
// )
// attributes.shadow = .active(
// with: .init(
// color: .black,
// opacity: 0.3,
// radius: 6
// )
// )
// attributes.positionConstraints.size = .init(
// width: .fill,
// height: .constant(value: auto(500))
// )
// attributes.positionConstraints.verticalOffset = 0
// attributes.positionConstraints.safeArea = .empty(fillSafeArea: false)
// attributes.positionConstraints.verticalOffset = 44 + auto(44)
// attributes.positionConstraints.rotation.isEnabled = false
// attributes.statusBar = .light
// SwiftEntryKit.display(entry: view, using: attributes, presentInsideKeyWindow: true)
// }
public func isCurrentlyDisplaying(entryNamed name: String? = nil) -> Bool {
return SwiftEntryKit.isCurrentlyDisplaying(entryNamed: name)