reorder settings

This commit is contained in:
qnblackcat 2022-05-09 15:36:21 +07:00
parent 0e2ec9a52e
commit ada2c00338

View file

@ -10,6 +10,7 @@ static const NSInteger uYouPlusSection = 500;
extern BOOL hideHUD(); extern BOOL hideHUD();
extern BOOL oled(); extern BOOL oled();
extern BOOL oledKB();
extern BOOL autoFullScreen(); extern BOOL autoFullScreen();
extern BOOL noHoverCard(); extern BOOL noHoverCard();
extern BOOL ReExplore(); extern BOOL ReExplore();
@ -89,11 +90,11 @@ extern BOOL castConfirm();
return YES; return YES;
}; };
YTSettingsSectionItem *autoFUll = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Auto Full Screen (YTAutoFullScreen)" titleDescription:@"Autoplay videos at full screen."]; YTSettingsSectionItem *autoFull = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Auto Full Screen (YTAutoFullScreen)" titleDescription:@"Autoplay videos at full screen."];
autoFUll.hasSwitch = YES; autoFull.hasSwitch = YES;
autoFUll.switchVisible = YES; autoFull.switchVisible = YES;
autoFUll.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"]; autoFull.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"];
autoFUll.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) { autoFull.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"autofull_enabled"]; [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"autofull_enabled"];
return YES; return YES;
}; };
@ -107,16 +108,25 @@ extern BOOL castConfirm();
return YES; return YES;
}; };
YTSettingsSectionItem *Oleditem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Dark mode (Experimental)" titleDescription:@"WARNING: OLED Dark mode only works when YouTube is in Dark theme. App restart is required. (In case OLED dark mode doesn't work: just switch between Light/Dark theme, then restart the app)."]; YTSettingsSectionItem *oledDarkMode = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Dark mode (Experimental)" titleDescription:@"WARNING: OLED Dark mode only works when YouTube is in Dark theme. App restart is required (In case OLED dark mode doesn't work: just switch between Light/Dark theme, then restart the app)."];
Oleditem.hasSwitch = YES; oledDarkMode.hasSwitch = YES;
Oleditem.switchVisible = YES; oledDarkMode.switchVisible = YES;
Oleditem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"]; oledDarkMode.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"];
Oleditem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) { oledDarkMode.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oled_enabled"]; [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oled_enabled"];
return YES; return YES;
}; };
NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[castConfirm, hoverCardItem, bigYTMiniPlayer, reExplore, hideCC, hideAutoplaySwitch, autoFUll, hideHUD, Oleditem]]; YTSettingsSectionItem *oledKeyBoard = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Keyboard" titleDescription:@"Might not working properly in some cases . App restart is required."];
oledKeyBoard.hasSwitch = YES;
oledKeyBoard.switchVisible = YES;
oledKeyBoard.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"];
oledKeyBoard.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oledKeyBoard_enabled"];
return YES;
};
NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[autoFull, castConfirm, hideAutoplaySwitch, hideCC, hideHUD, hoverCardItem, bigYTMiniPlayer, oledKeyBoard, oledDarkMode,reExplore]];
[delegate setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouPlus" titleDescription:nil headerHidden:NO]; [delegate setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouPlus" titleDescription:nil headerHidden:NO];
} }