This commit is contained in:
DDIsFriend
2023-08-23 09:24:40 +08:00
parent 6bd037c5dd
commit 63ca919ed5
494 changed files with 35308 additions and 6623 deletions

View File

@@ -57,6 +57,92 @@ open class Entry {
SwiftEntryKit.display(entry: view, using: attributes)
}
func showAppUpdateEntry(view:UIView,name:String? = nil) {
var attributes = EKAttributes()
attributes = .centerFloat
attributes.name = name
attributes.precedence = .override(priority: .high, dropEnqueuedEntries: false)
attributes.displayMode = .inferred
attributes.displayDuration = .infinity
attributes.screenBackground = .color(color: .clear)
attributes.entryBackground = .color(color: .white)
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: .constant(value: auto(326)),
height: .constant(value: auto(285))
)
attributes.positionConstraints.verticalOffset = 0
attributes.positionConstraints.safeArea = .overridden
attributes.statusBar = .light
SwiftEntryKit.display(entry: view, using: attributes)
}
func showNotificationAuthEntry(view:UIView,name:String? = nil) {
var attributes = EKAttributes()
attributes = .centerFloat
attributes.name = name
attributes.precedence = .override(priority: .low, dropEnqueuedEntries: false)
attributes.displayMode = .inferred
attributes.displayDuration = .infinity
attributes.screenBackground = .color(color: .clear)
attributes.entryBackground = .color(color: .white)
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: .constant(value: auto(280)),
height: .constant(value: auto(130))
)
attributes.positionConstraints.verticalOffset = 0
attributes.positionConstraints.safeArea = .overridden
attributes.statusBar = .light
SwiftEntryKit.display(entry: view, using: attributes)
}
public func isCurrentlyDisplaying(entryNamed name: String? = nil) -> Bool {
return SwiftEntryKit.isCurrentlyDisplaying(entryNamed: name)
}