Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
fix: the player closes over one tab bar, and the card moves into the row faster
My-Name-Is-Jeffd7095083ae58
diff --git a/docs/tweaks.md b/docs/tweaks.mdindex 7d6a97cc..1dbe64d3 100644--- a/docs/tweaks.md+++ b/docs/tweaks.md@@ -398,14 +398,16 @@ Redesigned:between them, and a scroll back up, its top, another tab or the player brings it back(TabBarMinimize.x, MinimizeStep.h; the Player page's Apple Music style). Spotify's container is noUITabBarController, so UIKit's tabBarMinimizeBehavior and bottomAccessory cannot do it. The bars,- their circles and the card move as one, on one spring of their own (SGRMotionBar, 0.34 s, no+ their circles and the card move as one, on one spring of their own (SGRMotionBar, 0.26 s, noovershoot; at once under Reduce Motion), from what is on screen, so a change turned back half way- carries on from there. Laid out on+ carries on from there. Each glass tab carries its name for VoiceOver and the large content viewer, labels+ hidden or not, and the leading circle says it shows all tabs. Laid out onthe Mac against harness/tabbar/ (`mini`; a tap on the leading circle `tap`, real flings that turnthe bar half way `turns`, a minimize from inside Spotify's own animations `nested`, every frame ofthe move sampled `motion`), the scroll's steps checked by harness/tabbar/minimize-check.cNowPlayingBar/ the glass now playing bar (NowPlayingBar.x), with Spotify's device button on it hidden on request- (BarConnect.x, its own key and its own row on the Player page, apart from the native look's). In a Jam the+ (BarConnect.x, its own key and its own row on the Player page, apart from the native look's). In the minimized row+ the card drops its device and add buttons, faded out as it heads there and back in as it leaves. In a Jam theglass stays on the track and Spotify's Jam strip gets a pane of its own above it (harness/tabbar/, jam)ContextMenu/ the ⋯ of the player and the ⋯ pinned over the playlist, album and artist pages open the system menu,always (ContextMenu.h). The player's ⋯ is a pull-down button of the mod's over Spotify's: the menu@@ -543,8 +545,9 @@ and Live Activity. The root page in `App/ModSettings.x` links the Appearance pagmake build # out/vitrine-<version>.ipa with FLEX in itmake release # the same without FLEX- make install # build without FLEX, sign with your certificate, install over USB+ make install # build without FLEX, sign with your certificate, install over USB or Wi-Fimake install FLEX=1 # the same with FLEX, which is what make trees reads through+ make quick # rebuild only the tweak into the app the last make install made, sign, install (seconds)make trees # record view trees screen by screen (FLEX build open on the phone, USB)make session # clean trees, as many snapshots per screen as you like: Enter saves, n goes to the next screen# (SCREENS="playlist artist" for some); every snapshot says whether the mod was at stockdiff --git a/tweak/Sources/Redesigned/Kit/SGRTokens.m b/tweak/Sources/Redesigned/Kit/SGRTokens.mindex 88004126..7e4d0729 100644--- a/tweak/Sources/Redesigned/Kit/SGRTokens.m+++ b/tweak/Sources/Redesigned/Kit/SGRTokens.m@@ -17,8 +17,9 @@ const NSTimeInterval SGRCrossfade = 0.35;// A layout spring settles in about this long without overshooting; a press gives a little back.static const NSTimeInterval kLayoutDuration = 0.45, kPressDuration = 0.32;-// The tab bar's minimize, in the 0.3 to 0.4 s Apple gives a repositioning spring.-static const NSTimeInterval kBarDuration = 0.34;+// The tab bar's minimize runs on every scroll, so it is quicker than the 0.3 to 0.4 s Apple gives a+// repositioning spring.+static const NSTimeInterval kBarDuration = 0.26;static const CGFloat kPressDamping = 0.62;// A response lands within the press feedback's budget, on a curve that is most of the way there at once.static const NSTimeInterval kRespondDuration = 0.2;diff --git a/tweak/Sources/Redesigned/Navbar/TabBar.x b/tweak/Sources/Redesigned/Navbar/TabBar.xindex 6bb70484..98f3724c 100644--- a/tweak/Sources/Redesigned/Navbar/TabBar.x+++ b/tweak/Sources/Redesigned/Navbar/TabBar.x@@ -472,6 +472,9 @@ static BOOL fillBar(SGRSystemTabBar *bar, NSArray<UIView *> *sources, BOOL hideLif (!item.image) item.image = glyphOf(sources[i], NO);if (!item.selectedImage || item.selectedImage == item.image) item.selectedImage = glyphOf(sources[i], YES);missing |= !item.image || !item.selectedImage;+ item.accessibilityLabel = labelIn(sources[i]).text;+ item.largeContentSizeImage = item.image;+ item.accessibilityHint = sg_minimized && bar == objc_getAssociatedObject(bar.stockBar, &kBarKey) ? @"Shows all tabs" : nil;NSString *title = hideLabels ? nil : labelIn(sources[i]).text;if (hideLabels ? item.title != nil : title.length && ![title isEqualToString:item.title]) item.title = title;}diff --git a/tweak/Sources/Redesigned/NowPlayingBar/NowPlayingBar.x b/tweak/Sources/Redesigned/NowPlayingBar/NowPlayingBar.xindex 3d5b9099..f4fef904 100644--- a/tweak/Sources/Redesigned/NowPlayingBar/NowPlayingBar.x+++ b/tweak/Sources/Redesigned/NowPlayingBar/NowPlayingBar.x@@ -236,9 +236,13 @@ static NSHashTable<UIView *> *sg_tucked;static void tuckExtras(UIView *bar, BOOL tuck) {if (!sg_tucked) sg_tucked = [NSHashTable weakObjectsHashTable];+ // A stack hides an item only once the animation it was hidden in ends, so the buttons also fade on+ // their own, out as the card heads for the row and back in after it leaves.if (!tuck) {- for (UIView *item in sg_tucked) item.hidden = NO;+ NSArray<UIView *> *items = sg_tucked.allObjects;[sg_tucked removeAllObjects];+ for (UIView *item in items) item.hidden = NO;+ SGRAnimate(SGRMotionRespond, ^{ for (UIView *item in items) item.alpha = 1; }, nil);return;}BOOL keepConnect = SGHidden(SGRKeyBarInlineConnect);@@ -251,6 +255,7 @@ static void tuckExtras(UIView *bar, BOOL tuck) {while (item.superview && item.superview != bar && ![item.superview isKindOfClass:UIStackView.class]) item = item.superview;if (![item.superview isKindOfClass:UIStackView.class] || item.hidden) return;item.hidden = YES;+ SGRAnimate(SGRMotionExit, ^{ item.alpha = 0; }, nil);[sg_tucked addObject:item];});}diff --git a/tweak/Sources/Redesigned/Player/PlayerMorph.x b/tweak/Sources/Redesigned/Player/PlayerMorph.xindex 7a2d67fa..02086b94 100644--- a/tweak/Sources/Redesigned/Player/PlayerMorph.x+++ b/tweak/Sources/Redesigned/Player/PlayerMorph.x@@ -15,6 +15,8 @@// reads back only the frame's height), its own background color lifted off meanwhile// (a sublayerTransform does not move it), and faded in over the first part of the growth;// the bar Spotify's stand-in riding the sheet's top edge, gone by a quarter of the way;+// the tab bar Spotify's stand-in hidden, since the real one stays in view around the sheet+// and the stand-in would be a second tab bar;// the cover a copy flown from the card's artwork to the player's cover, moved within the sheet,// the player's own cover and shadow hidden meanwhile.// All of it is taken down in -destroyTransitioningContext, which Spotify calls from -animationEnded:.@@ -30,6 +32,7 @@- (id<UIViewControllerContextTransitioning>)transitioningContext;- (UIView *)overlayView;- (UIView *)barSnapshotView;+- (UIView *)tabBarSnapshotView;- (CGRect)barFrame;- (double)progress;@end@@ -240,7 +243,9 @@ static SGRPlayerMorph *morphFor(SPTBarOverlayPresentationTransition *transition,%hook SPTBarOverlayPresentationTransition- (void)setProgress:(double)progress {%orig;- [morphFor(self, YES) apply:[self progress]];+ SGRPlayerMorph *morph = morphFor(self, YES);+ [morph apply:[self progress]];+ if (morph) [self tabBarSnapshotView].alpha = 0;}- (void)destroyTransitioningContext {