forked from gilshahar7/ExactTime
Initial release
This commit is contained in:
1
ExactTime.plist
Normal file
1
ExactTime.plist
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ Filter = { Bundles = ( "com.apple.springboard" ); }; }
|
10
Makefile
Normal file
10
Makefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
ARCHS = armv7 arm64
|
||||||
|
include $(THEOS)/makefiles/common.mk
|
||||||
|
|
||||||
|
TWEAK_NAME = ExactTime
|
||||||
|
ExactTime_FILES = Tweak.xm
|
||||||
|
|
||||||
|
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||||
|
|
||||||
|
after-install::
|
||||||
|
install.exec "killall -9 SpringBoard"
|
47
Tweak.xm
Normal file
47
Tweak.xm
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
@interface NCNotificationDateLabel
|
||||||
|
@property (assign,nonatomic) NSString *text;
|
||||||
|
-(void)sizeToFit;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface NCLookHeaderContentView
|
||||||
|
-(void)_updateDateLabelFontForShortLook;
|
||||||
|
@end
|
||||||
|
|
||||||
|
static bool is24h;
|
||||||
|
|
||||||
|
%hook NCLookHeaderContentView
|
||||||
|
-(void)_updateDateLabelFontForShortLook{
|
||||||
|
%orig;
|
||||||
|
NSDate *date = MSHookIvar<NSDate *>(self, "_date");
|
||||||
|
NSInteger format = MSHookIvar<NSInteger >(self, "_dateFormatStyle");
|
||||||
|
if((date != nil) && (format == 1)){
|
||||||
|
NCNotificationDateLabel *dateLabel = MSHookIvar<NCNotificationDateLabel *>(self, "_dateLabel");
|
||||||
|
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
|
||||||
|
if(is24h)
|
||||||
|
{
|
||||||
|
[dateFormatter setDateFormat:@"HH:mm"];
|
||||||
|
}else{
|
||||||
|
[dateFormatter setDateFormat:@"hh:mm a"];
|
||||||
|
}
|
||||||
|
dateLabel.text = [dateFormatter stringFromDate:date];
|
||||||
|
[dateLabel sizeToFit];
|
||||||
|
[dateFormatter release];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-(void)dateLabelDidChange:(id)arg1{
|
||||||
|
%orig(arg1);
|
||||||
|
[self _updateDateLabelFontForShortLook];
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%ctor{
|
||||||
|
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||||
|
[formatter setLocale:[NSLocale currentLocale]];
|
||||||
|
[formatter setDateStyle:NSDateFormatterNoStyle];
|
||||||
|
[formatter setTimeStyle:NSDateFormatterShortStyle];
|
||||||
|
NSString *dateString = [formatter stringFromDate:[NSDate date]];
|
||||||
|
NSRange amRange = [dateString rangeOfString:[formatter AMSymbol]];
|
||||||
|
NSRange pmRange = [dateString rangeOfString:[formatter PMSymbol]];
|
||||||
|
is24h = (amRange.location == NSNotFound && pmRange.location == NSNotFound);
|
||||||
|
[formatter release];
|
||||||
|
}
|
9
control
Normal file
9
control
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Package: com.gilshahar7.exacttime
|
||||||
|
Name: ExactTime
|
||||||
|
Depends: mobilesubstrate
|
||||||
|
Version: 1.0
|
||||||
|
Architecture: iphoneos-arm
|
||||||
|
Description: Shows the exact time of a notification.
|
||||||
|
Maintainer: gilshahar7
|
||||||
|
Author: gilshahar7
|
||||||
|
Section: Tweaks
|
BIN
packages/com.gilshahar7.exacttime_0.0.1_iphoneos-arm.deb
Normal file
BIN
packages/com.gilshahar7.exacttime_0.0.1_iphoneos-arm.deb
Normal file
Binary file not shown.
BIN
packages/com.gilshahar7.exacttime_1.0_iphoneos-arm.deb
Normal file
BIN
packages/com.gilshahar7.exacttime_1.0_iphoneos-arm.deb
Normal file
Binary file not shown.
Reference in New Issue
Block a user