浏览代码

Merge pull request #2 from mcproj/master

iOS 8 fix by mcproj.
master
Gil Shahar 3 年前
父节点
当前提交
48e446e9b6
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入21 次删除
  1. +4
    -21
      Tweak.xm

+ 4
- 21
Tweak.xm 查看文件

@@ -40,8 +40,7 @@ static void savePressed(CFNotificationCenterRef center, void *observer, CFString
prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:settingsPath];
}

static BOOL isiOS9 = NO;
static BOOL isiOS8Refreshed = NO;
static BOOL isLunarDateRefreshed = NO;
static SBTodayTableHeaderView *stattodayHeaderView;
static SBFLockScreenDateView *lockScreenDateView;
static float originx = 0.0;
@@ -58,9 +57,8 @@ static float sizeheight = 0.0;
-(void)_layoutLunarDateLabel{
%orig;
if(isiOS9) return;
if(!isiOS8Refreshed) {
isiOS8Refreshed = YES;
if(!isLunarDateRefreshed) {
isLunarDateRefreshed = YES;
[lockScreenDateView _updateLabels];
lockScreenDateView = nil;
}
@@ -104,13 +102,6 @@ static float sizeheight = 0.0;
}else{
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{
%orig(arg1);

if(!isiOS9 && self.duplexCalendarLabel){
if(self.duplexCalendarLabel){
UILabel *originalLabel = MSHookIvar<UILabel *>(self, "_dateLabel");
self.duplexCalendarLabel.alpha = originalLabel.alpha;
}
@@ -173,7 +157,6 @@ self.dateInSettings = nil;
%end

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

正在加载...
取消
保存