Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C

feat: hide the full screen cover that a tap on the cover opens (#150)

My-Name-Is-Jeff69730d1b1564
diff --git a/docs/tweaks.md b/docs/tweaks.md
index 677f52d9..6b95cedc 100644
--- a/docs/tweaks.md
+++ b/docs/tweaks.md
@@ -275,6 +275,11 @@ Shared:
block stays out of it unless the sheet itself is shown (SGPlayerMenuReplaced). Switch to video,
the chip over the title of a song with a music video, is hidden under either look on request
(VideoSwitch.x, spotifyglass.hide.videoSwitch), by its identifier in FloatingElementsUnit.
+ Full screen cover hidden (spotifyglass.hide.fullScreenCover) stops a tap on the cover from opening
+ Spotify's full screen cover, under either look: each look's handleTap hook on CoverArtTiltView
+ (PlayerGestures.x) returns before Spotify's, as it does while Gestures is on. Spotify's own flag
+ (cover_art_tilt_enabled) is left alone: with it off the cover is built without CoverArtTiltView,
+ and every hook on that view (the redesign's rounding and shadow, the hold to 2x) has nothing to reach.
The sleep timer (SleepTimer.m, set from the Live Activity) pauses Spotify at a time, at the end of
the track or at the end of the album or playlist, the last track of it found by the tracks to come
that are neither queued by hand nor autoplay's (SPTPlayerTrack's provider), or by the next one
diff --git a/tweak/Sources/App/Pages.m b/tweak/Sources/App/Pages.m
index b63a4858..bbb6d24c 100644
--- a/tweak/Sources/App/Pages.m
+++ b/tweak/Sources/App/Pages.m
@@ -159,9 +159,11 @@ UIViewController *SGPlayerSettingsPage(void) {
}
// Switch to video is the same chip of Spotify's player under either look.
SGModRow *video = SGHideRow(@"Switch to video", @"The chip over the title of a song with a music video", SGKeyHideVideoSwitch);
+ // Spotify's own, under either look: a tap on the cover opens it full screen, where it turns a little with the phone.
+ SGModRow *tilt = SGHideRow(@"Full screen cover", @"What a tap on the cover opens", SGKeyHideFullScreenCover);
// The native look's Shuffle and Repeat rows are in its Hide on the player section, with their own keys.
- NSArray<SGModRow *> *hidden = native ? @[video]
- : @[SGHideRow(@"Shuffle", nil, SGRKeyPlayerHideShuffle), SGHideRow(@"Repeat", nil, SGRKeyPlayerHideRepeat), video];
+ NSArray<SGModRow *> *hidden = native ? @[video, tilt]
+ : @[SGHideRow(@"Shuffle", nil, SGRKeyPlayerHideShuffle), SGHideRow(@"Repeat", nil, SGRKeyPlayerHideRepeat), video, tilt];
[sections addObject:SGSection(native ? nil : @"Hide on the player", hidden)];
[sections addObject:SGNotedSection(@"Lossless", @[
diff --git a/tweak/Sources/Native/Player/PlayerGestures.x b/tweak/Sources/Native/Player/PlayerGestures.x
index ebf370b7..3688bd4b 100644
--- a/tweak/Sources/Native/Player/PlayerGestures.x
+++ b/tweak/Sources/Native/Player/PlayerGestures.x
@@ -10,6 +10,7 @@
#import "Shared/Gestures/Gestures.h"
#import "Shared/Haptics/Haptics.h"
#import "Shared/Player/SpeedPitch.h"
+#import "Shared/Player/PlayerSettings.h"
#pragma mark - hold to play faster
@@ -145,10 +146,10 @@ static void watchHold(UIView *tilt) {
// A single tap on the cover is Spotify's way into the tilt mode, the artwork alone in 3D. That is
// the half of a double tap that misses, so while the zones are on it would open on the way to every
-// gesture; the tap goes back to Spotify with the switch.
+// gesture; the tap goes back to Spotify with the switch. Full screen cover hidden keeps it from Spotify too.
%hook _TtC35CreativeWorkCommons_CoverArtTiltKit16CoverArtTiltView
- (void)handleTap {
- if (SGFlag(SGKeyGestures, NO)) return;
+ if (SGFlag(SGKeyGestures, NO) || SGHidden(SGKeyHideFullScreenCover)) return;
%orig;
}
- (void)layoutSubviews {
diff --git a/tweak/Sources/Redesigned/Player/PlayerGestures.x b/tweak/Sources/Redesigned/Player/PlayerGestures.x
index 445acb5f..c439b04b 100644
--- a/tweak/Sources/Redesigned/Player/PlayerGestures.x
+++ b/tweak/Sources/Redesigned/Player/PlayerGestures.x
@@ -5,13 +5,14 @@
// controls are sibling units rather than children of it, so a tap on a button never reaches it.
#import "Core/SGCore.h"
#import "Shared/Gestures/Gestures.h"
+#import "Shared/Player/PlayerSettings.h"
// A single tap on the cover is Spotify's way into the tilt mode, the artwork alone in 3D. That is
// the half of a double tap that misses, so while the zones are on it would open on the way to every
-// gesture; the tap goes back to Spotify with the switch.
+// gesture; the tap goes back to Spotify with the switch. Full screen cover hidden keeps it from Spotify too.
%hook _TtC35CreativeWorkCommons_CoverArtTiltKit16CoverArtTiltView
- (void)handleTap {
- if (SGFlag(SGKeyGestures, NO)) return;
+ if (SGFlag(SGKeyGestures, NO) || SGHidden(SGKeyHideFullScreenCover)) return;
%orig;
}
%end
diff --git a/tweak/Sources/Shared/Player/PlayerSettings.h b/tweak/Sources/Shared/Player/PlayerSettings.h
index db867f0d..34f5332a 100644
--- a/tweak/Sources/Shared/Player/PlayerSettings.h
+++ b/tweak/Sources/Shared/Player/PlayerSettings.h
@@ -5,3 +5,7 @@ UIViewController *SGLockScreenWidgetPage(void);
// Switch to video hidden from the player under either look (VideoSwitch.x), off until switched on.
#define SGKeyHideVideoSwitch @"spotifyglass.hide.videoSwitch"
+
+// A tap on the cover opens Spotify's full screen cover unless this is on, under either look: each look's
+// handleTap hook on CoverArtTiltView (PlayerGestures.x) returns before Spotify's. Off until switched on.
+#define SGKeyHideFullScreenCover @"spotifyglass.hide.fullScreenCover"