Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Improvements: Improved Animations & Blur, Fixed Notch Shape, and more! #223

Open
wants to merge 61 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a896a8e
Placeholder provided by media player
overflow-sudo Nov 3, 2024
a1a2ecc
Merge branch 'main' into feature/Emir
overflow-sudo Nov 3, 2024
4a8bab4
Merge pull request #184 from overflow-sudo/feature/Emir
richardkunkli Nov 3, 2024
9e8c61e
rewrite logic for detirmining when to change album art and when to us…
Alexander5015 Nov 5, 2024
eba05b6
Modify MusicSliderView to display hours if applicable
Alexander5015 Nov 5, 2024
e298d12
Initial attempt at debouncing the album artwork
Alexander5015 Nov 5, 2024
ae22f7b
Hide mini app icon when app icon is being used for artwork
Alexander5015 Nov 5, 2024
364c713
Prefer parent identifier to child identifier
Alexander5015 Nov 5, 2024
2c43282
Use the isPlaying function rather than guessing based on playback rat…
Alexander5015 Nov 7, 2024
c8dc21f
Prevent crashes due to non-finite duration
Alexander5015 Nov 7, 2024
b93cf77
Remove old debug print statements
Alexander5015 Nov 7, 2024
e849d80
adjust states inside thread for new playing detection
Alexander5015 Nov 7, 2024
c5b22fe
Update bundle identifier logic for more accurate icon
Alexander5015 Nov 7, 2024
fe1cbc6
allow timeline to update while paused, for the case when the back ski…
Alexander5015 Nov 7, 2024
333f490
More fixes
Alexander5015 Nov 7, 2024
5b4a528
added shortcut ability to toggle notch open
freepicheep Nov 7, 2024
2a90517
Merge pull request #191 from freepicheep/open-notch-shortcut
Alexander5015 Nov 10, 2024
5da97ae
Merge branch 'dev' into fix-album-art-and-timeline
Alexander5015 Nov 10, 2024
4951d7d
Merge pull request #190 from Alexander5015/fix-album-art-and-timeline
Alexander5015 Nov 10, 2024
d0c2dce
Remove condition for all-day events to only be one day events and spl…
Alexander5015 Nov 10, 2024
b0d5ed4
Merge pull request #198 from Alexander5015/fix-calendar-formatting
Alexander5015 Nov 10, 2024
c82a9cb
Dynamically change settings views based on preferences and fix deprec…
Alexander5015 Nov 17, 2024
2243996
modify screen lock monitoring
Alexander5015 Nov 18, 2024
b292c2f
temporary fix for repositioning problems
Alexander5015 Nov 18, 2024
b3f1603
Changed selectedScreen to preferredScreen and added a seperate select…
Alexander5015 Nov 18, 2024
98c9a89
Add a Default Key and settings for show on all displays
Alexander5015 Nov 18, 2024
722e1c3
Add all displays as a beta feature
Alexander5015 Nov 19, 2024
40de875
Better sneak peek logic for song change and ignoring empty entries
Alexander5015 Nov 20, 2024
0aee66b
update timeline slider logic for better behaviour when paused
Alexander5015 Nov 20, 2024
21e755c
Merge pull request #218 from Alexander5015/settings-fixes
Alexander5015 Nov 20, 2024
479a189
Merge pull request #217 from Alexander5015/fix-sneak-peek
Alexander5015 Nov 20, 2024
1883459
Merge branch 'dev' into multiple-display-improvements
Alexander5015 Nov 20, 2024
b2d0eb6
Refactor the code by transferring certain elements from BoringViewMod…
Alexander5015 Nov 21, 2024
266a2d7
Use new BoringView Coordinator, refactor matters.swift and sizes, and…
Alexander5015 Nov 21, 2024
99d83f5
Move BoringViewCoordinator into folder
Alexander5015 Nov 21, 2024
c28e6a8
Add the option to customize the size of the notch window on notched s…
Alexander5015 Nov 21, 2024
46f12d1
settings resize changes
Alexander5015 Nov 21, 2024
df57d05
add opactity and blur to NotchHomeView
Alexander5015 Nov 21, 2024
bc5ad59
Merge pull request #221 from Alexander5015/multiple-display-improvements
Alexander5015 Nov 21, 2024
743900d
Added Blur Effect to Text when expanding Notch
OmChachad Nov 22, 2024
7de2cf7
Added Matched Geometry Effect to Spectrum
OmChachad Nov 22, 2024
6c65ede
Added Blur Effect to Notch Opening
OmChachad Nov 22, 2024
a4c1e0c
Notch Open Animation Updated to Mimic iOS Behavior
OmChachad Nov 22, 2024
4a0cf2f
Improved Animations
OmChachad Nov 22, 2024
68874ea
Reduced Blur Spread to Prevent Interference with Physical Notch
OmChachad Nov 22, 2024
eeb0eff
Fixed Uneven Corner Radii, Added Continous Radius
OmChachad Nov 22, 2024
6afe878
Reduced Blur Delay
OmChachad Nov 22, 2024
e390d1d
Added Safe Area for Hover Zone
OmChachad Nov 22, 2024
210cd12
Removed Excess Horizontal Padding, Corner Radius now matches.
OmChachad Nov 23, 2024
817953c
Artwork now shrinks when paused
OmChachad Nov 23, 2024
e370737
Improved Slider Responsiveness
OmChachad Nov 23, 2024
83d34d2
Reduced Padding between Song Name and Artist Name
OmChachad Nov 23, 2024
6bf83f1
Increased Play Button Size
OmChachad Nov 23, 2024
4176e1b
Added Move Transition and Enhanced Blur Effect
OmChachad Nov 23, 2024
ae36811
Revert "Added Move Transition and Enhanced Blur Effect"
OmChachad Nov 23, 2024
1f85fcd
Merge branch 'main' into dev
Alexander5015 Nov 23, 2024
3498323
Merge branch 'dev' into main
OmChachad Nov 24, 2024
843d6a2
Fixed Compiling Error
OmChachad Nov 24, 2024
3414896
Further Enhancements to Blur Animation
OmChachad Nov 24, 2024
3302b9f
Merge branch 'dev' into main
OmChachad Nov 29, 2024
6c9e990
Fixed Runtime Error
OmChachad Nov 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion boringNotch/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ struct ContentView: View {
var body: some View {
ZStack(alignment: .top) {
NotchLayout()
.padding(.horizontal, vm.notchState == .open ? Defaults[.cornerRadiusScaling] ? (cornerRadiusInsets.opened) : (cornerRadiusInsets.closed - 5) : 12)
.padding(.horizontal, vm.notchState == .open ? Defaults[.cornerRadiusScaling] ? (cornerRadiusInsets.opened - 5) : (cornerRadiusInsets.closed - 5) : 12)
.padding([.horizontal, .bottom], vm.notchState == .open ? 12 : 0)
.frame(maxWidth: (((musicManager.isPlaying || !musicManager.isPlayerIdle) && vm.notchState == .closed && coordinator.showMusicLiveActivityOnClosed) || (vm.expandingView.show && (vm.expandingView.type == .battery)) || Defaults[.inlineHUD]) ? nil : vm.notchSize.width + ((hoverAnimation || (vm.notchState == .closed)) ? 20 : 0) + gestureProgress, maxHeight: ((coordinator.sneakPeek.show && coordinator.sneakPeek.type != .music) || (coordinator.sneakPeek.show && coordinator.sneakPeek.type == .music && vm.notchState == .closed)) ? nil : vm.notchSize.height + (hoverAnimation ? 8 : 0) + gestureProgress / 3, alignment: .top)
.background(.black)
.mask {
NotchShape(cornerRadius: ((vm.notchState == .open) && Defaults[.cornerRadiusScaling]) ? cornerRadiusInsets.opened : cornerRadiusInsets.closed)
}
.frame(width: vm.notchState == .closed ? (((musicManager.isPlaying || !musicManager.isPlayerIdle) && coordinator.showMusicLiveActivityOnClosed) || (vm.expandingView.show && (vm.expandingView.type == .battery)) || (Defaults[.inlineHUD] && coordinator.sneakPeek.show && coordinator.sneakPeek.type != .music)) ? nil : vm.closedNotchSize.width + (hoverAnimation ? 20 : 0) + gestureProgress : nil, height: vm.notchState == .closed ? vm.closedNotchSize.height + (hoverAnimation ? 8 : 0) + gestureProgress / 3 : nil, alignment: .top)
.padding(.bottom, vm.notchState == .open ? 30 : 0) // Safe area to ensure the notch does not close if the cursor is within 30px of the notch from the bottom.
.conditionalModifier(Defaults[.openNotchOnHover]) { view in
view
.onHover { hovering in
Expand Down Expand Up @@ -284,6 +285,7 @@ struct ContentView: View {
)
.clipped()
.clipShape(RoundedRectangle(cornerRadius: MusicPlayerImageSizes.cornerRadiusInset.closed))
.opacity(musicManager.isPlaying ? 1 : 0.4)
.matchedGeometryEffect(id: "albumArt", in: albumArtNamespace)
.frame(width: max(0, vm.closedNotchSize.height - 12), height: max(0, vm.closedNotchSize.height - 12))
}
Expand All @@ -303,6 +305,7 @@ struct ContentView: View {
)
.frame(width: 16, height: 12)
}
.matchedGeometryEffect(id: "spectrum", in: albumArtNamespace)
} else {
LottieAnimationView()
.frame(maxWidth: .infinity, maxHeight: .infinity)
Expand Down
11 changes: 7 additions & 4 deletions boringNotch/components/HoverButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@ import SwiftUI
struct HoverButton: View {
var icon: String
var iconColor: Color = .white;
var scale: Image.Scale = .medium
var action: () -> Void
var contentTransition: ContentTransition = .symbolEffect;

@State private var isHovering = false

var body: some View {
let size = CGFloat(scale == .large ? 40 : 30)

Button(action: action) {
Rectangle()
.fill(.clear)
.contentShape(Rectangle())
.frame(width: 30, height: 30)
.frame(width: size, height: size)
.overlay {
Capsule()
.fill(isHovering ? Color.gray.opacity(0.3) : .clear)
.frame(width: 30, height: 30)
.fill(isHovering ? Color.gray.opacity(0.2) : .clear)
.frame(width: size, height: size)
.overlay {
Image(systemName: icon)
.foregroundColor(iconColor)
.contentTransition(contentTransition)
.imageScale(.medium)
.font(scale == .large ? .largeTitle : .body)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions boringNotch/components/Notch/BoringHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct BoringHeader: View {
.frame(maxWidth: .infinity, alignment: .leading)
.opacity(vm.notchState == .closed ? 0 : 1)
.blur(radius: vm.notchState == .closed ? 20 : 0)
.animation(.smooth.delay(0.2), value: vm.notchState)
.animation(.smooth.delay(0.1), value: vm.notchState)
.zIndex(2)

if vm.notchState == .open {
Expand Down Expand Up @@ -67,7 +67,7 @@ struct BoringHeader: View {
.frame(maxWidth: .infinity, alignment: .trailing)
.opacity(vm.notchState == .closed ? 0 : 1)
.blur(radius: vm.notchState == .closed ? 20 : 0)
.animation(.smooth.delay(0.2), value: vm.notchState)
.animation(.smooth.delay(0.1), value: vm.notchState)
.zIndex(2)
}
.foregroundColor(.gray)
Expand Down
4 changes: 2 additions & 2 deletions boringNotch/components/Notch/NotchContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct NotchContentView: View {
VStack(alignment: coordinator.firstLaunch ? .center : .leading, spacing: 0) {
if vm.notchState == .open {
BoringHeader()
.animation(.spring(response: 0.7, dampingFraction: 0.8, blendDuration: 0.8), value: vm.notchState)
.animation(.spring(response: 1, dampingFraction: 1, blendDuration: 0.8), value: vm.notchState)
.padding(.top, 10)
if coordinator.firstLaunch {
Spacer()
Expand Down Expand Up @@ -118,7 +118,7 @@ struct NotchContentView: View {
}
}
.frame(width: calculateFrameWidthforNotchContent())
.transition(.blurReplace.animation(.spring(.bouncy(duration: 0.5))))
.transition(.blurReplace.animation(.interactiveSpring(dampingFraction: 1)))
}

func calculateFrameWidthforNotchContent() -> CGFloat? {
Expand Down
Loading