Temporary fix for glitch, TODO: remove push up animation

This commit is contained in:
Hariharan Mudaliar 2025-11-26 22:40:23 +05:30
commit 80d132a85f
5 changed files with 177 additions and 64 deletions

View file

@ -17,6 +17,8 @@ let batterySneakSize: CGSize = .init(width: 160, height: 1)
let openNotchSize: CGSize = .init(width: 640, height: 190)
private let minimalisticBaseOpenNotchSize: CGSize = .init(width: 420, height: 180)
private let minimalisticLyricsExtraHeight: CGFloat = 40
let statsSecondRowContentHeight: CGFloat = 120
let statsGridSpacingHeight: CGFloat = 12
@MainActor
var minimalisticOpenNotchSize: CGSize {
@ -37,6 +39,38 @@ var minimalisticOpenNotchSize: CGSize {
let cornerRadiusInsets: (opened: (top: CGFloat, bottom: CGFloat), closed: (top: CGFloat, bottom: CGFloat)) = (opened: (top: 19, bottom: 24), closed: (top: 6, bottom: 14))
let minimalisticCornerRadiusInsets: (opened: (top: CGFloat, bottom: CGFloat), closed: (top: CGFloat, bottom: CGFloat)) = (opened: (top: 35, bottom: 35), closed: cornerRadiusInsets.closed)
func statsAdjustedNotchSize(
from baseSize: CGSize,
isStatsTabActive: Bool,
secondRowProgress: CGFloat
) -> CGSize {
guard isStatsTabActive, Defaults[.enableStatsFeature] else {
return baseSize
}
let enabledGraphsCount = [
Defaults[.showCpuGraph],
Defaults[.showMemoryGraph],
Defaults[.showGpuGraph],
Defaults[.showNetworkGraph],
Defaults[.showDiskGraph]
].filter { $0 }.count
guard enabledGraphsCount >= 4 else {
return baseSize
}
let clampedProgress = max(0, min(secondRowProgress, 1))
guard clampedProgress > 0 else {
return baseSize
}
var adjustedSize = baseSize
let extraHeight = (statsSecondRowContentHeight + statsGridSpacingHeight) * clampedProgress
adjustedSize.height += extraHeight
return adjustedSize
}
enum MusicPlayerImageSizes {
static let cornerRadiusInset: (opened: CGFloat, closed: CGFloat) = (opened: 13.0, closed: 4.0)
static let size = (opened: CGSize(width: 90, height: 90), closed: CGSize(width: 20, height: 20))