|
|
|
|
|
|
|
|
#define kScreenWidth [[UIScreen mainScreen] bounds].size.width |
|
|
#define kScreenWidth [[UIScreen mainScreen] bounds].size.width |
|
|
#import <AudioToolbox/AudioToolbox.h> |
|
|
|
|
|
#import <AudioToolbox/AudioServices.h> |
|
|
|
|
|
@interface SBTodayTableHeaderView : UIView |
|
|
@interface SBTodayTableHeaderView : UIView |
|
|
-(NSString *)lunarDateHeaderString; |
|
|
-(NSString *)lunarDateHeaderString; |
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
@interface SBAnimationSettings |
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
|
|
|
@interface SBFadeAnimationSettings |
|
|
|
|
|
@property(retain, nonatomic) SBAnimationSettings *dateInSettings; |
|
|
|
|
|
@end |
|
|
|
|
|
|
|
|
@interface SBFLockScreenDateView : UIView |
|
|
@interface SBFLockScreenDateView : UIView |
|
|
@property (nonatomic, assign) UILabel *duplexCalendarLabel; |
|
|
@property (nonatomic, assign) UILabel *duplexCalendarLabel; |
|
|
@property (nonatomic, assign) SBTodayTableHeaderView *todayHeaderView; |
|
|
|
|
|
@property (nonatomic, assign) NSString *todayHeaderViewText; |
|
|
@property (nonatomic, assign) NSString *todayHeaderViewText; |
|
|
@property bool dateHidden; |
|
|
@property bool dateHidden; |
|
|
-(id)_dateFont; |
|
|
-(id)_dateFont; |
|
|
|
|
|
|
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
@interface _UILegibilityLabel : _UILegibilityView |
|
|
@interface _UILegibilityLabel : _UILegibilityView |
|
|
@property (nonatomic, assign) NSString* string; |
|
|
|
|
|
@property (nonatomic, assign) UIFont* font; |
|
|
|
|
|
|
|
|
|
|
|
@end |
|
|
@end |
|
|
|
|
|
|
|
|
extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void); |
|
|
extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void); |
|
|
|
|
|
|
|
|
NSString *offsetYTextField = [prefs objectForKey:@"offsetYTextField"]; |
|
|
NSString *offsetYTextField = [prefs objectForKey:@"offsetYTextField"]; |
|
|
NSString *FontSizeTextField = [prefs objectForKey:@"FontSizeTextField"]; |
|
|
NSString *FontSizeTextField = [prefs objectForKey:@"FontSizeTextField"]; |
|
|
|
|
|
|
|
|
if(originx <= 0.0) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
//if(originx <= 0.0) |
|
|
|
|
|
//{ |
|
|
UILabel *originalLabel = MSHookIvar<UILabel *>(self, "_dateLabel"); |
|
|
UILabel *originalLabel = MSHookIvar<UILabel *>(self, "_dateLabel"); |
|
|
originx = originalLabel.frame.origin.x; |
|
|
originx = originalLabel.frame.origin.x; |
|
|
originy = originalLabel.frame.origin.y; |
|
|
originy = originalLabel.frame.origin.y; |
|
|
sizewidth = originalLabel.frame.size.width; |
|
|
sizewidth = originalLabel.frame.size.width; |
|
|
sizeheight = originalLabel.frame.size.height; |
|
|
sizeheight = originalLabel.frame.size.height; |
|
|
} |
|
|
|
|
|
|
|
|
//} |
|
|
[self.duplexCalendarLabel setFrame:CGRectMake(originx-50+ [offsetXTextField floatValue], originy + 19 + [offsetYTextField floatValue], sizewidth+100, sizeheight)]; |
|
|
[self.duplexCalendarLabel setFrame:CGRectMake(originx-50+ [offsetXTextField floatValue], originy + 19 + [offsetYTextField floatValue], sizewidth+100, sizeheight)]; |
|
|
UIFont *font = self.duplexCalendarLabel.font; |
|
|
UIFont *font = self.duplexCalendarLabel.font; |
|
|
if([FontSizeTextField floatValue] == 0){ |
|
|
if([FontSizeTextField floatValue] == 0){ |
|
|
|
|
|
|
|
|
self.duplexCalendarLabel.hidden = false; |
|
|
self.duplexCalendarLabel.hidden = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
-(void)_updateLabels{ |
|
|
-(void)_updateLabels{ |
|
|
|
|
|
%orig; |
|
|
[self layoutDuplexCalendarLabel]; |
|
|
[self layoutDuplexCalendarLabel]; |
|
|
if(!self.todayHeaderViewText){ |
|
|
|
|
|
|
|
|
//if(!self.todayHeaderViewText){ |
|
|
self.todayHeaderViewText = [stattodayHeaderView lunarDateHeaderString]; |
|
|
self.todayHeaderViewText = [stattodayHeaderView lunarDateHeaderString]; |
|
|
} |
|
|
|
|
|
|
|
|
//} |
|
|
self.duplexCalendarLabel.text = self.todayHeaderViewText; |
|
|
self.duplexCalendarLabel.text = self.todayHeaderViewText; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%orig; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
-(void)_layoutDateLabel { |
|
|
-(void)_layoutDateLabel { |
|
|
[self layoutDuplexCalendarLabel]; |
|
|
|
|
|
%orig; |
|
|
%orig; |
|
|
|
|
|
[self layoutDuplexCalendarLabel]; |
|
|
_UILegibilityLabel *originalLegibilityLabel = MSHookIvar<_UILegibilityLabel *>(self, "_legibilityDateLabel"); |
|
|
_UILegibilityLabel *originalLegibilityLabel = MSHookIvar<_UILegibilityLabel *>(self, "_legibilityDateLabel"); |
|
|
[originalLegibilityLabel setFrame:CGRectMake(originx, originy - 3, sizewidth, sizeheight)]; |
|
|
[originalLegibilityLabel setFrame:CGRectMake(originx, originy - 3, sizewidth, sizeheight)]; |
|
|
} |
|
|
} |
|
|
-(void)updateFormat{ |
|
|
-(void)updateFormat{ |
|
|
[self layoutDuplexCalendarLabel]; |
|
|
|
|
|
%orig; |
|
|
%orig; |
|
|
|
|
|
[self layoutDuplexCalendarLabel]; |
|
|
} |
|
|
} |
|
|
-(void)layoutSubviews { |
|
|
-(void)layoutSubviews { |
|
|
[self layoutDuplexCalendarLabel]; |
|
|
|
|
|
%orig; |
|
|
%orig; |
|
|
|
|
|
[self layoutDuplexCalendarLabel]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%end |
|
|
%end |
|
|
|
|
|
|
|
|
|
|
|
%hook SBFadeAnimationSettings |
|
|
|
|
|
|
|
|
|
|
|
- (void)setDefaultValues { |
|
|
|
|
|
|
|
|
|
|
|
%orig; |
|
|
|
|
|
|
|
|
|
|
|
self.dateInSettings = nil; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
%end |
|
|
|
|
|
|
|
|
%ctor{ |
|
|
%ctor{ |
|
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), |
|
|
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), |