Browse Source

Merge pull request #2 from mcproj/master

iOS 8 fix by mcproj.
master
Gil Shahar 4 years ago
parent
commit
48e446e9b6
No account linked to committer's email address
1 changed files with 4 additions and 21 deletions
  1. +4
    -21
      Tweak.xm

+ 4
- 21
Tweak.xm View File

prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:settingsPath]; prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:settingsPath];
} }


static BOOL isiOS9 = NO;
static BOOL isiOS8Refreshed = NO;
static BOOL isLunarDateRefreshed = NO;
static SBTodayTableHeaderView *stattodayHeaderView; static SBTodayTableHeaderView *stattodayHeaderView;
static SBFLockScreenDateView *lockScreenDateView; static SBFLockScreenDateView *lockScreenDateView;
static float originx = 0.0; static float originx = 0.0;
-(void)_layoutLunarDateLabel{ -(void)_layoutLunarDateLabel{
%orig; %orig;
if(isiOS9) return;
if(!isiOS8Refreshed) {
isiOS8Refreshed = YES;
if(!isLunarDateRefreshed) {
isLunarDateRefreshed = YES;
[lockScreenDateView _updateLabels]; [lockScreenDateView _updateLabels];
lockScreenDateView = nil; lockScreenDateView = nil;
} }
}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;
}
}


} }


} }




-(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;
} }
%end %end


%ctor{ %ctor{
if(@available(iOS 9.0, *)) isiOS9 = YES;
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
(void*)myObserver, (void*)myObserver,
savePressed, savePressed,

Loading…
Cancel
Save