Fount it that iOS 8 fix works for iOS 9 and makes it even look better;

remove iOS 9 codes
This commit is contained in:
Mario Cheung
2020-06-07 02:24:05 +08:00
parent 7c7070d741
commit 63c503dd2b

View File

@ -40,8 +40,7 @@ static void savePressed(CFNotificationCenterRef center, void *observer, CFString
prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:settingsPath]; prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:settingsPath];
} }
static BOOL isiOS9 = NO; static BOOL isLunarDateRefreshed = NO;
static BOOL isiOS8Refreshed = NO;
static SBTodayTableHeaderView *stattodayHeaderView; static SBTodayTableHeaderView *stattodayHeaderView;
static SBFLockScreenDateView *lockScreenDateView; static SBFLockScreenDateView *lockScreenDateView;
static float originx = 0.0; static float originx = 0.0;
@ -58,9 +57,8 @@ static float sizeheight = 0.0;
-(void)_layoutLunarDateLabel{ -(void)_layoutLunarDateLabel{
%orig; %orig;
if(isiOS9) return; if(!isLunarDateRefreshed) {
if(!isiOS8Refreshed) { isLunarDateRefreshed = YES;
isiOS8Refreshed = YES;
[lockScreenDateView _updateLabels]; [lockScreenDateView _updateLabels];
lockScreenDateView = nil; lockScreenDateView = nil;
} }
@ -104,13 +102,6 @@ static float sizeheight = 0.0;
}else{ }else{
self.duplexCalendarLabel.font = [font fontWithSize:[FontSizeTextField floatValue]]; self.duplexCalendarLabel.font = [font fontWithSize:[FontSizeTextField floatValue]];
} }
if(isiOS9 && self.duplexCalendarLabel){
if([self isDateHidden]){
self.duplexCalendarLabel.hidden = true;
}else{
self.duplexCalendarLabel.hidden = false;
}
}
} }
@ -141,18 +132,11 @@ static float sizeheight = 0.0;
} }
-(void)setDateHidden:(bool)arg1{
%orig(arg1);
if(isiOS9 && self.duplexCalendarLabel){
self.duplexCalendarLabel.hidden = arg1;
}
}
-(void)_setDateAlpha:(double)arg1{ -(void)_setDateAlpha:(double)arg1{
%orig(arg1); %orig(arg1);
if(!isiOS9 && self.duplexCalendarLabel){ if(self.duplexCalendarLabel){
UILabel *originalLabel = MSHookIvar<UILabel *>(self, "_dateLabel"); UILabel *originalLabel = MSHookIvar<UILabel *>(self, "_dateLabel");
self.duplexCalendarLabel.alpha = originalLabel.alpha; self.duplexCalendarLabel.alpha = originalLabel.alpha;
} }
@ -173,7 +157,6 @@ self.dateInSettings = nil;
%end %end
%ctor{ %ctor{
if(@available(iOS 9.0, *)) isiOS9 = YES;
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
(void*)myObserver, (void*)myObserver,
savePressed, savePressed,