mirror of
https://github.com/lint/TFDidThatSay
synced 2025-07-04 16:36:46 +00:00
Fix Reddit incorrect text color bug
This commit is contained in:
@ -169,6 +169,8 @@
|
|||||||
|
|
||||||
@interface AppSettings
|
@interface AppSettings
|
||||||
+ (id)sharedSettings;
|
+ (id)sharedSettings;
|
||||||
|
- (BOOL)useDarkMode;
|
||||||
|
- (BOOL)isAutoDarkModeEnabled;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface AccountManager
|
@interface AccountManager
|
||||||
@ -208,3 +210,7 @@
|
|||||||
|
|
||||||
@interface MarkDownParser
|
@interface MarkDownParser
|
||||||
+ (id)attributedStringFromMarkdownString:(id)arg1;
|
+ (id)attributedStringFromMarkdownString:(id)arg1;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface UITraitCollection ()
|
||||||
|
+ (id)_currentTraitCollection;
|
||||||
|
@ -102,16 +102,31 @@ int secondVersionPart = 0;
|
|||||||
id textColor;
|
id textColor;
|
||||||
|
|
||||||
if (firstVersionPart == 2020) {
|
if (firstVersionPart == 2020) {
|
||||||
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]];
|
AppSettings *appSettings = [%c(AppSettings) sharedSettings];
|
||||||
|
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:appSettings];
|
||||||
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
||||||
|
|
||||||
if (isNightMode) {
|
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"13.0") && [appSettings isAutoDarkModeEnabled]) {
|
||||||
textColor = [[themeManager darkTheme] bodyTextColor];
|
|
||||||
|
NSInteger sysInterfaceStyle = [[UITraitCollection _currentTraitCollection] userInterfaceStyle];
|
||||||
|
|
||||||
|
if (sysInterfaceStyle == UIUserInterfaceStyleDark){
|
||||||
|
textColor = [[themeManager darkTheme] bodyTextColor];
|
||||||
|
} else {
|
||||||
|
textColor = [[themeManager lightTheme] bodyTextColor];
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
textColor = [[themeManager lightTheme] bodyTextColor];
|
|
||||||
|
if (isNightMode) {
|
||||||
|
textColor = [[themeManager darkTheme] bodyTextColor];
|
||||||
|
} else {
|
||||||
|
textColor = [[themeManager lightTheme] bodyTextColor];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[themeManager release];
|
[themeManager release];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (secondVersionPart >= 45) {
|
if (secondVersionPart >= 45) {
|
||||||
|
Reference in New Issue
Block a user