forked from lint/TFDidThatSay
Add Reddit 2020.41.0 support
This commit is contained in:
@ -164,7 +164,12 @@
|
|||||||
@property(strong, nonatomic) id dayTheme;
|
@property(strong, nonatomic) id dayTheme;
|
||||||
@property(strong, nonatomic) id nightTheme;
|
@property(strong, nonatomic) id nightTheme;
|
||||||
- (id)initWithTraitCollection:(id)arg1 appSettings:(id)arg2;
|
- (id)initWithTraitCollection:(id)arg1 appSettings:(id)arg2;
|
||||||
|
@end
|
||||||
|
|
||||||
|
// >= 2020.41.0
|
||||||
|
@interface RUIThemeGuidance : NSObject
|
||||||
|
@property(strong, nonatomic) RUITheme *currentTheme;
|
||||||
|
+ (id)sharedGuidance;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface AppSettings
|
@interface AppSettings
|
||||||
|
@ -102,33 +102,38 @@ int secondVersionPart = 0;
|
|||||||
id textColor;
|
id textColor;
|
||||||
|
|
||||||
if (firstVersionPart == 2020) {
|
if (firstVersionPart == 2020) {
|
||||||
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
if (secondVersionPart <= 40) {
|
||||||
AppSettings *appSettings = [%c(AppSettings) sharedSettings];
|
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
||||||
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
|
AppSettings *appSettings = [%c(AppSettings) sharedSettings];
|
||||||
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:appSettings];
|
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
|
||||||
isNightMode = [[accountManager defaults] objectForKey:@"kUseNightKey"];
|
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:appSettings];
|
||||||
|
isNightMode = [[accountManager defaults] objectForKey:@"kUseNightKey"];
|
||||||
|
|
||||||
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0") && [appSettings isAutoDarkModeEnabled]) {
|
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0") && [appSettings isAutoDarkModeEnabled]) {
|
||||||
|
|
||||||
NSInteger sysInterfaceStyle = [[UITraitCollection _currentTraitCollection] userInterfaceStyle];
|
NSInteger sysInterfaceStyle = [[UITraitCollection _currentTraitCollection] userInterfaceStyle];
|
||||||
|
|
||||||
|
if (sysInterfaceStyle == UIUserInterfaceStyleDark){
|
||||||
|
textColor = [[themeManager darkTheme] bodyTextColor];
|
||||||
|
} else {
|
||||||
|
textColor = [[themeManager lightTheme] bodyTextColor];
|
||||||
|
}
|
||||||
|
|
||||||
if (sysInterfaceStyle == UIUserInterfaceStyleDark){
|
|
||||||
textColor = [[themeManager darkTheme] bodyTextColor];
|
|
||||||
} else {
|
} else {
|
||||||
textColor = [[themeManager lightTheme] bodyTextColor];
|
|
||||||
|
if (isNightMode) {
|
||||||
|
textColor = [[themeManager darkTheme] bodyTextColor];
|
||||||
|
} else {
|
||||||
|
textColor = [[themeManager lightTheme] bodyTextColor];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[themeManager release];
|
||||||
} else {
|
} else {
|
||||||
|
RUIThemeGuidance *themeGuidance = [%c(RUIThemeGuidance) sharedGuidance];
|
||||||
if (isNightMode) {
|
textColor = [[themeGuidance currentTheme] bodyTextColor];
|
||||||
textColor = [[themeManager darkTheme] bodyTextColor];
|
|
||||||
} else {
|
|
||||||
textColor = [[themeManager lightTheme] bodyTextColor];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[themeManager release];
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (secondVersionPart >= 45) {
|
if (secondVersionPart >= 45) {
|
||||||
@ -263,18 +268,26 @@ int secondVersionPart = 0;
|
|||||||
id textColor;
|
id textColor;
|
||||||
|
|
||||||
if (firstVersionPart == 2020) {
|
if (firstVersionPart == 2020) {
|
||||||
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
||||||
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
|
|
||||||
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]];
|
|
||||||
isNightMode = [[accountManager defaults] objectForKey:@"kUseNightKey"];
|
|
||||||
|
|
||||||
if (isNightMode) {
|
if (secondVersionPart <= 40) {
|
||||||
textColor = [[themeManager darkTheme] bodyTextColor];
|
|
||||||
|
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
||||||
|
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
|
||||||
|
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]];
|
||||||
|
isNightMode = [[accountManager defaults] objectForKey:@"kUseNightKey"];
|
||||||
|
|
||||||
|
if (isNightMode) {
|
||||||
|
textColor = [[themeManager darkTheme] bodyTextColor];
|
||||||
|
} else {
|
||||||
|
textColor = [[themeManager lightTheme] bodyTextColor];
|
||||||
|
}
|
||||||
|
|
||||||
|
[themeManager release];
|
||||||
} else {
|
} else {
|
||||||
textColor = [[themeManager lightTheme] bodyTextColor];
|
RUIThemeGuidance *themeGuidance = [%c(RUIThemeGuidance) sharedGuidance];
|
||||||
|
textColor = [[themeGuidance currentTheme] bodyTextColor];
|
||||||
}
|
}
|
||||||
|
|
||||||
[themeManager release];
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (secondVersionPart >= 45) {
|
if (secondVersionPart >= 45) {
|
||||||
|
Reference in New Issue
Block a user