Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
feat: redesign settings page
Vojtěch Škopek8ce6627e972b
diff --git a/README.md b/README.mdindex d2f72c3c..f41a6525 100644--- a/README.md+++ b/README.md@@ -112,11 +112,11 @@ reuse it; `make flags` regenerates it.## Mod Settings-Settings → Mod Settings is one page per area: UI Tweaks, Home & Library, Playlist, Now Playing,-Lock screen widget, Playback, Ads & nags, Unreleased and Experimental, then Privacy, Navbar and-All flags. A switch on a page forces one of Spotify's flags; off leaves Spotify's own value, and-All flags is where a flag goes back to Auto. Navbar applies straight away, everything else after-Spotify restarts.+Settings → Mod Settings is one page per area: Appearance (with Navbar under it), Home & Library,+Playlist and Player; Ads & privacy and Labs; then All flags and Mod, which holds the version,+updates, links, the welcome tour and the reset. A switch on a page forces one of Spotify's flags;+off leaves Spotify's own value, and All flags is where a flag goes back to Auto. Navbar applies+straight away, everything else after Spotify restarts.## Hack on itdiff --git a/docs/tweaks.md b/docs/tweaks.mdindex 3f9aa9a3..f3ffd1c8 100644--- a/docs/tweaks.md+++ b/docs/tweaks.md@@ -42,11 +42,11 @@ app:AdBlock/ EeveeSpotify's ad blocking: the ad and upsell services silenced (AdServices.x), ad components out of theHub JSON (AdHubs.x) and the feeds (Feeds.m), Premium pop-ups dropped (AdPopups.x), and the responsesrewritten on the way in (AdNetwork.x, Premium.m over the protobuf walker in Protobuf.m)- Onboarding/ the welcome tour over Home on the first launch (Onboarding.x, the pages in Tour.m), offered again from About- About/ the update check and the About section of the root page+ Onboarding/ the welcome tour over Home on the first launch (Onboarding.x, the pages in Tour.m), offered again from the Mod page+ About/ the update check and the Mod page: the build, its updates, the links and the reset-Every key a feature stores starts with `spotifyglass.`, whatever it holds: Reset all settings in-About removes by that prefix and has no list to keep up to date. It leaves `SGKeyStock` behind,+Every key a feature stores starts with `spotifyglass.`, whatever it holds: Reset all settings on+the Mod page removes by that prefix and has no list to keep up to date. It leaves `SGKeyStock` behind,which makes every unset switch read off, so a reset is stock Spotify whatever switches exist.A hook reads its switch when it runs (`SGEnabled`, `SGHidden`, `SGFlag` from Core/SGPrefs.h), so a@@ -65,26 +65,28 @@ out again, as are the Home gradient's colour, strength and height, but not the s## Mod Settings-Settings → Mod Settings lists its pages without a description each, so the list reads as a list: UI-Tweaks (tab bar, search field, Spotify's own glass, AMOLED), Home & Library (a Gradient page: the wash behind the top of-Home in one of eight colours, at three strengths and four heights; then hide sections of the Home-tab and Spotify's home and library flags), Playlist (hide the cover, the-header's text and buttons, the curation pills), Now Playing (glass, Spotify's player flags, hide-buttons and cards of the full screen player, and a Lyrics page under it), Lock screen widget,-Playback (speed, queue, the player and the now playing bar), Ads & nags (every switch forces a flag-Spotify ships on to off: the ad on app open, upsells, tooltips, the DJ badge; and an Ad blocking page-under it, EeveeSpotify's layers behind three switches that start off: hide ads, hide upsells and-pretend to be Premium, with a count of what each stopped), Unreleased (features-Spotify built and did not ship) and Experimental, which holds AI Chat (Martini). Then Privacy,-telemetry blocking with a count of what it has stopped; Navbar, the tab bar's own composition; and-All flags, Spotify's remote-config flags with a search field and an Auto / Off / On control per flag-(a text field for the number and text ones). A flag switch on a page forces that one flag and off-leaves Spotify's own value, so the All flags page is where a flag goes back to Auto. Spotify ships-its newer design behind several flags at once, so UI Tweaks > Spotify's own Liquid Glass owns them-(the glass navigation bar, the new player slider, the sheet style player, the queue and Connect-sheets, the redesigned player header, the sleep timer's options sheet): while it is on it forces-each of them, and their rows elsewhere show what it forces and take no touch, so the group has one-switch. `SGGlassOwnsFlag` in Features/Flags/Flags.x holds the list. A change shows after Spotify restarts.+Settings → Mod Settings is three cards of pages, an icon and no description each, so the list+reads as a list. Appearance (Navbar, the tab bar's own composition, as a page under it; then the+glass tab bar, search field and Spotify's own glass, AMOLED and the accent colour), Home & Library+(a Gradient page: the wash behind the top of Home in one of eight colours, at three strengths and+four heights; then hide sections of the Home tab and Spotify's home and library flags), Playlist+(hide the cover, the header's text and buttons, the curation pills) and Player (glass, Spotify's+player flags, hide buttons and cards of the full screen player, then the queue, controls and now+playing bar flags, the lock screen widget's, and a Lyrics page under it). Ads & privacy (every flag+switch forces a flag Spotify ships on to off: the ad on app open, upsells, tooltips, the DJ badge;+an Ad blocking page under it, EeveeSpotify's layers behind three switches that start off: hide ads,+hide upsells and pretend to be Premium, with a count of what each stopped; then telemetry blocking+with a count of what it has stopped) and Labs (features Spotify built and did not ship, and AI Chat+(Martini) under it). Then All flags, Spotify's remote-config flags with a search field and an+Auto / Off / On control per flag (a text field for the number and text ones), and Mod: the build+and Spotify's version, the update check, the site and the repo, the welcome tour again and Reset+all settings. A flag switch on a page forces that one flag and off leaves Spotify's own value, so+the All flags page is where a flag goes back to Auto. Spotify ships its newer design behind several+flags at once, so Appearance > Liquid Glass UI owns them (the glass navigation bar, the new player+slider, the sheet style player, the queue and Connect sheets, the redesigned player header, the+sleep timer's options sheet): while it is on it forces each of them, and their rows elsewhere show+what it forces and take no touch, so the group has one switch. `SGGlassOwnsFlag` in+Features/Flags/Flags.x holds the list. A change shows after Spotify restarts.Navbar is the exception and applies as soon as the bar lays out again. It lists the tabs in the orderthe bar shows them: drag to reorder, tap to hide or show, and Add a tab puts a page of Spotify's ordiff --git a/tweak/Sources/Core/SGPrefs.h b/tweak/Sources/Core/SGPrefs.hindex 3aeaf7c7..5e76e146 100644--- a/tweak/Sources/Core/SGPrefs.h+++ b/tweak/Sources/Core/SGPrefs.h@@ -1,6 +1,6 @@// The mod's own settings, in Spotify's NSUserDefaults. Every key is declared by the feature that-// owns it, in that feature's header, and starts with "spotifyglass.": Reset all settings in About-// sweeps by that prefix and knows no key by name. The accessors here are what the hooks and the+// owns it, in that feature's header, and starts with "spotifyglass.": Reset all settings on the Mod+// page sweeps by that prefix and knows no key by name. The accessors here are what the hooks and the// pages share.#import <Foundation/Foundation.h>diff --git a/tweak/Sources/Features/About/About.h b/tweak/Sources/Features/About/About.hindex 5182e95b..c5dd03cd 100644--- a/tweak/Sources/Features/About/About.h+++ b/tweak/Sources/Features/About/About.h@@ -23,4 +23,4 @@ SGModRow *SGSigningWarningRow(void); // nil while the signature is sounvoid SGCheckSigningOnce(void);void SGShowSigningFixIfPending(void); // the sheet the tour held back, if any-SGModSection *SGAboutSection(void);+UIViewController *SGAboutPage(void); // the Mod pagediff --git a/tweak/Sources/Features/About/AboutSettings.m b/tweak/Sources/Features/About/AboutSettings.mindex d4a79cde..b0b9e8f5 100644--- a/tweak/Sources/Features/About/AboutSettings.m+++ b/tweak/Sources/Features/About/AboutSettings.m@@ -27,21 +27,30 @@ static void confirmReset(void) {[SGTopController() presentViewController:alert animated:YES completion:nil];}+static SGModRow *withSymbol(SGModRow *row, NSString *symbol) {+ row.symbol = symbol;+ return row;+}+// Which build this is, whether the site has a newer one, and where to reach the mod: without these// rows a build that is already installed has no way of telling its user that anything moved on.-SGModSection *SGAboutSection(void) {- SGModRow *reset = SGActionRow(@"Reset all settings", @"Every switch off, Spotify as it came, then a restart", ^{ confirmReset(); });+UIViewController *SGAboutPage(void) {+ SGModRow *reset = withSymbol(SGActionRow(@"Reset all settings", @"Every switch off, Spotify as it came, then a restart", ^{ confirmReset(); }), @"trash");reset.color = SGRed();NSString *spotify = [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: @"unknown";- return SGSection(@"About", @[- SGStatRow(@"Version", ^NSString *{ return @(SG_VERSION); }),- SGStatRow(@"Spotify", ^NSString *{ return spotify; }),- SGStatActionRow(@"Updates", @"Asks the site for the newest build; tap to check now", ^NSString *{- return SGUpdateStatus();- }, ^{ SGCheckForUpdate(YES); }),- SGLinkRow(@"Website", @"Downloads, and the source to add to AltStore or SideStore", SGSiteURL),- SGLinkRow(@"GitHub", @"Source, releases and issues", SGRepoURL),- SGActionRow(@"Welcome tour", @"The pages from the first launch, again", ^{ SGShowOnboarding(); }),- reset,- ]);+ return [[SGModPage alloc] initWithTitle:@"Mod" intro:nil sections:@[+ SGSection(nil, @[+ SGStatRow(@"Version", ^NSString *{ return @(SG_VERSION); }),+ SGStatRow(@"Spotify", ^NSString *{ return spotify; }),+ SGStatActionRow(@"Updates", @"Asks the site for the newest build; tap to check now", ^NSString *{+ return SGUpdateStatus();+ }, ^{ SGCheckForUpdate(YES); }),+ ]),+ SGSection(nil, @[+ withSymbol(SGLinkRow(@"Website", @"Downloads, and the source to add to AltStore or SideStore", SGSiteURL), @"safari"),+ withSymbol(SGLinkRow(@"GitHub", @"Source, releases and issues", SGRepoURL), @"chevron.left.forwardslash.chevron.right"),+ withSymbol(SGActionRow(@"Welcome tour", @"The pages from the first launch, again", ^{ SGShowOnboarding(); }), @"map"),+ ]),+ SGSection(nil, @[reset]),+ ] footer:nil];}diff --git a/tweak/Sources/Features/Appearance/Appearance.h b/tweak/Sources/Features/Appearance/Appearance.hindex 84b71aa6..40a7877b 100644--- a/tweak/Sources/Features/Appearance/Appearance.h+++ b/tweak/Sources/Features/Appearance/Appearance.h@@ -12,7 +12,7 @@ UIColor *SGAccentColor(void); // nil while Spotify's own green is keptNSString *SGAccentLabel(void); // "#RRGGBB", or the name of Spotify's ownvoid SGPickAccent(void); // the system colour picker over the top of the app, stored on the way out-// Liquid Glass UI, the one switch of UI Tweaks that sets others: Spotify's own glass and, with+// Liquid Glass UI, the one switch of Appearance that sets others: Spotify's own glass and, with// it, the search field, the now playing bar, the artwork background and the lyrics card. Each// stays a switch of its own afterwards.void SGSetLiquidGlassUI(BOOL on);diff --git a/tweak/Sources/Features/Appearance/AppearanceSettings.m b/tweak/Sources/Features/Appearance/AppearanceSettings.mindex 3517f0d0..34374e68 100644--- a/tweak/Sources/Features/Appearance/AppearanceSettings.m+++ b/tweak/Sources/Features/Appearance/AppearanceSettings.m@@ -17,7 +17,10 @@ UIViewController *SGAppearanceSettingsPage(void) {tabBar.defaultOn = NO;SGModRow *glass = SGOptionRow(@"Liquid Glass UI", @"Spotify's own glass navigation bar, slider and sheets, and with it the search field, now playing bar, artwork background and lyrics", SGKeySpotifyGlass);glass.changed = ^(BOOL on) { SGSetLiquidGlassUI(on); };- return [[SGModPage alloc] initWithTitle:@"UI Tweaks" intro:SGRestartNote sections:@[+ return [[SGModPage alloc] initWithTitle:@"Appearance" intro:SGRestartNote sections:@[+ SGSection(nil, @[+ SGPageRow(@"Navbar", ^UIViewController *{ return SGNavbarSettingsPage(); }),+ ]),SGSection(@"Liquid Glass", @[tabBar,SGOptionRow(@"Search field", @"Glass capsule instead of the white field", SGKeySearchField),diff --git a/tweak/Sources/Features/Flags/FlagPages.m b/tweak/Sources/Features/Flags/FlagPages.mindex 1d834ddc..82c2a9da 100644--- a/tweak/Sources/Features/Flags/FlagPages.m+++ b/tweak/Sources/Features/Flags/FlagPages.m@@ -2,27 +2,26 @@#import "Settings/SGModPage.h"#import "Flags.h"#import "Features/AdBlock/AdBlock.h"+#import "Features/Privacy/Privacy.h"-UIViewController *SGLockScreenSettingsPage(void) {- return [[SGModPage alloc] initWithTitle:@"Lock screen widget" intro:SGRestartNote sections:@[- SGSection(@"Spotify's flags", @[- SGFlagRow(@"Like and dislike buttons", @"ios-feature-lockscreen.like_dislike_enabled"),- SGFlagRow(@"Animated artwork", @"ios-feature-lockscreen.animated_artwork_enabled"),- SGFlagRow(@"Video artwork", @"ios-feature-lockscreen.vit_artwork_enabled"),- SGFlagRow(@"Companion content", @"ios-feature-lockscreen.companion_content_enabled"),- SGFlagRow(@"Burst skip", @"ios-feature-lockscreen.burst_skip_enabled"),- SGFlagRow(@"Chapter skip controls", @"ios-feature-lockscreen.enable_chapter_skip_controls"),- SGFlagRow(@"Skip button on podcasts", @"ios-feature-lockscreen.skip_button_on_podcasts"),- ]),- ] footer:nil];+SGModSection *SGLockScreenSection(void) {+ return SGSection(@"Lock screen widget", @[+ SGFlagRow(@"Like and dislike buttons", @"ios-feature-lockscreen.like_dislike_enabled"),+ SGFlagRow(@"Animated artwork", @"ios-feature-lockscreen.animated_artwork_enabled"),+ SGFlagRow(@"Video artwork", @"ios-feature-lockscreen.vit_artwork_enabled"),+ SGFlagRow(@"Companion content", @"ios-feature-lockscreen.companion_content_enabled"),+ SGFlagRow(@"Burst skip", @"ios-feature-lockscreen.burst_skip_enabled"),+ SGFlagRow(@"Chapter skip controls", @"ios-feature-lockscreen.enable_chapter_skip_controls"),+ SGFlagRow(@"Skip button on podcasts", @"ios-feature-lockscreen.skip_button_on_podcasts"),+ ]);}-UIViewController *SGPlaybackSettingsPage(void) {- return [[SGModPage alloc] initWithTitle:@"Playback" intro:SGRestartNote sections:@[+NSArray<SGModSection *> *SGPlaybackSections(void) {+ return @[SGSection(@"Queue", @[SGFlagRow(@"Play next in the context menu", @"ios-feature-queue.is_play_next_context_menu_enabled"),]),- SGSection(@"Player", @[+ SGSection(@"Controls", @[SGFlagRow(@"New progress slider", @"ios-feature-encoreexperiments.new_npv_slider_enabled"),SGFlagRow(@"Connect as a bottom sheet", @"ios-feature-nowplaying-elements.enable_connect_bottom_sheet"),SGFlagRow(@"Connect sheet from the video switcher", @"ios-playbackcontrol-audiovideoswitcher-impl.enable_connect_bottom_sheet"),@@ -33,13 +32,13 @@ UIViewController *SGPlaybackSettingsPage(void) {SGFlagRow(@"Queue badge", @"ios-feature-nowplayingbar.queue_badge"),SGFlagRow(@"Two lines of track info", @"ios-feature-nowplayingbar.two_lines_information_unit"),]),- ] footer:nil];+ ];}-// Every switch here forces a flag Spotify ships on to off, so the titles name the blocking: on-// stops the thing, off is Spotify's own value.+// Every flag switch here forces a flag Spotify ships on to off, so the titles name the blocking: on+// stops the thing, off is Spotify's own value. The telemetry sections come from Privacy.UIViewController *SGAdsSettingsPage(void) {- return [[SGModPage alloc] initWithTitle:@"Ads & nags" intro:SGRestartNote sections:@[+ NSMutableArray<SGModSection *> *sections = [NSMutableArray arrayWithArray:@[SGSection(nil, @[SGPageRow(@"Ad blocking", ^UIViewController *{ return SGAdBlockSettingsPage(); }),]),@@ -70,29 +69,10 @@ UIViewController *SGAdsSettingsPage(void) {SGSection(nil, @[SGFlagRow(@"Reduce interventions", @"ios-messaging-reduceinterventions-impl.enabled"),]),- ] footer:@"The tooltip switches belong to Spotify's own intervention-reduction system, which the last switch turns on."];-}--UIViewController *SGUnreleasedSettingsPage(void) {- return [[SGModPage alloc] initWithTitle:@"Unreleased" intro:SGRestartNote sections:@[- SGSection(@"Player", @[- SGFlagRow(@"Snake on the cover art", @"ios-feature-cover-art-snake.enabled"),- ]),- SGSection(@"Podcast comments", @[- SGFlagRow(@"Comments card", @"ios-feature-comments.enable_comments_card"),- SGFlagRow(@"Pinned comments", @"ios-feature-comments.enable_pinned_comments"),- SGFlagRow(@"Several reactions", @"ios-feature-comments.enable_multi_reactions"),- ]),- SGSection(@"Sleep timer", @[- SGFlagRow(@"Fade out", @"ios-feature-sleeptimer.enable_fade_out"),- SGFlagRow(@"One minute option", @"ios-feature-sleeptimer.enable_one_minute_option"),- SGFlagRow(@"Options sheet", @"ios-feature-sleeptimer.use_options_sheet"),- ]),- SGSection(@"Elsewhere", @[- SGFlagRow(@"Local files from the Files app", @"ios-feature-localfiles.documents_enabled"),- SGFlagRow(@"Progress bar in the home screen widget", @"ios-widgets-widgetremoteconfig-impl.progress_bar_enabled"),- ]),- ] footer:nil];+ ]];+ [sections addObjectsFromArray:SGPrivacySections()];+ return [[SGModPage alloc] initWithTitle:@"Ads & privacy" intro:SGRestartNote sections:sections+ footer:@"The tooltip switches belong to Spotify's own intervention-reduction system, which Reduce interventions turns on."];}static UIViewController *martiniPage(void) {@@ -115,8 +95,26 @@ static UIViewController *martiniPage(void) {] footer:nil];}-UIViewController *SGExperimentalSettingsPage(void) {- return [[SGModPage alloc] initWithTitle:@"Experimental" intro:nil sections:@[+// Features Spotify built and did not ship, and the AI chat behind more flags than fit here.+UIViewController *SGLabsPage(void) {+ return [[SGModPage alloc] initWithTitle:@"Labs" intro:SGRestartNote sections:@[+ SGSection(@"Player", @[+ SGFlagRow(@"Snake on the cover art", @"ios-feature-cover-art-snake.enabled"),+ ]),+ SGSection(@"Podcast comments", @[+ SGFlagRow(@"Comments card", @"ios-feature-comments.enable_comments_card"),+ SGFlagRow(@"Pinned comments", @"ios-feature-comments.enable_pinned_comments"),+ SGFlagRow(@"Several reactions", @"ios-feature-comments.enable_multi_reactions"),+ ]),+ SGSection(@"Sleep timer", @[+ SGFlagRow(@"Fade out", @"ios-feature-sleeptimer.enable_fade_out"),+ SGFlagRow(@"One minute option", @"ios-feature-sleeptimer.enable_one_minute_option"),+ SGFlagRow(@"Options sheet", @"ios-feature-sleeptimer.use_options_sheet"),+ ]),+ SGSection(@"Elsewhere", @[+ SGFlagRow(@"Local files from the Files app", @"ios-feature-localfiles.documents_enabled"),+ SGFlagRow(@"Progress bar in the home screen widget", @"ios-widgets-widgetremoteconfig-impl.progress_bar_enabled"),+ ]),SGSection(nil, @[SGPageRow(@"AI Chat (Martini)", ^UIViewController *{ return martiniPage(); }),]),diff --git a/tweak/Sources/Features/Flags/Flags.h b/tweak/Sources/Features/Flags/Flags.hindex 5988bd84..2777af85 100644--- a/tweak/Sources/Features/Flags/Flags.h+++ b/tweak/Sources/Features/Flags/Flags.h@@ -1,7 +1,7 @@// Flags: Spotify's remote-config flags. Flags.x forces an override into the configuration// provider; SGFlagList.m is the table of every flag, generated from the IPA by-// scripts/extract-flags.py; FlagsPage.m is the searchable All flags page and FlagPages.m the pages-// that list flags by topic (Playback, Ads & nags, Lock screen widget, Unreleased, Experimental).+// scripts/extract-flags.py; FlagsPage.m is the searchable All flags page and FlagPages.m the flags+// by topic: the Ads & privacy and Labs pages, and the playback and lock screen sections of Player.#import <UIKit/UIKit.h>// Spotify ships its newer design behind several flags at once, so this switch owns them all:@@ -15,9 +15,9 @@ typedef struct { const char *key; SGFlagType type; long value, lower, upper; } Sextern const SGFlagDef SGFlagTable[];extern const NSUInteger SGFlagCount;+@class SGModSection;UIViewController *SGAllFlagsPage(void);-UIViewController *SGPlaybackSettingsPage(void);UIViewController *SGAdsSettingsPage(void);-UIViewController *SGLockScreenSettingsPage(void);-UIViewController *SGUnreleasedSettingsPage(void);-UIViewController *SGExperimentalSettingsPage(void);+UIViewController *SGLabsPage(void);+NSArray<SGModSection *> *SGPlaybackSections(void);+SGModSection *SGLockScreenSection(void);diff --git a/tweak/Sources/Features/Flags/FlagsPage.m b/tweak/Sources/Features/Flags/FlagsPage.mindex 76e14cf6..dee16e0c 100644--- a/tweak/Sources/Features/Flags/FlagsPage.m+++ b/tweak/Sources/Features/Flags/FlagsPage.m@@ -34,7 +34,6 @@ static NSString *flagState(const SGFlagDef *flag, id value) {- (void)viewDidLoad {[super viewDidLoad];self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;- self.tableView.backgroundColor = SGPageBackground();self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;_search = [UISearchBar new];@@ -103,6 +102,7 @@ static NSString *flagState(const SGFlagDef *flag, id value) {SGFillCell(cell, [key substringFromIndex:dot + 1],[NSString stringWithFormat:@"%@ · %@", [key substringToIndex:dot], flagState(flag, value)],value ? SGGreen() : nil, nil);+ cell.backgroundColor = UIColor.clearColor;cell.selectionStyle = UITableViewCellSelectionStyleDefault;if (flag->type == SGFlagBool) {diff --git a/tweak/Sources/Features/Navbar/NavbarSettings.m b/tweak/Sources/Features/Navbar/NavbarSettings.mindex b7d2d460..0ecc9684 100644--- a/tweak/Sources/Features/Navbar/NavbarSettings.m+++ b/tweak/Sources/Features/Navbar/NavbarSettings.m@@ -64,17 +64,13 @@ static void appendTab(NSDictionary *tab) {}- (instancetype)init {- if (!(self = [super initWithStyle:UITableViewStyleGrouped])) return nil;+ if (!(self = [super initWithStyle:UITableViewStyleInsetGrouped])) return nil;self.title = @"Add a Tab";return self;}- (void)viewDidLoad {[super viewDidLoad];- self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;- self.tableView.backgroundColor = SGPageBackground();- self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;- self.tableView.sectionHeaderTopPadding = 0;_footer = SGNote(@"Anything Spotify can open by link works, so a playlist, an artist or a page of ""your own goes on the bar the same way. Icons are Spotify's own: home, search, ""collection, heart, playlist, album, artist, podcasts, audiobook, downloaded, "@@ -167,17 +163,13 @@ static void appendTab(NSDictionary *tab) {}- (instancetype)init {- if (!(self = [super initWithStyle:UITableViewStyleGrouped])) return nil;+ if (!(self = [super initWithStyle:UITableViewStyleInsetGrouped])) return nil;self.title = @"Navbar";return self;}- (void)viewDidLoad {[super viewDidLoad];- self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;- self.tableView.backgroundColor = SGPageBackground();- self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;- self.tableView.sectionHeaderTopPadding = 0;self.tableView.allowsSelectionDuringEditing = YES;self.tableView.editing = YES;_intro = SGNote(@"Drag a tab by the handle to move it, tap it to show or hide it. The bar follows straight away.");diff --git a/tweak/Sources/Features/NowPlaying/NowPlaying.h b/tweak/Sources/Features/NowPlaying/NowPlaying.hindex 305c49f8..f6f13dd6 100644--- a/tweak/Sources/Features/NowPlaying/NowPlaying.h+++ b/tweak/Sources/Features/NowPlaying/NowPlaying.h@@ -1,6 +1,6 @@// Now Playing: the glass bar (NowPlayingBar.x), the full screen player (Player.x) and the lyrics// card with the page it expands into (Lyrics.x). The bar, the backdrop and the lyrics card are off-// until asked for, together through Liquid Glass UI in UI Tweaks; the header buttons are on.+// until asked for, together through Liquid Glass UI in Appearance; the header buttons are on.#import <UIKit/UIKit.h>#define SGKeyNowPlayingBar @"spotifyglass.nowPlayingBar"@@ -8,4 +8,4 @@#define SGKeyPlayerBackdrop @"spotifyglass.playerBackdrop"#define SGKeyLyricsCard @"spotifyglass.lyricsCard"-UIViewController *SGNowPlayingSettingsPage(void);+UIViewController *SGNowPlayingSettingsPage(void); // the Player pagediff --git a/tweak/Sources/Features/NowPlaying/NowPlayingSettings.m b/tweak/Sources/Features/NowPlaying/NowPlayingSettings.mindex 263a6fcf..39c7cb7e 100644--- a/tweak/Sources/Features/NowPlaying/NowPlayingSettings.m+++ b/tweak/Sources/Features/NowPlaying/NowPlayingSettings.m@@ -1,6 +1,7 @@#import "Settings/SGModPage.h"#import "NowPlaying.h"#import "Features/Declutter/Declutter.h"+#import "Features/Flags/Flags.h"static UIViewController *lyricsPage(void) {return [[SGModPage alloc] initWithTitle:@"Lyrics" intro:SGRestartNote sections:@[@@ -17,7 +18,7 @@ static UIViewController *lyricsPage(void) {}UIViewController *SGNowPlayingSettingsPage(void) {- return [[SGModPage alloc] initWithTitle:@"Now Playing" intro:SGRestartNote sections:@[+ NSMutableArray<SGModSection *> *sections = [NSMutableArray arrayWithArray:@[SGSection(@"Liquid Glass", @[SGOptionRow(@"Now playing bar", @"Glass card with round artwork", SGKeyNowPlayingBar),SGOptionRow(@"Artwork background", @"The cover blurred and dimmed behind the player instead of the flat album colour", SGKeyPlayerBackdrop),@@ -57,8 +58,13 @@ UIViewController *SGNowPlayingSettingsPage(void) {SGHideRow(@"Merch", @"The artist's shop", SGHideMerch),SGHideRow(@"Recommendations", @"\"Artist: what you might like\", the episode and track rows", SGHideRecommendations),]),+ ]];+ [sections addObjectsFromArray:SGPlaybackSections()];+ [sections addObjectsFromArray:@[+ SGLockScreenSection(),SGSection(nil, @[SGPageRow(@"Lyrics", ^UIViewController *{ return lyricsPage(); }),]),- ] footer:nil];+ ]];+ return [[SGModPage alloc] initWithTitle:@"Player" intro:SGRestartNote sections:sections footer:nil];}diff --git a/tweak/Sources/Features/Onboarding/Onboarding.h b/tweak/Sources/Features/Onboarding/Onboarding.hindex c96582c9..49a47ea7 100644--- a/tweak/Sources/Features/Onboarding/Onboarding.h+++ b/tweak/Sources/Features/Onboarding/Onboarding.h@@ -1,7 +1,7 @@// Onboarding: a welcome tour over Home the first time this build runs, four pages of glass: what// the mod is, the look switches, the ad switches, and where Mod Settings lives with the repo to// star. The switches it sets are read at launch like every other, so a changed one ends the tour-// in a restart. About offers the tour again.+// in a restart. The Mod page offers the tour again.#import <UIKit/UIKit.h>#define SGKeyOnboardingSeen @"spotifyglass.onboarding.seen"diff --git a/tweak/Sources/Features/Onboarding/Tour.m b/tweak/Sources/Features/Onboarding/Tour.mindex 1ecd9fd8..c1929fdc 100644--- a/tweak/Sources/Features/Onboarding/Tour.m+++ b/tweak/Sources/Features/Onboarding/Tour.m@@ -362,7 +362,7 @@ static SGTourRow *actionRow(NSString *symbol, NSString *title, NSString *subtitl]]];SGTourRow *lyricsOnly = switchRow(@"rectangle.compress.vertical", @"Only the lyrics", @"Hides every card under the player except lyrics: about the artist, videos, song DNA, credits, merch and the rest", SGKeyPlayerLyricsOnly, NO);lyricsOnly.changed = ^(BOOL on) { SGSetPlayerLyricsOnly(on); };- [pages addObject:[self pageWithSymbol:@"rectangle.compress.vertical" heading:@"Declutter." body:@"The player, down to the music. Every piece has a switch of its own under Now Playing in Mod Settings." rows:@[lyricsOnly]]];+ [pages addObject:[self pageWithSymbol:@"rectangle.compress.vertical" heading:@"Declutter." body:@"The player, down to the music. Every piece has a switch of its own under Player in Mod Settings." rows:@[lyricsOnly]]];[pages addObject:[self navbarPage]];[pages addObject:[self pageWithSymbol:@"slider.horizontal.3" heading:@"Everything lives in Mod Settings." body:@"Spotify's Settings, last row. Every switch, the tab bar editor and all of Spotify's flags.\n\nFree and open source. A star is what keeps it going." rows:@[actionRow(@"star.fill", @"Star on GitHub", @"skopevoj/spoti.pw", ^{ SGOpenURL(SGRepoURL); }),diff --git a/tweak/Sources/Features/Privacy/Privacy.h b/tweak/Sources/Features/Privacy/Privacy.hindex 3ffcbedc..c1a9400f 100644--- a/tweak/Sources/Features/Privacy/Privacy.h+++ b/tweak/Sources/Features/Privacy/Privacy.h@@ -10,4 +10,5 @@ NSArray<NSString *> *SGBlockedLabels(void);NSUInteger SGBlockedCount(NSString *label);void SGResetBlocked(void);-UIViewController *SGPrivacySettingsPage(void);+@class SGModSection;+NSArray<SGModSection *> *SGPrivacySections(void); // the telemetry rows of the Ads & privacy pagediff --git a/tweak/Sources/Features/Privacy/PrivacySettings.m b/tweak/Sources/Features/Privacy/PrivacySettings.mindex b60c9d56..9bf51ad5 100644--- a/tweak/Sources/Features/Privacy/PrivacySettings.m+++ b/tweak/Sources/Features/Privacy/PrivacySettings.m@@ -1,7 +1,7 @@#import "Settings/SGModPage.h"#import "Privacy.h"-UIViewController *SGPrivacySettingsPage(void) {+NSArray<SGModSection *> *SGPrivacySections(void) {NSMutableArray<SGModRow *> *counts = [NSMutableArray array];for (NSString *label in SGBlockedLabels()) {[counts addObject:SGStatRow(label, ^NSString *{@@ -11,13 +11,13 @@ UIViewController *SGPrivacySettingsPage(void) {[counts addObject:SGStatRow(@"Total", ^NSString *{return @(SGBlockedCount(nil)).stringValue;})];- return [[SGModPage alloc] initWithTitle:@"Privacy" intro:SGRestartNote sections:@[+ return @[SGSection(@"Telemetry", @[SGSwitchRow(@"Block telemetry", @"Answer the analytics endpoints with an empty reply instead of letting the request out", SGKeyBlockTelemetry),]),- SGSection(@"Blocked so far", counts),+ SGSection(@"Telemetry blocked so far", counts),SGSection(nil, @[- SGActionRow(@"Reset the counters", @"Start counting from zero", ^{ SGResetBlocked(); }),+ SGActionRow(@"Reset the telemetry counters", @"Start counting from zero", ^{ SGResetBlocked(); }),]),- ] footer:nil];+ ];}diff --git a/tweak/Sources/Settings/SGModPage.m b/tweak/Sources/Settings/SGModPage.mindex f1de5795..9a5aaf1b 100644--- a/tweak/Sources/Settings/SGModPage.m+++ b/tweak/Sources/Settings/SGModPage.m@@ -102,7 +102,7 @@ SGModRow *SGPageRow(NSString *title, UIViewController *(^page)(void)) {}- (instancetype)initWithTitle:(NSString *)title key:(NSString *)key choices:(NSArray<NSString *> *)choices fallback:(NSInteger)fallback {- if (!(self = [super initWithStyle:UITableViewStyleGrouped])) return nil;+ if (!(self = [super initWithStyle:UITableViewStyleInsetGrouped])) return nil;self.title = title;_key = key;_choices = choices;@@ -110,13 +110,6 @@ SGModRow *SGPageRow(NSString *title, UIViewController *(^page)(void)) {return self;}-- (void)viewDidLoad {- [super viewDidLoad];- self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;- self.tableView.backgroundColor = SGPageBackground();- self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;- self.tableView.sectionHeaderTopPadding = 0;-}- (void)viewDidLayoutSubviews {[super viewDidLayoutSubviews];@@ -235,7 +228,7 @@ static BOOL flagRowLocked(SGModRow *row) {}- (instancetype)initWithTitle:(NSString *)title intro:(NSString *)intro sections:(NSArray<SGModSection *> *)sections footer:(NSString *)footer {- if (!(self = [super initWithStyle:UITableViewStyleGrouped])) return nil;+ if (!(self = [super initWithStyle:UITableViewStyleInsetGrouped])) return nil;self.title = title;_sections = sections;_intro = intro ? SGNote(intro) : nil;@@ -248,10 +241,6 @@ static BOOL flagRowLocked(SGModRow *row) {- (void)viewDidLoad {[super viewDidLoad];- self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;- self.tableView.backgroundColor = SGPageBackground();- self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;- self.tableView.sectionHeaderTopPadding = 0;self.tableView.tableHeaderView = _intro;self.tableView.tableFooterView = _footer;}@@ -324,11 +313,11 @@ static BOOL flagRowLocked(SGModRow *row) {UITableViewCell *cell = SGDequeueCell(table, @"row");SGModRow *row = [self rowAt:path];SGFillCell(cell, row.title, row.subtitle, row.color, row.symbol);- if (row.color) {- UIListContentConfiguration *content = (UIListContentConfiguration *)cell.contentConfiguration;- content.secondaryTextProperties.color = row.color;- cell.contentConfiguration = content;- }+ UIListContentConfiguration *content = (UIListContentConfiguration *)cell.contentConfiguration;+ if (row.color) content.secondaryTextProperties.color = row.color;+ if (row.page && row.symbol) content.image = SGTileImage(row.symbol);+ cell.contentConfiguration = content;+ cell.separatorInset = UIEdgeInsetsMake(0, row.symbol ? (row.page ? 58 : 48) : 16, 0, 0);if (row.key) {UISwitch *toggle = [UISwitch new];diff --git a/tweak/Sources/Settings/SGModSettings.x b/tweak/Sources/Settings/SGModSettings.xindex de169cde..2bc73c6c 100644--- a/tweak/Sources/Settings/SGModSettings.x+++ b/tweak/Sources/Settings/SGModSettings.x@@ -1,9 +1,10 @@// Settings: a Mod Settings row at the end of Spotify's settings list opens the mod's own pages:-// UI Tweaks, Home, Playlist and Now Playing, each sections of switches (the mod's own and a few of-// Spotify's remote-config flags), Navbar, the tab bar's own composition, and All flags, a-// searchable list of every flag with an override per flag. The tweaks read the switches when they-// run, so a change shows after Spotify restarts; the Navbar page is the exception and applies as-// soon as the bar lays out again.+// Appearance (with the Navbar, the tab bar's own composition, under it), Home & Library, Playlist+// and Player, each sections of switches (the mod's own and a few of Spotify's remote-config+// flags), Ads & privacy and Labs, All flags, a searchable list of every flag with an override per+// flag, and Mod, the build, its updates and links. The tweaks read the switches when they run, so+// a change shows after Spotify restarts; the Navbar page is the exception and applies as soon as+// the bar lays out again.//// Tree (trees/settings.txt): SettingsListViewController.view > SettingsListCollectionView of// Element_List cells 402x56: 24pt icon at x 12, 13pt white title and 11pt grey subtitle at@@ -14,17 +15,21 @@#import "SGPageStyle.h"#import "SGModPage.h"#import "Features/Appearance/Appearance.h"-#import "Features/Navbar/Navbar.h"#import "Features/Home/Home.h"#import "Features/Playlist/Playlist.h"#import "Features/NowPlaying/NowPlaying.h"#import "Features/Flags/Flags.h"-#import "Features/Privacy/Privacy.h"#import "Features/About/About.h"static const CGFloat kRowHeight = 56;static char kRowKey, kInsetKey;+static SGModRow *pageRow(NSString *title, NSString *symbol, UIViewController *(^page)(void)) {+ SGModRow *row = SGPageRow(title, page);+ row.symbol = symbol;+ return row;+}+static UIViewController *modSettingsPage(void) {// Opening the page is the only thing that asks; the cache keeps it to once every six hours.SGCheckForUpdate(NO);@@ -33,24 +38,25 @@ static UIViewController *modSettingsPage(void) {// that no switch can put right, and it is worth reading before anything else.SGModRow *signing = SGSigningWarningRow();if (signing) [sections addObject:SGSection(nil, @[signing])];+ SGModRow *mod = pageRow(@"Mod", @"info.circle", ^UIViewController *{ return SGAboutPage(); });+ mod.value = ^NSString *{ return @(SG_VERSION); };[sections addObjectsFromArray:@[SGSection(nil, @[- SGPageRow(@"UI Tweaks", ^UIViewController *{ return SGAppearanceSettingsPage(); }),- SGPageRow(@"Navbar", ^UIViewController *{ return SGNavbarSettingsPage(); }),- SGPageRow(@"Home & Library", ^UIViewController *{ return SGHomeSettingsPage(); }),- SGPageRow(@"Playlist", ^UIViewController *{ return SGPlaylistSettingsPage(); }),- SGPageRow(@"Now Playing", ^UIViewController *{ return SGNowPlayingSettingsPage(); }),- SGPageRow(@"Lock screen widget", ^UIViewController *{ return SGLockScreenSettingsPage(); }),- SGPageRow(@"Playback", ^UIViewController *{ return SGPlaybackSettingsPage(); }),- SGPageRow(@"Ads & nags", ^UIViewController *{ return SGAdsSettingsPage(); }),- SGPageRow(@"Unreleased", ^UIViewController *{ return SGUnreleasedSettingsPage(); }),- SGPageRow(@"Experimental", ^UIViewController *{ return SGExperimentalSettingsPage(); }),- SGPageRow(@"Privacy", ^UIViewController *{ return SGPrivacySettingsPage(); }),- SGPageRow(@"All flags", ^UIViewController *{ return SGAllFlagsPage(); }),+ pageRow(@"Appearance", @"paintbrush", ^UIViewController *{ return SGAppearanceSettingsPage(); }),+ pageRow(@"Home & Library", @"house", ^UIViewController *{ return SGHomeSettingsPage(); }),+ pageRow(@"Playlist", @"music.note.list", ^UIViewController *{ return SGPlaylistSettingsPage(); }),+ pageRow(@"Player", @"play.circle", ^UIViewController *{ return SGNowPlayingSettingsPage(); }),+ ]),+ SGSection(nil, @[+ pageRow(@"Ads & privacy", @"shield", ^UIViewController *{ return SGAdsSettingsPage(); }),+ pageRow(@"Labs", @"testtube.2", ^UIViewController *{ return SGLabsPage(); }),+ ]),+ SGSection(nil, @[+ pageRow(@"All flags", @"flag", ^UIViewController *{ return SGAllFlagsPage(); }),+ mod,]),- SGAboutSection(),]];- return [[SGModPage alloc] initWithTitle:@"Mod Settings" intro:nil sections:sections footer:nil];+ return [[SGModPage alloc] initWithTitle:@"spoti.pw" intro:nil sections:sections footer:nil];}#pragma mark - row in the settings listdiff --git a/tweak/Sources/Settings/SGPage.m b/tweak/Sources/Settings/SGPage.mindex 7cf72662..5b7e4798 100644--- a/tweak/Sources/Settings/SGPage.m+++ b/tweak/Sources/Settings/SGPage.m@@ -1,4 +1,5 @@#import "SGPage.h"+#import "SGPageStyle.h"#import "Core/SGCore.h"@@ -13,6 +14,15 @@ static BOOL sg_pagesConform;@implementation SGPage+// Inset grouped cards on Spotify's dark grey, a hairline between the rows of a card.+- (void)viewDidLoad {+ [super viewDidLoad];+ self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;+ self.tableView.backgroundColor = SGPageBackground();+ self.tableView.separatorColor = [UIColor colorWithWhite:1 alpha:0.1];+ self.tableView.sectionHeaderTopPadding = 0;+}+- (NSString *)spt_pageIdentifier {return @"spotifyglass";}diff --git a/tweak/Sources/Settings/SGPageStyle.h b/tweak/Sources/Settings/SGPageStyle.hindex d0169af3..bdef8941 100644--- a/tweak/Sources/Settings/SGPageStyle.h+++ b/tweak/Sources/Settings/SGPageStyle.h@@ -6,12 +6,15 @@ UIColor *SGGrey(void);UIColor *SGGreen(void);UIColor *SGRed(void);UIColor *SGPageBackground(void);+UIColor *SGCardBackground(void);UIFont *SGTitleFont(void);UIFont *SGSubtitleFont(void);// Takes the 13pt and 11pt fonts off Spotify's own settings list, once, so the pages match it.void SGAdoptFonts(UIView *list, UIView *exclude);UIImageView *SGSymbolView(NSString *name, CGFloat size, UIImageSymbolWeight weight, CGFloat box);+// A symbol on a rounded grey square, the leading icon of a row that opens a page.+UIImage *SGTileImage(NSString *symbol);// A grey note in a wrapper view, for a table header or footer; SGFitNote sizes it to its text.UIView *SGNote(NSString *text);void SGFitNote(UITableView *table, UIView *wrapper, CGFloat top, CGFloat bottom);diff --git a/tweak/Sources/Settings/SGPageStyle.m b/tweak/Sources/Settings/SGPageStyle.mindex bb968550..d1c270dc 100644--- a/tweak/Sources/Settings/SGPageStyle.m+++ b/tweak/Sources/Settings/SGPageStyle.m@@ -34,9 +34,10 @@ UIView *SGNote(NSString *text) {// loop forever.void SGFitNote(UITableView *table, UIView *wrapper, CGFloat top, CGFloat bottom) {UILabel *label = wrapper.subviews.firstObject;- CGFloat width = table.bounds.size.width - 32;+ CGFloat inset = table.layoutMargins.left;+ CGFloat width = table.bounds.size.width - 2 * inset;CGFloat height = ceil([label sizeThatFits:CGSizeMake(width, CGFLOAT_MAX)].height);- label.frame = CGRectMake(16, top, width, height);+ label.frame = CGRectMake(inset, top, width, height);CGSize size = CGSizeMake(table.bounds.size.width, top + height + bottom);if (CGSizeEqualToSize(wrapper.bounds.size, size)) return;wrapper.frame = (CGRect){wrapper.frame.origin, size};@@ -70,6 +71,21 @@ void SGInsetForBars(UITableView *table) {UIColor *SGGreen(void) { return SGAccentColor() ?: [UIColor colorWithRed:0x1E / 255.0 green:0xD7 / 255.0 blue:0x60 / 255.0 alpha:1]; }UIColor *SGRed(void) { return [UIColor colorWithRed:0xF1 / 255.0 green:0x5E / 255.0 blue:0x6B / 255.0 alpha:1]; }UIColor *SGPageBackground(void) { return SGFlag(SGKeyAmoled, NO) ? UIColor.blackColor : [UIColor colorWithWhite:0x12 / 255.0 alpha:1]; }+// Spotify's own elevated grey on its dark grey; iOS's own card grey on the AMOLED black.+UIColor *SGCardBackground(void) { return [UIColor colorWithWhite:(SGFlag(SGKeyAmoled, NO) ? 0x1C : 0x2A) / 255.0 alpha:1]; }++UIImage *SGTileImage(NSString *symbol) {+ UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:14 weight:UIImageSymbolWeightMedium];+ UIImage *glyph = [[UIImage systemImageNamed:symbol withConfiguration:config] imageWithTintColor:UIColor.whiteColor renderingMode:UIImageRenderingModeAlwaysOriginal];+ CGRect box = CGRectMake(0, 0, 28, 28);+ UIImage *tile = [[[UIGraphicsImageRenderer alloc] initWithSize:box.size] imageWithActions:^(UIGraphicsImageRendererContext *ctx) {+ [[UIColor colorWithWhite:1 alpha:0.12] setFill];+ [[UIBezierPath bezierPathWithRoundedRect:box cornerRadius:7] fill];+ CGSize size = glyph.size;+ [glyph drawInRect:CGRectMake((box.size.width - size.width) / 2, (box.size.height - size.height) / 2, size.width, size.height)];+ }];+ return [tile imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];+}const CGFloat SGSectionHeaderHeight = 38;@@ -91,7 +107,7 @@ void SGFillCell(UITableViewCell *cell, NSString *title, NSString *subtitle, UICocontent.imageToTextPadding = 14;}cell.contentConfiguration = content;- cell.backgroundColor = UIColor.clearColor;+ cell.backgroundColor = SGCardBackground();cell.accessoryView = nil;cell.selectionStyle = UITableViewCellSelectionStyleNone;}