Add Reddit 2020.41.0 support

This commit is contained in:
lint
2020-10-29 16:31:06 -04:00
parent 088a9acf72
commit dd6539cc3c
2 changed files with 44 additions and 26 deletions

View File

@ -164,7 +164,12 @@
@property(strong, nonatomic) id dayTheme;
@property(strong, nonatomic) id nightTheme;
- (id)initWithTraitCollection:(id)arg1 appSettings:(id)arg2;
@end
// >= 2020.41.0
@interface RUIThemeGuidance : NSObject
@property(strong, nonatomic) RUITheme *currentTheme;
+ (id)sharedGuidance;
@end
@interface AppSettings

View File

@ -102,6 +102,7 @@ int secondVersionPart = 0;
id textColor;
if (firstVersionPart == 2020) {
if (secondVersionPart <= 40) {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
AppSettings *appSettings = [%c(AppSettings) sharedSettings];
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
@ -128,6 +129,10 @@ int secondVersionPart = 0;
}
[themeManager release];
} else {
RUIThemeGuidance *themeGuidance = [%c(RUIThemeGuidance) sharedGuidance];
textColor = [[themeGuidance currentTheme] bodyTextColor];
}
} else {
@ -263,6 +268,9 @@ int secondVersionPart = 0;
id textColor;
if (firstVersionPart == 2020) {
if (secondVersionPart <= 40) {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
AccountManager *accountManager = secondVersionPart >= 29 ? [appDelegate accountManager] : [%c(AccountManager) sharedManager];
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]];
@ -275,6 +283,11 @@ int secondVersionPart = 0;
}
[themeManager release];
} else {
RUIThemeGuidance *themeGuidance = [%c(RUIThemeGuidance) sharedGuidance];
textColor = [[themeGuidance currentTheme] bodyTextColor];
}
} else {
if (secondVersionPart >= 45) {